diff options
author | ByteHamster <info@bytehamster.com> | 2022-12-18 13:48:31 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-12-18 15:01:59 +0100 |
commit | d8d6f1c72f0aad452eb88f002dd11995bc1230f9 (patch) | |
tree | 184ca8046c438cdfb502c6a74b45ceb8870e6257 /app | |
parent | 1d251492b08ca17852e4a8bb5b0a9638443da9b2 (diff) | |
download | AntennaPod-d8d6f1c72f0aad452eb88f002dd11995bc1230f9.zip |
Remove support for Android 4.4
Diffstat (limited to 'app')
10 files changed, 36 insertions, 94 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 271bdd7f6..4e300ef25 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java @@ -3,12 +3,9 @@ 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; import android.widget.Toast; import androidx.annotation.Nullable; -import androidx.core.graphics.drawable.DrawableCompat; import androidx.appcompat.app.AppCompatActivity; import android.widget.ProgressBar; @@ -29,14 +26,8 @@ public class SplashActivity extends AppCompatActivity { setContentView(R.layout.splash); ProgressBar progressBar = findViewById(R.id.progressBar); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - Drawable wrapDrawable = DrawableCompat.wrap(progressBar.getIndeterminateDrawable()); - DrawableCompat.setTint(wrapDrawable, 0xffffffff); - progressBar.setIndeterminateDrawable(DrawableCompat.unwrap(wrapDrawable)); - } else { - progressBar.getIndeterminateDrawable().setColorFilter( - new PorterDuffColorFilter(0xffffffff, PorterDuff.Mode.SRC_IN)); - } + progressBar.getIndeterminateDrawable().setColorFilter( + new PorterDuffColorFilter(0xffffffff, PorterDuff.Mode.SRC_IN)); Completable.create(subscriber -> { // Trigger schema updates diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java index 4b6beac13..864e23d7d 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java @@ -6,7 +6,6 @@ import android.content.ClipboardManager; import android.content.Context; import android.content.Intent; import android.net.Uri; -import android.os.Build; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; @@ -19,7 +18,6 @@ import androidx.activity.result.contract.ActivityResultContracts; import androidx.activity.result.contract.ActivityResultContracts.GetContent; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.annotation.RequiresApi; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import androidx.documentfile.provider.DocumentFile; import androidx.fragment.app.Fragment; @@ -105,9 +103,6 @@ public class AddFeedFragment extends Fragment { }); viewBinding.addLocalFolderButton.setOnClickListener(v -> { - if (Build.VERSION.SDK_INT < 21) { - return; - } try { addLocalFolderLauncher.launch(null); } catch (ActivityNotFoundException e) { @@ -116,10 +111,6 @@ public class AddFeedFragment extends Fragment { .showSnackbarAbovePlayer(R.string.unable_to_start_system_file_manager, Snackbar.LENGTH_LONG); } }); - if (Build.VERSION.SDK_INT < 21) { - viewBinding.addLocalFolderButton.setVisibility(View.GONE); - } - viewBinding.searchButton.setOnClickListener(view -> performSearch()); return viewBinding.getRoot(); @@ -205,9 +196,6 @@ public class AddFeedFragment extends Fragment { } private Feed addLocalFolder(Uri uri) { - if (Build.VERSION.SDK_INT < 21) { - return null; - } getActivity().getContentResolver() .takePersistableUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION); DocumentFile documentFile = DocumentFile.fromTreeUri(getContext(), uri); @@ -227,7 +215,6 @@ public class AddFeedFragment extends Fragment { } private static class AddLocalFolder extends ActivityResultContracts.OpenDocumentTree { - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @NonNull @Override public Intent createIntent(@NonNull final Context context, @Nullable final Uri input) { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java index 26533f50f..c27d8c058 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java @@ -1,6 +1,5 @@ package de.danoeh.antennapod.fragment; -import android.os.Build; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; @@ -80,9 +79,7 @@ public class DownloadLogFragment extends BottomSheetDialogFragment adapter = new DownloadLogAdapter(getActivity()); viewBinding.list.setAdapter(adapter); viewBinding.list.setOnItemClickListener(this); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - viewBinding.list.setNestedScrollingEnabled(true); - } + viewBinding.list.setNestedScrollingEnabled(true); EventBus.getDefault().register(this); return viewBinding.getRoot(); } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java index 4fe2f0386..32ab5d9e5 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java @@ -7,7 +7,6 @@ import android.content.Intent; import android.content.res.Configuration; import android.graphics.LightingColorFilter; import android.net.Uri; -import android.os.Build; import android.os.Bundle; import android.text.TextUtils; import android.util.Log; @@ -22,7 +21,6 @@ import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.contract.ActivityResultContracts; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.annotation.RequiresApi; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import androidx.appcompat.content.res.AppCompatResources; import com.google.android.material.appbar.MaterialToolbar; @@ -290,7 +288,7 @@ public class FeedInfoFragment extends Fragment implements MaterialToolbar.OnMenu } boolean handled = FeedMenuHandler.onOptionsItemClicked(getContext(), item, feed); - if (item.getItemId() == R.id.reconnect_local_folder && Build.VERSION.SDK_INT >= 21) { + if (item.getItemId() == R.id.reconnect_local_folder) { MaterialAlertDialogBuilder alert = new MaterialAlertDialogBuilder(getContext()); alert.setMessage(R.string.reconnect_local_folder_warning); alert.setPositiveButton(android.R.string.ok, (dialog, which) -> { @@ -329,7 +327,7 @@ public class FeedInfoFragment extends Fragment implements MaterialToolbar.OnMenu } private void reconnectLocalFolder(Uri uri) { - if (Build.VERSION.SDK_INT < 21 || feed == null) { + if (feed == null) { return; } @@ -353,7 +351,6 @@ public class FeedInfoFragment extends Fragment implements MaterialToolbar.OnMenu } private static class AddLocalFolder extends ActivityResultContracts.OpenDocumentTree { - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @NonNull @Override public Intent createIntent(@NonNull final Context context, @Nullable final Uri input) { diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java b/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java index 62e162a7c..ef527967a 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java @@ -1,9 +1,7 @@ package de.danoeh.antennapod.preferences; -import android.annotation.TargetApi; import android.content.Context; import android.graphics.Typeface; -import android.os.Build; import androidx.preference.SwitchPreferenceCompat; import androidx.preference.PreferenceViewHolder; import android.util.AttributeSet; @@ -18,7 +16,6 @@ public class MasterSwitchPreference extends SwitchPreferenceCompat { super(context, attrs, defStyleAttr); } - @TargetApi(Build.VERSION_CODES.LOLLIPOP) public MasterSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); } diff --git a/app/src/main/java/de/danoeh/antennapod/view/NestedScrollableHost.java b/app/src/main/java/de/danoeh/antennapod/view/NestedScrollableHost.java index ff52df71f..660aa1ea9 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/NestedScrollableHost.java +++ b/app/src/main/java/de/danoeh/antennapod/view/NestedScrollableHost.java @@ -21,7 +21,6 @@ package de.danoeh.antennapod.view; import android.content.Context; import android.content.res.TypedArray; -import android.os.Build; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; @@ -31,7 +30,6 @@ import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.annotation.RequiresApi; import androidx.viewpager2.widget.ViewPager2; import de.danoeh.antennapod.R; @@ -75,7 +73,6 @@ public class NestedScrollableHost extends FrameLayout { setAttributes(context, attrs); } - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public NestedScrollableHost(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); 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 9dc4a76c6..b284aa2d6 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/ShownotesWebView.java +++ b/app/src/main/java/de/danoeh/antennapod/view/ShownotesWebView.java @@ -6,7 +6,6 @@ import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.net.Uri; -import android.os.Build; import android.util.AttributeSet; import android.util.Log; import android.view.ContextMenu; @@ -63,9 +62,7 @@ public class ShownotesWebView extends WebView implements View.OnLongClickListene getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); // Use cached resources, even if they have expired } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); - } + getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); getSettings().setUseWideViewPort(false); getSettings().setLoadWithOverviewMode(true); setOnLongClickListener(this); diff --git a/app/src/main/res/drawable-v21/grey_border.xml b/app/src/main/res/drawable-v21/grey_border.xml deleted file mode 100644 index beccf9e85..000000000 --- a/app/src/main/res/drawable-v21/grey_border.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<ripple xmlns:android="http://schemas.android.com/apk/res/android" -android:color="?attr/colorControlHighlight"> - <item android:id="@android:id/mask"> - <shape - android:shape="rectangle"> - <corners - android:radius="8dp" - android:topRightRadius="8dp" - android:bottomRightRadius="8dp" - android:bottomLeftRadius="8dp" /> - <solid android:color="@android:color/white"/> - </shape> - </item> - <item> - <shape - android:shape="rectangle"> - <corners - android:radius="8dp" - android:topRightRadius="8dp" - android:bottomRightRadius="8dp" - android:bottomLeftRadius="8dp" /> - <stroke - android:width="1dp" - android:color="?android:attr/textColorSecondary" /> - <solid android:color="@android:color/transparent"/> - </shape> - </item> -</ripple> diff --git a/app/src/main/res/drawable/grey_border.xml b/app/src/main/res/drawable/grey_border.xml index 4362f05b6..beccf9e85 100644 --- a/app/src/main/res/drawable/grey_border.xml +++ b/app/src/main/res/drawable/grey_border.xml @@ -1,21 +1,29 @@ <?xml version="1.0" encoding="utf-8"?> -<selector> - - <item> - - <shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <corners - android:radius="8dp" - android:topRightRadius="8dp" - android:bottomRightRadius="8dp" - android:bottomLeftRadius="8dp" /> - <stroke - android:width="1dp" - android:color="@android:color/darker_gray" /> - <solid android:color="@android:color/transparent"/> - </shape> - - </item> - -</selector>
\ No newline at end of file +<ripple xmlns:android="http://schemas.android.com/apk/res/android" +android:color="?attr/colorControlHighlight"> + <item android:id="@android:id/mask"> + <shape + android:shape="rectangle"> + <corners + android:radius="8dp" + android:topRightRadius="8dp" + android:bottomRightRadius="8dp" + android:bottomLeftRadius="8dp" /> + <solid android:color="@android:color/white"/> + </shape> + </item> + <item> + <shape + android:shape="rectangle"> + <corners + android:radius="8dp" + android:topRightRadius="8dp" + android:bottomRightRadius="8dp" + android:bottomLeftRadius="8dp" /> + <stroke + android:width="1dp" + android:color="?android:attr/textColorSecondary" /> + <solid android:color="@android:color/transparent"/> + </shape> + </item> +</ripple> diff --git a/app/src/main/res/layout/home_fragment.xml b/app/src/main/res/layout/home_fragment.xml index fca9406a8..3ef602334 100644 --- a/app/src/main/res/layout/home_fragment.xml +++ b/app/src/main/res/layout/home_fragment.xml @@ -34,7 +34,7 @@ android:layout_height="80dp" android:layout_marginBottom="8dp" android:layout_gravity="start" - android:src="@drawable/ic_curved_arrow" /> + app:srcCompat="@drawable/ic_curved_arrow" /> <ImageView android:id="@+id/icon" @@ -42,7 +42,7 @@ android:layout_height="64dp" android:layout_gravity="center_horizontal" android:layout_marginBottom="16dp" - android:src="@mipmap/ic_launcher" /> + app:srcCompat="@mipmap/ic_launcher" /> <TextView android:layout_width="match_parent" |