diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2020-01-09 17:06:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-09 17:06:11 +0100 |
commit | 34f19ed967d4a6474c3928a36deb1c25935dfa53 (patch) | |
tree | 361e3b1ba92609936b0a9a41763ae2a4e7d141a1 /app | |
parent | 7f402168b7d51999dfe73058115e6184ee1ffb90 (diff) | |
parent | f615b38d84c1bbffa6e3f2b3c306103065a6e122 (diff) | |
download | AntennaPod-34f19ed967d4a6474c3928a36deb1c25935dfa53.zip |
Merge branch 'develop' into do-not-allocate-arrays
Diffstat (limited to 'app')
14 files changed, 132 insertions, 71 deletions
diff --git a/app/build.gradle b/app/build.gradle index b25e814b8..498111189 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,8 +18,8 @@ android { // "1.2.3-SNAPSHOT" -> 1020300 // "1.2.3-RC4" -> 1020304 // "1.2.3" -> 1020395 - versionCode 1080005 - versionName "1.8.0-RC5" + versionCode 1080008 + versionName "1.8.0-RC8" testApplicationId "de.test.antennapod" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" generatedDensities = [] diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 086206dcd..ad68fcfe3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -236,7 +236,6 @@ android:value="de.danoeh.antennapod.activity.MainActivity"/> <!-- URLs ending with '.xml' or '.rss' --> - <intent-filter> <action android:name="android.intent.action.VIEW"/> @@ -252,7 +251,6 @@ </intent-filter> <!-- Feedburner URLs --> - <intent-filter> <action android:name="android.intent.action.VIEW"/> @@ -268,7 +266,6 @@ </intent-filter> <!-- Files with mimeType rss/xml/atom --> - <intent-filter> <action android:name="android.intent.action.VIEW"/> @@ -284,7 +281,6 @@ </intent-filter> <!-- Podcast protocols --> - <intent-filter> <action android:name="android.intent.action.VIEW"/> @@ -297,6 +293,21 @@ <data android:scheme="antennapod-subscribe"/> </intent-filter> + <!-- Support for subscribeonandroid.com URLS --> + <intent-filter> + <action android:name="android.intent.action.VIEW" /> + + <category android:name="android.intent.category.DEFAULT" /> + <category android:name="android.intent.category.BROWSABLE" /> + + <data android:pathPattern=".*\\..*/.*" /> + <data android:host="subscribeonandroid.com" /> + <data android:host="www.subscribeonandroid.com" /> + <data android:host="*subscribeonandroid.com" /> + <data android:scheme="http" /> + <data android:scheme="https" /> + </intent-filter> + <intent-filter> <action android:name="android.intent.action.SEND"/> diff --git a/app/src/main/assets/developers.csv b/app/src/main/assets/developers.csv index 460e896f9..80ef04970 100644 --- a/app/src/main/assets/developers.csv +++ b/app/src/main/assets/developers.csv @@ -5,8 +5,8 @@ TomHennen;5216560;Maintainer (retired) orionlee;250644;Contributor domingos86;9538859;Contributor andersonvom;69922;Contributor -patheticpat;16046;Contributor spacecowboy;223655;Contributor +patheticpat;16046;Contributor brad;1614;Contributor Cj-Malone;10121513;Contributor gaul;848247;Contributor diff --git a/app/src/main/assets/translators.csv b/app/src/main/assets/translators.csv index 9670fb652..82a3e9819 100644 --- a/app/src/main/assets/translators.csv +++ b/app/src/main/assets/translators.csv @@ -3,14 +3,14 @@ Asturian (ast_ES);enolp Azerbaijani;danieloeh, kotfenix Basque;gaztainalde, pospolos, zakurranputza Bulgarian;solusitor -Catalan;dvd1985, exort12, javiercoll, lambdani, marcmetallextrem, xc70 +Catalan;dvd1985, exort12, javiercoll, Kintu, lambdani, marcmetallextrem, xc70 Chinese (zh_CN);bebeauties38, cyril3, domingos86, dudeG, ErlichLiu, Felix2yu, gaohongyuan, Guaidaodl, Huck0, iconteral, JayYoung, jhxie, kavdx, kyleehee, linxiangyu, molisiye, owen8877, RainSlide, Sak94664, spice2wolf, stellaxuyi, tupunco, wi24rd, wongsyrone, xukeek, yangyang, yiqiok, YogaGuru Chinese (zh_TW);gugod, nigelinux, pggdt, Solomon, ymhuang0808 Czech (cs_CZ);anotheranonymoususer, elich, Hanzmeister, mcepl, petnek, svetlemodry Danish;CasperHN, jhertel Dutch;e2jk, glotzbach, rwv, Vistaus English;mfietz, sterylmreep -Estonian;Eraser +Estonian;ByteHamster, Eraser, mahfiaz Finnish;danieloeh, elguitar, Sahtor French;cactux, ChaoticMind, clombion, e2jk, edewaele, lacouture, LouFex, Matth78, mfietz, Poussinou, repat, Sioul, sterylmreep, TacoTheDank, Tilwa, vcariven, whenrow Galician;antiparvos, pikamoku, Raichely diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java index a0530fb95..50a8d0965 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -134,6 +134,10 @@ public class OnlineFeedViewActivity extends AppCompatActivity { } else { Log.d(TAG, "Activity was started with url " + feedUrl); setLoadingLayout(); + // Remove subscribeonandroid.com from feed URL in order to subscribe to the actual feed URL + if (feedUrl.contains("subscribeonandroid.com")) { + feedUrl = feedUrl.replaceFirst("((www.)?(subscribeonandroid.com/))", ""); + } if (savedInstanceState == null) { startFeedDownload(feedUrl, null, null); } else { diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java index 9cd5cc3ab..eafc4b0a6 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java @@ -245,8 +245,9 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR public void onClick(View v) { MainActivity mainActivity = mainActivityRef.get(); if (mainActivity != null) { - long[] ids = itemAccess.getItemsIds().toArray(); - mainActivity.loadChildFragment(ItemPagerFragment.newInstance(ids, getAdapterPosition())); + LongList itemIds = itemAccess.getItemsIds(); + long[] ids = itemIds.toArray(); + mainActivity.loadChildFragment(ItemPagerFragment.newInstance(ids, itemIds.indexOf(item.getId()))); } } diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index 100e33e0f..d583c0e1e 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -51,7 +51,7 @@ public class EpisodesApplyActionFragment extends Fragment { public static final int ACTION_REMOVE_FROM_QUEUE = 2; private static final int ACTION_MARK_PLAYED = 4; private static final int ACTION_MARK_UNPLAYED = 8; - private static final int ACTION_DOWNLOAD = 16; + public static final int ACTION_DOWNLOAD = 16; public static final int ACTION_DELETE = 32; private static final int ACTION_ALL = ACTION_ADD_TO_QUEUE | ACTION_REMOVE_FROM_QUEUE | ACTION_MARK_PLAYED | ACTION_MARK_UNPLAYED | ACTION_DOWNLOAD | ACTION_DELETE; @@ -480,7 +480,7 @@ public class EpisodesApplyActionFragment extends Fragment { // download the check episodes in the same order as they are currently displayed List<FeedItem> toDownload = new ArrayList<>(checkedIds.size()); for(FeedItem episode : episodes) { - if(checkedIds.contains(episode.getId())) { + if(checkedIds.contains(episode.getId()) && episode.hasMedia()) { toDownload.add(episode); } } @@ -490,7 +490,7 @@ public class EpisodesApplyActionFragment extends Fragment { e.printStackTrace(); DownloadRequestErrorDialogCreator.newRequestErrorDialog(getActivity(), e.getMessage()); } - close(R.plurals.downloading_batch_label, checkedIds.size()); + close(R.plurals.downloading_batch_label, toDownload.size()); } private void deleteChecked() { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java index 8df2c3819..fdb74fa64 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java @@ -1,5 +1,7 @@ package de.danoeh.antennapod.fragment; +import android.content.Context; +import android.content.SharedPreferences; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.recyclerview.widget.LinearLayoutManager; @@ -20,6 +22,8 @@ import de.danoeh.antennapod.dialog.FilterDialog; import io.reactivex.Observable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; import java.util.List; import java.util.Set; @@ -32,12 +36,13 @@ public class AllEpisodesFragment extends EpisodesListFragment { public static final String TAG = "AllEpisodesFragment"; private static final String PREF_NAME = "PrefAllEpisodesFragment"; + private static final String PREF_FILTER = "filter"; private static final int EPISODES_PER_PAGE = 150; private static final int VISIBLE_EPISODES_SCROLL_THRESHOLD = 5; private static int page = 1; - private static FeedItemFilter feedItemFilter = new FeedItemFilter(""); + private FeedItemFilter feedItemFilter = new FeedItemFilter(""); @Override protected boolean showOnlyNewEpisodes() { @@ -69,6 +74,9 @@ public class AllEpisodesFragment extends EpisodesListFragment { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = super.onCreateView(inflater, container, savedInstanceState); + SharedPreferences prefs = getActivity().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); + feedItemFilter = new FeedItemFilter(prefs.getString(PREF_FILTER, "")); + recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { /* Total number of episodes after last load */ @@ -147,6 +155,8 @@ public class AllEpisodesFragment extends EpisodesListFragment { @Override protected void updateFilter(Set<String> filterValues) { feedItemFilter = new FeedItemFilter(filterValues.toArray(new String[0])); + SharedPreferences prefs = getActivity().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); + prefs.edit().putString(PREF_FILTER, StringUtils.join(filterValues, ",")).apply(); loadItems(); } }; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java index fdac649d1..20188a8a6 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemPagerFragment.java @@ -50,9 +50,6 @@ public class ItemPagerFragment extends Fragment { * @return The ItemFragment instance */ public static ItemPagerFragment newInstance(long[] feeditems, int feedItemPos) { - if (feeditems.length <= feedItemPos) { - throw new IllegalArgumentException("Trying to show a feed item that is out of the list"); - } ItemPagerFragment fragment = new ItemPagerFragment(); Bundle args = new Bundle(); args.putLongArray(ARG_FEEDITEMS, feeditems); @@ -62,7 +59,6 @@ public class ItemPagerFragment extends Fragment { } private long[] feedItems; - private int feedItemPos; private FeedItem item; private Disposable disposable; @@ -70,9 +66,6 @@ public class ItemPagerFragment extends Fragment { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); - - feedItems = getArguments().getLongArray(ARG_FEEDITEMS); - feedItemPos = getArguments().getInt(ARG_FEEDITEM_POS); } @Override @@ -81,6 +74,9 @@ public class ItemPagerFragment extends Fragment { super.onCreateView(inflater, container, savedInstanceState); View layout = inflater.inflate(R.layout.feeditem_pager_fragment, container, false); + feedItems = getArguments().getLongArray(ARG_FEEDITEMS); + int feedItemPos = getArguments().getInt(ARG_FEEDITEM_POS); + ViewPager pager = layout.findViewById(R.id.pager); // FragmentStatePagerAdapter documentation: // > When using FragmentStatePagerAdapter the host ViewPager must have a valid ID set. diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index b36ce6145..46e8789d4 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -69,6 +69,7 @@ import io.reactivex.schedulers.Schedulers; import static de.danoeh.antennapod.dialog.EpisodesApplyActionFragment.ACTION_DELETE; import static de.danoeh.antennapod.dialog.EpisodesApplyActionFragment.ACTION_REMOVE_FROM_QUEUE; +import static de.danoeh.antennapod.dialog.EpisodesApplyActionFragment.ACTION_DOWNLOAD; /** * Shows all items in the queue @@ -349,7 +350,7 @@ public class QueueFragment extends Fragment { return true; case R.id.episode_actions: ((MainActivity) requireActivity()).loadChildFragment( - EpisodesApplyActionFragment.newInstance(queue, ACTION_DELETE | ACTION_REMOVE_FROM_QUEUE)); + EpisodesApplyActionFragment.newInstance(queue, ACTION_DELETE | ACTION_REMOVE_FROM_QUEUE | ACTION_DOWNLOAD)); return true; case R.id.queue_sort_episode_title_asc: setSortOrder(SortOrder.EPISODE_TITLE_A_Z); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java index 1214edf2c..6befa7e18 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java @@ -2,21 +2,22 @@ package de.danoeh.antennapod.fragment; import android.content.Context; import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.fragment.app.ListFragment; -import androidx.core.view.MenuItemCompat; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.SearchView; import android.util.Log; +import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; import android.widget.ListView; - -import java.util.ArrayList; -import java.util.List; - +import android.widget.ProgressBar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.SearchView; +import androidx.core.view.MenuItemCompat; +import androidx.fragment.app.Fragment; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.adapter.SearchlistAdapter; @@ -26,17 +27,20 @@ import de.danoeh.antennapod.core.feed.FeedComponent; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.SearchResult; import de.danoeh.antennapod.core.storage.FeedSearcher; +import de.danoeh.antennapod.view.EmptyViewHandler; import io.reactivex.Observable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; import io.reactivex.schedulers.Schedulers; +import java.util.ArrayList; +import java.util.List; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; /** * Performs a search operation on all feeds or one specific feed and displays the search result. */ -public class SearchFragment extends ListFragment { +public class SearchFragment extends Fragment implements AdapterView.OnItemClickListener { private static final String TAG = "SearchFragment"; private static final String ARG_QUERY = "query"; @@ -45,6 +49,9 @@ public class SearchFragment extends ListFragment { private SearchlistAdapter searchAdapter; private List<SearchResult> searchResults = new ArrayList<>(); private Disposable disposable; + private ListView listView; + private ProgressBar progressBar; + private EmptyViewHandler emptyViewHandler; /** * Create a new SearchFragment that searches all feeds. @@ -84,26 +91,30 @@ public class SearchFragment extends ListFragment { @Override public void onStop() { super.onStop(); - if(disposable != null) { + if (disposable != null) { disposable.dispose(); } } + @Nullable @Override - public void onViewCreated(View view, Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - // add padding - final ListView lv = getListView(); - lv.setClipToPadding(false); - final int vertPadding = getResources().getDimensionPixelSize(R.dimen.list_vertical_padding); - lv.setPadding(0, vertPadding, 0, vertPadding); - + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(R.string.search_label); + View layout = inflater.inflate(R.layout.search_fragment, container, false); + listView = layout.findViewById(R.id.listview); + progressBar = layout.findViewById(R.id.progressBar); searchAdapter = new SearchlistAdapter(getActivity(), itemAccess); - setListAdapter(searchAdapter); + listView.setAdapter(searchAdapter); + listView.setOnItemClickListener(this); + + emptyViewHandler = new EmptyViewHandler(getContext()); + emptyViewHandler.attachToListView(listView); + emptyViewHandler.setIcon(R.attr.action_search); + emptyViewHandler.setTitle(R.string.search_status_no_results); EventBus.getDefault().register(this); + return layout; } @Override @@ -113,9 +124,8 @@ public class SearchFragment extends ListFragment { } @Override - public void onListItemClick(ListView l, View v, int position, long id) { - super.onListItemClick(l, v, position, id); - SearchResult result = (SearchResult) l.getAdapter().getItem(position); + public void onItemClick(AdapterView<?> parent, View view, int position, long id) { + SearchResult result = (SearchResult) listView.getAdapter().getItem(position); FeedComponent comp = result.getComponent(); if (comp.getClass() == Feed.class) { ((MainActivity) getActivity()).loadFeedFragmentById(comp.getId(), null); @@ -128,7 +138,7 @@ public class SearchFragment extends ListFragment { } @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); MenuItem item = menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label); MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); @@ -158,10 +168,11 @@ public class SearchFragment extends ListFragment { } private void onSearchResults(List<SearchResult> results) { + progressBar.setVisibility(View.GONE); searchResults = results; searchAdapter.notifyDataSetChanged(); String query = getArguments().getString(ARG_QUERY); - setEmptyText(getString(R.string.no_results_for_query, query)); + emptyViewHandler.setMessage(getString(R.string.no_results_for_query, query)); } private final SearchlistAdapter.ItemAccess itemAccess = new SearchlistAdapter.ItemAccess() { @@ -181,9 +192,11 @@ public class SearchFragment extends ListFragment { }; private void search() { - if(disposable != null) { + if (disposable != null) { disposable.dispose(); } + progressBar.setVisibility(View.VISIBLE); + emptyViewHandler.hide(); disposable = Observable.fromCallable(this::performSearch) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/PlaybackPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/PlaybackPreferencesFragment.java index b82bba89b..34684ac49 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/PlaybackPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/PlaybackPreferencesFragment.java @@ -2,29 +2,28 @@ package de.danoeh.antennapod.fragment.preferences; import android.app.Activity; import android.content.res.Resources; -import android.os.Build; import android.os.Bundle; - import androidx.annotation.NonNull; import androidx.collection.ArrayMap; import androidx.preference.ListPreference; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; - -import java.util.Map; - import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MediaplayerActivity; import de.danoeh.antennapod.activity.PreferenceActivity; +import de.danoeh.antennapod.core.event.UnreadItemsUpdateEvent; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.util.gui.PictureInPictureUtil; import de.danoeh.antennapod.dialog.VariableSpeedDialog; import de.danoeh.antennapod.preferences.PreferenceControllerFlavorHelper; +import java.util.Map; +import org.greenrobot.eventbus.EventBus; public class PlaybackPreferencesFragment extends PreferenceFragmentCompat { private static final String PREF_PLAYBACK_SPEED_LAUNCHER = "prefPlaybackSpeedLauncher"; private static final String PREF_PLAYBACK_REWIND_DELTA_LAUNCHER = "prefPlaybackRewindDeltaLauncher"; private static final String PREF_PLAYBACK_FAST_FORWARD_DELTA_LAUNCHER = "prefPlaybackFastForwardDeltaLauncher"; + private static final String PREF_PLAYBACK_PREFER_STREAMING = "prefStreamOverDownload"; @Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { @@ -44,26 +43,28 @@ public class PlaybackPreferencesFragment extends PreferenceFragmentCompat { private void setupPlaybackScreen() { final Activity activity = getActivity(); - findPreference(PREF_PLAYBACK_SPEED_LAUNCHER) - .setOnPreferenceClickListener(preference -> { - VariableSpeedDialog.showDialog(activity); - return true; - }); - findPreference(PREF_PLAYBACK_REWIND_DELTA_LAUNCHER) - .setOnPreferenceClickListener(preference -> { - MediaplayerActivity.showSkipPreference(activity, MediaplayerActivity.SkipDirection.SKIP_REWIND); - return true; - }); - findPreference(PREF_PLAYBACK_FAST_FORWARD_DELTA_LAUNCHER) - .setOnPreferenceClickListener(preference -> { - MediaplayerActivity.showSkipPreference(activity, MediaplayerActivity.SkipDirection.SKIP_FORWARD); - return true; - }); + findPreference(PREF_PLAYBACK_SPEED_LAUNCHER).setOnPreferenceClickListener(preference -> { + VariableSpeedDialog.showDialog(activity); + return true; + }); + findPreference(PREF_PLAYBACK_REWIND_DELTA_LAUNCHER).setOnPreferenceClickListener(preference -> { + MediaplayerActivity.showSkipPreference(activity, MediaplayerActivity.SkipDirection.SKIP_REWIND); + return true; + }); + findPreference(PREF_PLAYBACK_FAST_FORWARD_DELTA_LAUNCHER).setOnPreferenceClickListener(preference -> { + MediaplayerActivity.showSkipPreference(activity, MediaplayerActivity.SkipDirection.SKIP_FORWARD); + return true; + }); if (!PictureInPictureUtil.supportsPictureInPicture(activity)) { - ListPreference behaviour = (ListPreference) findPreference(UserPreferences.PREF_VIDEO_BEHAVIOR); + ListPreference behaviour = findPreference(UserPreferences.PREF_VIDEO_BEHAVIOR); behaviour.setEntries(R.array.video_background_behavior_options_without_pip); behaviour.setEntryValues(R.array.video_background_behavior_values_without_pip); } + findPreference(PREF_PLAYBACK_PREFER_STREAMING).setOnPreferenceChangeListener((preference, newValue) -> { + // Update all visible lists to reflect new streaming action button + EventBus.getDefault().post(new UnreadItemsUpdateEvent()); + return true; + }); buildEnqueueLocationPreference(); } diff --git a/app/src/main/java/de/danoeh/antennapod/view/EmptyViewHandler.java b/app/src/main/java/de/danoeh/antennapod/view/EmptyViewHandler.java index a2d8ec091..9471db0a1 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/EmptyViewHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/view/EmptyViewHandler.java @@ -45,6 +45,10 @@ public class EmptyViewHandler { tvMessage.setText(message);
}
+ public void setMessage(String message) {
+ tvMessage.setText(message);
+ }
+
public void setIcon(@AttrRes int iconAttr) {
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(iconAttr, typedValue, true);
diff --git a/app/src/main/res/layout/search_fragment.xml b/app/src/main/res/layout/search_fragment.xml new file mode 100644 index 000000000..6f455a056 --- /dev/null +++ b/app/src/main/res/layout/search_fragment.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="match_parent" + android:layout_width="match_parent"> + + <ProgressBar + android:id="@+id/progressBar" + style="?android:attr/progressBarStyle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" /> + + <ListView + android:id="@+id/listview" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:clipToPadding="false" + android:paddingLeft="@dimen/list_vertical_padding" + android:paddingRight="@dimen/list_vertical_padding" /> +</FrameLayout>
\ No newline at end of file |