diff options
author | ByteHamster <info@bytehamster.com> | 2023-02-20 23:19:34 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2023-02-20 23:19:34 +0100 |
commit | 2b22d4b6977f9a22abfd4bc2d269c79834551ee2 (patch) | |
tree | 58582dd73eafe2c536aa2c842b5609ded3735040 /app | |
parent | e58e2d063948fe52e5fed1536548b6c4220be8fb (diff) | |
parent | 2833812238c19d16d464c337adeecc575ff484ba (diff) | |
download | AntennaPod-2b22d4b6977f9a22abfd4bc2d269c79834551ee2.zip |
Merge branch 'master' into develop
Diffstat (limited to 'app')
12 files changed, 80 insertions, 19 deletions
diff --git a/app/build.gradle b/app/build.gradle index 8903b9188..72442427f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { // Version code schema: // "1.2.3-beta4" -> 1020304 // "1.2.3" -> 1020395 - versionCode 3000003 - versionName "3.0.0-beta3" + versionCode 3000006 + versionName "3.0.0-beta6" def commit = "" try { diff --git a/app/src/main/assets/website-languages.txt b/app/src/main/assets/website-languages.txt index fbbe50993..64361314b 100644 --- a/app/src/main/assets/website-languages.txt +++ b/app/src/main/assets/website-languages.txt @@ -3,3 +3,5 @@ fr nl it da +de +es 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 ac4570fc5..fad586328 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -207,10 +207,7 @@ public class MainActivity extends CastEnabledActivity { audioPlayer.scrollToPage(AudioPlayerFragment.POS_COVER); } - float condensedSlideOffset = Math.max(0.0f, Math.min(0.2f, slideOffset - 0.2f)) / 0.2f; - audioPlayer.getExternalPlayerHolder().setAlpha(1 - condensedSlideOffset); - audioPlayer.getExternalPlayerHolder().setVisibility( - condensedSlideOffset > 0.99f ? View.GONE : View.VISIBLE); + audioPlayer.fadePlayerToToolbar(slideOffset); } }; diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java index 31e6efc5a..1589f06cc 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java @@ -86,7 +86,7 @@ public class ChaptersListAdapter extends RecyclerView.Adapter<ChaptersListAdapte if (position == currentChapterIndex) { float density = context.getResources().getDisplayMetrics().density; - holder.itemView.setBackgroundColor(SurfaceColors.getColorForElevation(context, 8 * density)); + holder.itemView.setBackgroundColor(SurfaceColors.getColorForElevation(context, 32 * density)); float progress = ((float) (currentChapterPosition - sc.getStart())) / duration; progress = Math.max(progress, CircularProgressBar.MINIMUM_PERCENTAGE); progress = Math.min(progress, CircularProgressBar.MAXIMUM_PERCENTAGE); diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java index 722435f48..3d92fd979 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java @@ -7,14 +7,15 @@ import android.text.format.DateFormat; import android.view.LayoutInflater; import android.view.View; import android.widget.ArrayAdapter; +import androidx.appcompat.app.AlertDialog; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.storage.preferences.UserPreferences; import de.danoeh.antennapod.core.util.download.AutoUpdateManager; import de.danoeh.antennapod.databinding.FeedRefreshDialogBinding; -import org.apache.commons.lang3.ArrayUtils; - +import de.danoeh.antennapod.databinding.ScrollableDialogBinding; +import de.danoeh.antennapod.storage.preferences.UserPreferences; import java.util.concurrent.TimeUnit; +import org.apache.commons.lang3.ArrayUtils; public class FeedRefreshIntervalDialog { private static final int[] INTERVAL_VALUES_HOURS = {1, 2, 4, 8, 12, 24, 72}; @@ -29,8 +30,10 @@ public class FeedRefreshIntervalDialog { MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context); builder.setTitle(R.string.feed_refresh_title); builder.setMessage(R.string.feed_refresh_sum); + ScrollableDialogBinding scrollableDialogBinding = ScrollableDialogBinding.inflate(LayoutInflater.from(context)); + builder.setView(scrollableDialogBinding.getRoot()); viewBinding = FeedRefreshDialogBinding.inflate(LayoutInflater.from(context)); - builder.setView(viewBinding.getRoot()); + scrollableDialogBinding.content.addView(viewBinding.getRoot()); ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, buildSpinnerEntries()); @@ -68,7 +71,11 @@ public class FeedRefreshIntervalDialog { viewBinding.radioGroup.setOnCheckedChangeListener((radioGroup, i) -> updateVisibility()); - builder.setPositiveButton(R.string.confirm_label, (dialog, which) -> { + AlertDialog dialog = builder.show(); + + scrollableDialogBinding.positiveButton.setText(R.string.confirm_label); + scrollableDialogBinding.positiveButton.setOnClickListener(v -> { + dialog.dismiss(); if (viewBinding.intervalRadioButton.isChecked()) { UserPreferences.setUpdateInterval(INTERVAL_VALUES_HOURS[viewBinding.spinner.getSelectedItemPosition()]); AutoUpdateManager.restartUpdateAlarm(context); @@ -89,8 +96,8 @@ public class FeedRefreshIntervalDialog { } }); - builder.setNegativeButton(R.string.cancel_label, null); - builder.show(); + scrollableDialogBinding.negativeButton.setText(R.string.cancel_label); + scrollableDialogBinding.negativeButton.setOnClickListener((v) -> dialog.dismiss()); } private String[] buildSpinnerEntries() { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java index 530d87e7f..e93db2d2a 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java @@ -183,10 +183,6 @@ public class AudioPlayerFragment extends Fragment implements sbPosition.setDividerPos(dividerPos); } - public View getExternalPlayerHolder() { - return getView().findViewById(R.id.playerFragment); - } - private void setupControlButtons() { butRev.setOnClickListener(v -> { if (controller != null) { @@ -528,6 +524,16 @@ public class AudioPlayerFragment extends Fragment implements return false; } + public void fadePlayerToToolbar(float slideOffset) { + float playerFadeProgress = Math.max(0.0f, Math.min(0.2f, slideOffset - 0.2f)) / 0.2f; + View player = getView().findViewById(R.id.playerFragment); + player.setAlpha(1 - playerFadeProgress); + player.setVisibility(playerFadeProgress > 0.99f ? View.GONE : View.VISIBLE); + float toolbarFadeProgress = Math.max(0.0f, Math.min(0.2f, slideOffset - 0.6f)) / 0.2f; + toolbar.setAlpha(toolbarFadeProgress); + toolbar.setVisibility(toolbarFadeProgress < 0.01f ? View.INVISIBLE : View.VISIBLE); + } + private static class AudioPlayerPagerAdapter extends FragmentStateAdapter { private static final String TAG = "AudioPlayerPagerAdapter"; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index 8a7d2432a..c5a8b6f2a 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.fragment; import android.app.Activity; +import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; @@ -86,6 +87,10 @@ public class ItemDescriptionFragment extends Fragment { if (webViewLoader != null) { webViewLoader.dispose(); } + Context context = getContext(); + if (context == null) { + return; + } webViewLoader = Maybe.<String>create(emitter -> { Playable media = controller.getMedia(); if (media == null) { @@ -100,7 +105,7 @@ public class ItemDescriptionFragment extends Fragment { DBReader.loadDescriptionOfFeedItem(feedMedia.getItem()); } ShownotesCleaner shownotesCleaner = new ShownotesCleaner( - getActivity(), media.getDescription(), media.getDuration()); + context, media.getDescription(), media.getDuration()); emitter.onSuccess(shownotesCleaner.processShownotes()); }) .subscribeOn(Schedulers.io()) diff --git a/app/src/main/java/de/danoeh/antennapod/ui/home/sections/EpisodesSurpriseSection.java b/app/src/main/java/de/danoeh/antennapod/ui/home/sections/EpisodesSurpriseSection.java index 8aaeb1412..7e2c855e9 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/home/sections/EpisodesSurpriseSection.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/home/sections/EpisodesSurpriseSection.java @@ -65,6 +65,8 @@ public class EpisodesSurpriseSection extends HomeSection { viewBinding.recyclerView.setLayoutManager( new LinearLayoutManager(getContext(), RecyclerView.HORIZONTAL, false)); viewBinding.recyclerView.setAdapter(listAdapter); + int paddingHorizontal = (int) (12 * getResources().getDisplayMetrics().density); + viewBinding.recyclerView.setPadding(paddingHorizontal, 0, paddingHorizontal, 0); if (seed == 0) { seed = new Random().nextInt(); } diff --git a/app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java b/app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java index e35068e58..070d56ed6 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/home/sections/QueueSection.java @@ -58,6 +58,8 @@ public class QueueSection extends HomeSection { viewBinding.recyclerView.setLayoutManager( new LinearLayoutManager(getContext(), RecyclerView.HORIZONTAL, false)); viewBinding.recyclerView.setAdapter(listAdapter); + int paddingHorizontal = (int) (12 * getResources().getDisplayMetrics().density); + viewBinding.recyclerView.setPadding(paddingHorizontal, 0, paddingHorizontal, 0); return view; } 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 b10d20e7b..b9a1bf8e8 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 @@ -44,6 +44,8 @@ public class SubscriptionsSection extends HomeSection { listAdapter = new HorizontalFeedListAdapter((MainActivity) getActivity()); listAdapter.setDummyViews(NUM_FEEDS); viewBinding.recyclerView.setAdapter(listAdapter); + int paddingHorizontal = (int) (12 * getResources().getDisplayMetrics().density); + viewBinding.recyclerView.setPadding(paddingHorizontal, 0, paddingHorizontal, 0); return view; } diff --git a/app/src/main/res/layout/audioplayer_fragment.xml b/app/src/main/res/layout/audioplayer_fragment.xml index a9964089c..496875a5f 100644 --- a/app/src/main/res/layout/audioplayer_fragment.xml +++ b/app/src/main/res/layout/audioplayer_fragment.xml @@ -12,6 +12,7 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:elevation="8dp" + android:outlineProvider="none" tools:layout_height="@dimen/external_player_height" /> <RelativeLayout diff --git a/app/src/main/res/layout/scrollable_dialog.xml b/app/src/main/res/layout/scrollable_dialog.xml new file mode 100644 index 000000000..29b84ee4b --- /dev/null +++ b/app/src/main/res/layout/scrollable_dialog.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <ScrollView + android:id="@+id/content" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="end" + android:orientation="horizontal" + android:paddingHorizontal="32dp" + android:paddingVertical="16dp" + style="?android:attr/buttonBarStyle"> + + <Button + android:id="@+id/negativeButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="?android:attr/buttonBarButtonStyle" /> + + <Button + android:id="@+id/positiveButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="?android:attr/buttonBarButtonStyle" /> + + </LinearLayout> + +</LinearLayout> |