diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2022-05-15 18:09:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-15 18:09:07 +0200 |
commit | 993998c1cbb3939f20d44816439a567cfe6caeda (patch) | |
tree | 50df74290b2201df6f4ce5f5bf85ede569f1de12 /app | |
parent | b7c277620dfc62fb47fe4de60c096b4847ca7e0e (diff) | |
parent | 31ed16cd9c9dc86b78d903771ca4a6e4aa94f81d (diff) | |
download | AntennaPod-993998c1cbb3939f20d44816439a567cfe6caeda.zip |
Merge pull request #5802 from TacoTheDank/deprecations
Fix some deprecations
Diffstat (limited to 'app')
4 files changed, 12 insertions, 6 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java index ecf490f48..271bdd7f6 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java @@ -2,6 +2,7 @@ package de.danoeh.antennapod.activity; import android.content.Intent; import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; @@ -33,7 +34,8 @@ public class SplashActivity extends AppCompatActivity { DrawableCompat.setTint(wrapDrawable, 0xffffffff); progressBar.setIndeterminateDrawable(DrawableCompat.unwrap(wrapDrawable)); } else { - progressBar.getIndeterminateDrawable().setColorFilter(0xffffffff, PorterDuff.Mode.SRC_IN); + progressBar.getIndeterminateDrawable().setColorFilter( + new PorterDuffColorFilter(0xffffffff, PorterDuff.Mode.SRC_IN)); } Completable.create(subscriber -> { diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java b/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java index 34726e248..d30141b7a 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java @@ -1,8 +1,10 @@ package de.danoeh.antennapod.adapter; +import android.content.Context; import android.graphics.drawable.Drawable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; import androidx.core.graphics.ColorUtils; import androidx.palette.graphics.Palette; @@ -146,7 +148,8 @@ public class CoverLoader { boolean showTitle = UserPreferences.shouldShowSubscriptionTitle(); if (placeholder != null) { if (textAndImageCombined || showTitle) { - int bgColor = placeholder.getContext().getResources().getColor(R.color.feed_text_bg); + final Context context = placeholder.getContext(); + int bgColor = ContextCompat.getColor(context, R.color.feed_text_bg); if (palette == null || !showTitle) { placeholder.setBackgroundColor(bgColor); placeholder.setTextColor(ThemeUtils.getColorFromAttr(placeholder.getContext(), @@ -154,9 +157,9 @@ public class CoverLoader { return; } int dominantColor = palette.getDominantColor(bgColor); - int textColor = placeholder.getContext().getResources().getColor(R.color.white); + int textColor = ContextCompat.getColor(context, R.color.white); if (ColorUtils.calculateLuminance(dominantColor) > 0.5) { - textColor = placeholder.getContext().getResources().getColor(R.color.black); + textColor = ContextCompat.getColor(context, R.color.black); } placeholder.setTextColor(textColor); placeholder.setBackgroundColor(dominantColor); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java index 7c3166043..a7986e144 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java @@ -22,6 +22,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.content.res.AppCompatResources; +import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; @@ -79,7 +80,8 @@ public class SubscriptionsRecyclerAdapter extends SelectableAdapter<Subscription if (viewType == COVER_WITH_TITLE) { topAndBottomItemId = 0; belowItemId = R.id.imgvCover; - feedTitle.setBackgroundColor(feedTitle.getContext().getResources().getColor(R.color.feed_text_bg)); + feedTitle.setBackgroundColor( + ContextCompat.getColor(feedTitle.getContext(), R.color.feed_text_bg)); int padding = (int) convertDpToPixel(feedTitle.getContext(), 6); feedTitle.setPadding(padding, padding, padding, padding); } diff --git a/app/src/main/java/de/danoeh/antennapod/view/ShownotesWebView.java b/app/src/main/java/de/danoeh/antennapod/view/ShownotesWebView.java index 22744eee6..3f4cc17ae 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/ShownotesWebView.java +++ b/app/src/main/java/de/danoeh/antennapod/view/ShownotesWebView.java @@ -67,7 +67,6 @@ public class ShownotesWebView extends WebView implements View.OnLongClickListene getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); } getSettings().setUseWideViewPort(false); - getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); getSettings().setLoadWithOverviewMode(true); setOnLongClickListener(this); |