Compare commits

...

4 Commits

Author SHA1 Message Date
ueen 74f9813bd8
Merge 195eb0897c into 2827f41430 2024-05-07 22:06:54 +02:00
flofriday 2827f41430
Improve layout for missing chapter images (#7164)
If only some chapters have images the other chapters don't display
anything but reserve space for the image.

Now those chapters display the image of the episode. If no chapters have
images no images will be displayed (just like before).
2024-05-06 22:14:26 +02:00
flofriday 6f572faa77
Fix inconsistent icons in the app toolbar. (#7163) 2024-05-06 22:04:24 +02:00
ueen 195eb0897c resize 2024-01-25 15:39:56 +01:00
13 changed files with 33 additions and 26 deletions

View File

@ -19,6 +19,7 @@ import de.danoeh.antennapod.R;
import de.danoeh.antennapod.model.feed.Chapter;
import de.danoeh.antennapod.ui.common.Converter;
import de.danoeh.antennapod.model.feed.EmbeddedChapterImage;
import de.danoeh.antennapod.ui.common.ImagePlaceholder;
import de.danoeh.antennapod.ui.common.IntentUtils;
import de.danoeh.antennapod.model.playback.Playable;
import de.danoeh.antennapod.ui.common.CircularProgressBar;
@ -99,15 +100,27 @@ public class ChaptersListAdapter extends RecyclerView.Adapter<ChaptersListAdapte
if (hasImages) {
holder.image.setVisibility(View.VISIBLE);
float radius = 4 * context.getResources().getDisplayMetrics().density;
RequestOptions options = new RequestOptions()
.placeholder(ImagePlaceholder.getDrawable(context, radius))
.dontAnimate()
.transform(new FitCenter(), new RoundedCorners((int) radius));
if (TextUtils.isEmpty(sc.getImageUrl())) {
Glide.with(context).clear(holder.image);
if (media.getImageLocation() == null) {
Glide.with(context).clear(holder.image);
holder.image.setVisibility(View.GONE);
} else {
Glide.with(context)
.load(media.getImageLocation())
.apply(options)
.into(holder.image);
}
} else {
Glide.with(context)
.load(EmbeddedChapterImage.getModelFor(media, position))
.apply(new RequestOptions()
.dontAnimate()
.transform(new FitCenter(), new RoundedCorners((int)
(4 * context.getResources().getDisplayMetrics().density))))
.apply(options)
.into(holder.image);
}
} else {

View File

@ -157,7 +157,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
viewBinding.progressBar.setVisibility(View.VISIBLE);
ToolbarIconTintManager iconTintManager = new ToolbarIconTintManager(
getContext(), viewBinding.toolbar, viewBinding.collapsingToolbar) {
viewBinding.toolbar.getContext(), viewBinding.toolbar, viewBinding.collapsingToolbar) {
@Override
protected void doTint(Context themedContext) {
viewBinding.toolbar.getMenu().findItem(R.id.refresh_item)

View File

@ -18,7 +18,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:title="@string/add_feed_label"
app:navigationContentDescription="@string/toolbar_back_button_content_description"
app:navigationIcon="?homeAsUpIndicator" />

View File

@ -26,7 +26,6 @@
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:navigationContentDescription="@string/toolbar_back_button_content_description"
app:navigationIcon="@drawable/ic_arrow_down" />

View File

@ -11,7 +11,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
android:layout_alignParentTop="true"
app:title="@string/downloads_log_label" />

View File

@ -41,7 +41,6 @@
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_collapseMode="pin"
app:navigationContentDescription="@string/toolbar_back_button_content_description"
app:navigationIcon="?homeAsUpIndicator" />

View File

@ -12,7 +12,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:navigationContentDescription="@string/toolbar_back_button_content_description"
app:navigationIcon="?homeAsUpIndicator" />

View File

@ -12,8 +12,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
android:elevation="4dp"
app:title="@string/feed_settings_label"
app:navigationContentDescription="@string/toolbar_back_button_content_description"
app:navigationIcon="?homeAsUpIndicator" />

View File

@ -36,8 +36,8 @@
android:orientation="vertical">
<FrameLayout
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_width="112dp"
android:layout_height="112dp"
android:background="@color/image_readability_tint">
<de.danoeh.antennapod.ui.common.SquareImageView
@ -100,7 +100,7 @@
<TextView
android:id="@+id/titleLabel"
android:layout_width="128dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"

View File

@ -17,7 +17,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:title="@string/search_label"
app:navigationContentDescription="@string/toolbar_back_button_content_description"
app:navigationIcon="?homeAsUpIndicator" />

View File

@ -25,7 +25,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
android:layout_alignParentTop="true" />
<View

View File

@ -12,7 +12,6 @@
<style name="Theme.Base.AntennaPod.Dynamic.Light" parent="Theme.Material3.DynamicColors.Light">
<item name="progressBarTheme">@style/ProgressBarLight</item>
<item name="background_color">@color/background_light</item>
<item name="actionBarStyle">@style/Widget.AntennaPod.ActionBar</item>
<item name="background_elevated">@color/background_elevated_light</item>
<item name="action_icon_color">@color/black</item>
<item name="android:textAllCaps">false</item>
@ -27,6 +26,7 @@
<item name="android:splitMotionEvents">false</item>
<item name="android:fitsSystemWindows">false</item>
<item name="android:windowContentTransitions">true</item>
<item name="toolbarStyle">@style/Style.AntennaPod.Toolbar</item>
<item name="preferenceTheme">@style/AppPreferenceThemeOverlay</item>
</style>
@ -52,7 +52,6 @@
<style name="Theme.Base.AntennaPod.Dynamic.Dark" parent="Theme.Material3.DynamicColors.Dark">
<item name="progressBarTheme">@style/ProgressBarDark</item>
<item name="background_color">@color/background_darktheme</item>
<item name="actionBarStyle">@style/Widget.AntennaPod.ActionBar</item>
<item name="background_elevated">@color/background_elevated_darktheme</item>
<item name="action_icon_color">@color/white</item>
<item name="android:textAllCaps">false</item>
@ -70,6 +69,7 @@
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
<item name="android:windowContentTransitions">true</item>
<item name="android:navigationBarColor">@color/background_darktheme</item>
<item name="toolbarStyle">@style/Style.AntennaPod.Toolbar</item>
<item name="preferenceTheme">@style/AppPreferenceThemeOverlay</item>
</style>
@ -227,6 +227,15 @@
<item name="windowSplashScreenAnimatedIcon">@drawable/launcher_animate</item>
</style>
<style name="Style.AntennaPod.Toolbar" parent="Widget.Material3.Toolbar">
<item name="materialThemeOverlay">@style/Theme.AntennaPod.Toolbar</item>
</style>
<style name="Theme.AntennaPod.Toolbar" parent="ThemeOverlay.MaterialComponents.Toolbar.Surface">
<item name="action_icon_color">?attr/colorOnSurface</item>
<item name="colorControlNormal">?attr/colorOnSurface</item>
</style>
<style name="Theme.AntennaPod.VideoPlayer" parent="@style/Theme.AntennaPod.Dark">
<item name="windowActionBarOverlay">true</item>
</style>
@ -280,11 +289,6 @@
<item name="fastScrollVerticalTrackDrawable">@drawable/scrollbar_track</item>
</style>
<style name="Widget.AntennaPod.ActionBar" parent="Widget.Material3.Light.ActionBar.Solid">
<item name="background">?android:attr/colorBackground</item>
<item name="elevation">0dp</item>
</style>
<style name="AddPodcastTextView">
<item name="android:drawablePadding">8dp</item>
<item name="android:paddingTop">8dp</item>

View File

@ -19,7 +19,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:title="@string/discover"
app:navigationContentDescription="@string/toolbar_back_button_content_description"
app:navigationIcon="?homeAsUpIndicator" />