diff options
author | ByteHamster <info@bytehamster.com> | 2023-05-05 19:42:51 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2023-05-05 19:43:45 +0200 |
commit | f8be7d596d098e534039908ade8270e13168fd23 (patch) | |
tree | aa168885671cf49293c8a5eec088f0fedfaaa54b /app/src/main | |
parent | 967e289f91f51d0b5a91fdd598c3f42bd995299a (diff) | |
parent | b063f0508f6e6439509f22769374c57f77cb499f (diff) | |
download | AntennaPod-f8be7d596d098e534039908ade8270e13168fd23.zip |
Merge branch 'master' into develop
Diffstat (limited to 'app/src/main')
10 files changed, 47 insertions, 19 deletions
diff --git a/app/src/main/assets/special_thanks.csv b/app/src/main/assets/special_thanks.csv index ab44bd7f4..5758d48c0 100644 --- a/app/src/main/assets/special_thanks.csv +++ b/app/src/main/assets/special_thanks.csv @@ -1,4 +1,6 @@ -221 Pixels;Logo design;https://avatars2.githubusercontent.com/u/58243143?s=60&v=4 -Anxhelo Lushka;Website design;https://avatars2.githubusercontent.com/u/25004151?s=60&v=4 -ByteHamster;Forum admin;https://avatars2.githubusercontent.com/u/5811634?s=60&v=4 -Keunes;Communications;https://avatars2.githubusercontent.com/u/11229646?s=60&v=4 +ByteHamster;Project lead;https://avatars2.githubusercontent.com/u/5811634?s=60&v=4 +Keunes;Project lead;https://avatars2.githubusercontent.com/u/11229646?s=60&v=4 +Femmdi;Translations coordinator;https://avatars2.githubusercontent.com/u/47671383?s=60&v=4 +Ryan Gorley (Freehive);2023 brand design;https://avatars2.githubusercontent.com/u/12849958?s=60&v=4 +221 Pixels;2020 brand design;https://avatars2.githubusercontent.com/u/58243143?s=60&v=4 +Anxhelo Lushka;2020 website design;https://avatars2.githubusercontent.com/u/25004151?s=60&v=4 diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 7851e5b9a..bd467076a 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -516,7 +516,11 @@ public class MainActivity extends CastEnabledActivity { String toPage = UserPreferences.getDefaultPage(); if (NavDrawerFragment.getLastNavFragment(this).equals(toPage) || UserPreferences.DEFAULT_PAGE_REMEMBER.equals(toPage)) { - super.onBackPressed(); + if (UserPreferences.backButtonOpensDrawer() && drawerLayout != null) { + drawerLayout.openDrawer(navDrawer); + } else { + super.onBackPressed(); + } } else { loadFragment(toPage, null); } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java index cc32261da..0ec7018a7 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java @@ -1,7 +1,6 @@ package de.danoeh.antennapod.adapter; import android.app.Activity; -import android.content.Context; import android.os.Build; import android.view.ContextMenu; import android.view.InputDevice; @@ -15,7 +14,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.recyclerview.widget.RecyclerView; -import com.google.android.material.elevation.SurfaceColors; +import de.danoeh.antennapod.ui.common.ThemeUtils; import org.apache.commons.lang3.ArrayUtils; import java.lang.ref.WeakReference; @@ -120,9 +119,8 @@ public class EpisodeItemListAdapter extends SelectableAdapter<EpisodeItemViewHol if (inActionMode()) { holder.secondaryActionButton.setOnClickListener(null); if (isSelected(pos)) { - Context context = mainActivityRef.get(); - float density = context.getResources().getDisplayMetrics().density; - holder.itemView.setBackgroundColor(SurfaceColors.getColorForElevation(context, 8 * density)); + holder.itemView.setBackgroundColor(0x88000000 + + (0xffffff & ThemeUtils.getColorFromAttr(mainActivityRef.get(), R.attr.colorAccent))); } else { holder.itemView.setBackgroundResource(android.R.color.transparent); } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java index 18bec12ca..ef784e9ee 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesListFragment.java @@ -425,13 +425,16 @@ public abstract class EpisodesListFragment extends Fragment .observeOn(AndroidSchedulers.mainThread()) .subscribe( data -> { + final boolean restoreScrollPosition = episodes.isEmpty(); episodes = data.first; hasMoreItems = !(page == 1 && episodes.size() < EPISODES_PER_PAGE); progressBar.setVisibility(View.GONE); listAdapter.setDummyViews(0); listAdapter.updateItems(episodes); listAdapter.setTotalNumberOfItems(data.second); - recyclerView.restoreScrollPosition(getPrefName()); + if (restoreScrollPosition) { + recyclerView.restoreScrollPosition(getPrefName()); + } updateToolbar(); }, error -> { listAdapter.setDummyViews(0); 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 a773796e5..fe97cb265 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,6 +2,7 @@ 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; @@ -60,6 +61,10 @@ public class PlaybackPreferencesFragment extends PreferenceFragmentCompat { UsageStatistics.doNotAskAgain(UsageStatistics.ACTION_STREAM); return true; }); + if (Build.VERSION.SDK_INT >= 31) { + findPreference(UserPreferences.PREF_UNPAUSE_ON_HEADSET_RECONNECT).setVisible(false); + findPreference(UserPreferences.PREF_UNPAUSE_ON_BLUETOOTH_RECONNECT).setVisible(false); + } buildEnqueueLocationPreference(); } diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java index 80e7fdb1e..0a1b56e25 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java @@ -130,6 +130,11 @@ public class PreferenceUpgrader { "" + UserPreferences.EPISODE_CACHE_SIZE_UNLIMITED).apply(); } } + if (oldVersion < 3000007) { + if (prefs.getString("prefBackButtonBehavior", "").equals("drawer")) { + prefs.edit().putBoolean(UserPreferences.PREF_BACK_OPENS_DRAWER, true).apply(); + } + } if (oldVersion < 3010000) { if (prefs.getString(UserPreferences.PREF_THEME, "system").equals("2")) { prefs.edit() diff --git a/app/src/main/java/de/danoeh/antennapod/ui/home/sections/SubscriptionsSection.java b/app/src/main/java/de/danoeh/antennapod/ui/home/sections/SubscriptionsSection.java index 9dbd34b4a..bafc01bf6 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/home/sections/SubscriptionsSection.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/home/sections/SubscriptionsSection.java @@ -1,5 +1,7 @@ package de.danoeh.antennapod.ui.home.sections; +import android.content.Context; +import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.ContextMenu; @@ -19,6 +21,7 @@ import de.danoeh.antennapod.event.FeedListUpdateEvent; import de.danoeh.antennapod.fragment.SubscriptionFragment; import de.danoeh.antennapod.model.feed.Feed; import de.danoeh.antennapod.ui.home.HomeSection; +import de.danoeh.antennapod.ui.statistics.StatisticsFragment; import io.reactivex.Observable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; @@ -88,7 +91,10 @@ public class SubscriptionsSection extends HomeSection { if (disposable != null) { disposable.dispose(); } - disposable = Observable.fromCallable(() -> DBReader.getStatistics(true, 0, Long.MAX_VALUE).feedTime) + SharedPreferences prefs = getContext().getSharedPreferences(StatisticsFragment.PREF_NAME, Context.MODE_PRIVATE); + boolean includeMarkedAsPlayed = prefs.getBoolean(StatisticsFragment.PREF_INCLUDE_MARKED_PLAYED, false); + disposable = Observable.fromCallable(() -> + DBReader.getStatistics(includeMarkedAsPlayed, 0, Long.MAX_VALUE).feedTime) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(statisticsData -> { diff --git a/app/src/main/play/release-notes/en-US/default.txt b/app/src/main/play/release-notes/en-US/default.txt index eb8f6d4db..57ca70d8e 100644 --- a/app/src/main/play/release-notes/en-US/default.txt +++ b/app/src/main/play/release-notes/en-US/default.txt @@ -1 +1,7 @@ -This is a beta release. +∙ Add Home screen, with quick access to the queued and latest episodes, favourite podcasts and surprise suggestions (@ByteHamster) +∙ Apply Material Design 3, including a theme colour based on your wallpaper [Android 12+ only] (idem) +∙ Better spread episodes while using smart shuffle (idem) +∙ Enable multi-select in Inbox (idem) +∙ Other improvements (e.g. for local feeds) and bugfixes (idem) +∙ Refreshed icon/branding (Ryan Gorley/Freehive) +∙ Allow editing podcast feed URLs (@ricardoborgesjr) diff --git a/app/src/main/res/xml/preferences_playback.xml b/app/src/main/res/xml/preferences_playback.xml index b59c9a055..57bfe21d7 100644 --- a/app/src/main/res/xml/preferences_playback.xml +++ b/app/src/main/res/xml/preferences_playback.xml @@ -28,12 +28,6 @@ android:key="prefPauseForFocusLoss" android:summary="@string/pref_pausePlaybackForFocusLoss_sum" android:title="@string/pref_pausePlaybackForFocusLoss_title"/> - <SwitchPreferenceCompat - android:defaultValue="true" - android:enabled="true" - android:key="prefResumeAfterCall" - android:summary="@string/pref_resumeAfterCall_sum" - android:title="@string/pref_resumeAfterCall_title"/> </PreferenceCategory> <PreferenceCategory android:title="@string/playback_control"> diff --git a/app/src/main/res/xml/preferences_user_interface.xml b/app/src/main/res/xml/preferences_user_interface.xml index 02d15f6d4..733649ce1 100644 --- a/app/src/main/res/xml/preferences_user_interface.xml +++ b/app/src/main/res/xml/preferences_user_interface.xml @@ -82,6 +82,11 @@ android:title="@string/pref_default_page" android:summary="@string/pref_default_page_sum" android:defaultValue="HomeFragment"/> + <SwitchPreferenceCompat + android:key="prefBackButtonOpensDrawer" + android:title="@string/pref_back_button_opens_drawer" + android:summary="@string/pref_back_button_opens_drawer_summary" + android:defaultValue="false"/> <Preference android:key="prefSwipe" android:summary="@string/swipeactions_summary" |