Merge pull request #6490 from TacoTheDank/minSdk21removals

Remove no longer needed Compat stuff
This commit is contained in:
ByteHamster 2023-06-24 14:45:07 +02:00 committed by GitHub
commit 23d4cf5632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 17 additions and 26 deletions

View File

@ -98,7 +98,6 @@ dependencies {
implementation "androidx.fragment:fragment:$fragmentVersion"
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation "androidx.media:media:$mediaVersion"
implementation 'androidx.multidex:multidex:2.0.1'
implementation "androidx.palette:palette:$paletteVersion"
implementation "androidx.preference:preference:$preferenceVersion"
implementation "androidx.recyclerview:recyclerview:$recyclerViewVersion"
@ -124,7 +123,7 @@ dependencies {
implementation 'com.github.ByteHamster:SearchPreference:v2.0.0'
implementation 'com.github.skydoves:balloon:1.5.3'
implementation 'com.github.xabaras:RecyclerViewSwipeDecorator:1.3'
implementation 'com.annimon:stream:1.2.2'
implementation "com.annimon:stream:$annimonStreamVersion"
// Non-free dependencies:
playImplementation 'com.google.android.play:core:1.8.0'

View File

@ -5,7 +5,6 @@ import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.widget.ViewPager2;
@ -29,7 +28,7 @@ public class ViewPagerBottomSheetBehavior<V extends View> extends BottomSheetBeh
@Override
View findScrollingChild(View view) {
if (ViewCompat.isNestedScrollingEnabled(view)) {
if (view.isNestedScrollingEnabled()) {
return view;
}

View File

@ -1,10 +1,10 @@
package de.danoeh.antennapod;
import android.app.Application;
import android.content.ComponentName;
import android.content.Intent;
import android.os.StrictMode;
import androidx.multidex.MultiDexApplication;
import com.google.android.material.color.DynamicColors;
import com.joanzapata.iconify.Iconify;
import com.joanzapata.iconify.fonts.FontAwesomeModule;
@ -21,7 +21,7 @@ import de.danoeh.antennapod.spa.SPAUtil;
import org.greenrobot.eventbus.EventBus;
/** Main application class. */
public class PodcastApp extends MultiDexApplication {
public class PodcastApp extends Application {
private static PodcastApp singleton;

View File

@ -1,6 +1,5 @@
package de.danoeh.antennapod.activity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.graphics.drawable.ColorDrawable;
@ -20,6 +19,7 @@ import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
@ -30,7 +30,6 @@ import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.SeekBar;
import androidx.annotation.Nullable;
import androidx.core.view.WindowCompat;
import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
import com.bumptech.glide.Glide;
import de.danoeh.antennapod.R;
@ -95,13 +94,12 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
private Disposable disposable;
private float prog;
@SuppressLint("AppCompatMethod")
@Override
protected void onCreate(Bundle savedInstanceState) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
// has to be called before setting layout content
supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
supportRequestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
setTheme(R.style.Theme_AntennaPod_VideoPlayer);
super.onCreate(savedInstanceState);

View File

@ -156,12 +156,12 @@ public class SwipeActionsDialog {
Drawable icon = DrawableCompat.wrap(AppCompatResources.getDrawable(context, action.getActionIcon()));
icon.mutate();
DrawableCompat.setTintMode(icon, PorterDuff.Mode.SRC_ATOP);
icon.setTintMode(PorterDuff.Mode.SRC_ATOP);
if ((direction == LEFT && leftAction == action) || (direction == RIGHT && rightAction == action)) {
DrawableCompat.setTint(icon, ThemeUtils.getColorFromAttr(context, action.getActionColor()));
icon.setTint(ThemeUtils.getColorFromAttr(context, action.getActionColor()));
item.swipeActionLabel.setTextColor(ThemeUtils.getColorFromAttr(context, action.getActionColor()));
} else {
DrawableCompat.setTint(icon, ThemeUtils.getColorFromAttr(context, R.attr.action_icon_color));
icon.setTint(ThemeUtils.getColorFromAttr(context, R.attr.action_icon_color));
}
item.swipeIcon.setImageDrawable(icon);

View File

@ -9,8 +9,6 @@ import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.text.TextUtilsCompat;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DefaultItemAnimator;
import de.danoeh.antennapod.adapter.EpisodeItemListAdapter;
@ -38,7 +36,7 @@ public abstract class HomeSection extends Fragment implements View.OnCreateConte
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
viewBinding = HomeSectionBinding.inflate(inflater);
viewBinding.titleLabel.setText(getSectionTitle());
if (TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_LTR) {
if (TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_LTR) {
viewBinding.moreButton.setText(getMoreLinkTitle() + "\u00A0»");
} else {
viewBinding.moreButton.setText("«\u00A0" + getMoreLinkTitle());

View File

@ -3,7 +3,6 @@ package de.danoeh.antennapod.view;
import android.animation.ValueAnimator;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.core.view.ViewCompat;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@ -18,7 +17,7 @@ public class LiftOnScrollListener extends RecyclerView.OnScrollListener
public LiftOnScrollListener(View appBar) {
animator = ValueAnimator.ofFloat(0, appBar.getContext().getResources().getDisplayMetrics().density * 8);
animator.addUpdateListener(animation -> ViewCompat.setElevation(appBar, (float) animation.getAnimatedValue()));
animator.addUpdateListener(animation -> appBar.setElevation((float) animation.getAnimatedValue()));
}
@Override

View File

@ -19,7 +19,6 @@ import android.webkit.WebViewClient;
import androidx.core.content.ContextCompat;
import androidx.core.util.Consumer;
import androidx.core.view.ViewCompat;
import com.google.android.material.snackbar.Snackbar;
@ -133,7 +132,7 @@ public class ShownotesWebView extends WebView implements View.OnLongClickListene
cm.setPrimaryClip(clipData);
if (Build.VERSION.SDK_INT < 32) {
Snackbar s = Snackbar.make(this, R.string.copied_to_clipboard, Snackbar.LENGTH_LONG);
ViewCompat.setElevation(s.getView(), 100);
s.getView().setElevation(100);
s.show();
}
} else if (itemId == R.id.go_to_position_item) {

View File

@ -44,6 +44,7 @@ project.ext {
rxAndroidVersion = "2.1.1"
rxJavaVersion = "2.2.2"
iconifyVersion = "2.2.2"
annimonStreamVersion = "1.2.2"
exoPlayerVersion = "2.14.2"
// Google Play build

View File

@ -5,7 +5,6 @@ android {
minSdk 21
targetSdk 33
multiDexEnabled true
vectorDrawables.useSupportLibrary true
vectorDrawables.generatedDensities = []

View File

@ -62,7 +62,7 @@ dependencies {
annotationProcessor "org.greenrobot:eventbus-annotation-processor:$eventbusVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation 'com.annimon:stream:1.2.2'
implementation "com.annimon:stream:$annimonStreamVersion"
implementation "com.google.android.exoplayer:exoplayer-core:$exoPlayerVersion"
implementation "com.google.android.exoplayer:exoplayer-ui:$exoPlayerVersion"

View File

@ -14,8 +14,8 @@ import android.support.v4.media.session.MediaSessionCompat;
import android.util.Log;
import android.view.KeyEvent;
import androidx.annotation.NonNull;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import de.danoeh.antennapod.core.R;
@ -119,7 +119,7 @@ public class PlaybackServiceNotificationBuilder {
}
private static Bitmap getBitmap(Context context, int drawableId) {
Drawable drawable = ContextCompat.getDrawable(context, drawableId);
Drawable drawable = AppCompatResources.getDrawable(context, drawableId);
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
} else if (drawable instanceof VectorDrawable) {

View File

@ -4,8 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/widget_margin"
tools:ignore="VectorDrawableCompat">
android:padding="@dimen/widget_margin">
<RelativeLayout
android:id="@+id/widgetLayout"