Remove support for Android 4.4
This commit is contained in:
parent
1d251492b0
commit
d8d6f1c72f
|
@ -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));
|
||||
}
|
||||
|
||||
Completable.create(subscriber -> {
|
||||
// Trigger schema updates
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
EventBus.getDefault().register(this);
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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().setUseWideViewPort(false);
|
||||
getSettings().setLoadWithOverviewMode(true);
|
||||
setOnLongClickListener(this);
|
||||
|
|
|
@ -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>
|
|
@ -1,9 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector>
|
||||
|
||||
<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 xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:radius="8dp"
|
||||
|
@ -12,10 +22,8 @@
|
|||
android:bottomLeftRadius="8dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@android:color/darker_gray" />
|
||||
android:color="?android:attr/textColorSecondary" />
|
||||
<solid android:color="@android:color/transparent"/>
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
|
||||
</selector>
|
||||
</ripple>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -2,7 +2,7 @@ android {
|
|||
compileSdk 31
|
||||
|
||||
defaultConfig {
|
||||
minSdk 19
|
||||
minSdk 21
|
||||
targetSdk 31
|
||||
|
||||
multiDexEnabled true
|
||||
|
|
|
@ -7,7 +7,6 @@ import android.content.BroadcastReceiver;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
@ -135,11 +134,9 @@ public class DownloadService extends Service {
|
|||
cancelDownloadReceiverFilter.addAction(ACTION_CANCEL_DOWNLOAD);
|
||||
registerReceiver(cancelDownloadReceiver, cancelDownloadReceiverFilter);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
connectionMonitor = new ConnectionStateMonitor();
|
||||
connectionMonitor.enable(getApplicationContext());
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isDownloadingFeeds() {
|
||||
if (!isRunning) {
|
||||
|
@ -206,9 +203,7 @@ public class DownloadService extends Service {
|
|||
}
|
||||
|
||||
unregisterReceiver(cancelDownloadReceiver);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
connectionMonitor.disable(getApplicationContext());
|
||||
}
|
||||
|
||||
EventBus.getDefault().postSticky(DownloadEvent.refresh(Collections.emptyList()));
|
||||
cancelNotificationUpdater();
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.app.Notification;
|
|||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import de.danoeh.antennapod.core.ClientConfig;
|
||||
|
@ -37,9 +36,7 @@ public class DownloadServiceNotification {
|
|||
.setShowWhen(false)
|
||||
.setContentIntent(ClientConfig.downloadServiceCallbacks.getNotificationContentIntent(context))
|
||||
.setSmallIcon(R.drawable.ic_notification_sync);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
notificationCompatBuilder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
|
||||
}
|
||||
|
||||
Log.d(TAG, "Notification set up");
|
||||
}
|
||||
|
@ -208,9 +205,7 @@ public class DownloadServiceNotification {
|
|||
.setSmallIcon(iconId)
|
||||
.setContentIntent(intent)
|
||||
.setAutoCancel(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
|
||||
}
|
||||
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
nm.notify(id, builder.build());
|
||||
Log.d(TAG, "Download report notification was posted");
|
||||
|
@ -232,9 +227,7 @@ public class DownloadServiceNotification {
|
|||
.setSmallIcon(R.drawable.ic_notification_key)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(ClientConfig.downloadServiceCallbacks.getAuthentificationNotificationContentIntent(context, downloadRequest));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
|
||||
}
|
||||
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
nm.notify(downloadRequest.getSource().hashCode(), builder.build());
|
||||
}
|
||||
|
|
|
@ -1168,20 +1168,6 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||
| PlaybackStateCompat.ACTION_SEEK_TO
|
||||
| PlaybackStateCompat.ACTION_SET_PLAYBACK_SPEED;
|
||||
|
||||
if (useSkipToPreviousForRewindInLockscreen()) {
|
||||
// Workaround to fool Android so that Lockscreen will expose a skip-to-previous button,
|
||||
// which will be used for rewind.
|
||||
// The workaround is used for pre Lollipop (Androidv5) devices.
|
||||
// For Androidv5+, lockscreen widges are really notifications (compact),
|
||||
// with an independent codepath
|
||||
//
|
||||
// @see #sessionCallback in the backing callback, skipToPrevious implementation
|
||||
// is actually the same as rewind. So no new inconsistency is created.
|
||||
// @see #setupNotification() for the method to create Androidv5+ lockscreen UI
|
||||
// with notification (compact)
|
||||
capabilities = capabilities | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS;
|
||||
}
|
||||
|
||||
UiModeManager uiModeManager = (UiModeManager) getApplicationContext()
|
||||
.getSystemService(Context.UI_MODE_SERVICE);
|
||||
if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR) {
|
||||
|
@ -1216,14 +1202,6 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||
mediaSession.setPlaybackState(sessionState.build());
|
||||
}
|
||||
|
||||
private static boolean useSkipToPreviousForRewindInLockscreen() {
|
||||
// showRewindOnCompactNotification() corresponds to the "Set Lockscreen Buttons"
|
||||
// Settings in UI.
|
||||
// Hence, from user perspective, he/she is setting the buttons for Lockscreen
|
||||
return (UserPreferences.showRewindOnCompactNotification() &&
|
||||
(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP));
|
||||
}
|
||||
|
||||
private void updateNotificationAndMediaSession(final Playable p) {
|
||||
setupNotification(p);
|
||||
updateMediaSessionMetadata(p);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package de.danoeh.antennapod.core.service.playback;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
|
@ -110,7 +109,6 @@ public class PlaybackServiceNotificationBuilder {
|
|||
return defaultIcon;
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private static Bitmap getBitmap(VectorDrawable vectorDrawable) {
|
||||
Bitmap bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(),
|
||||
vectorDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
|
||||
|
@ -124,7 +122,7 @@ public class PlaybackServiceNotificationBuilder {
|
|||
Drawable drawable = ContextCompat.getDrawable(context, drawableId);
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
return ((BitmapDrawable) drawable).getBitmap();
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && drawable instanceof VectorDrawable) {
|
||||
} else if (drawable instanceof VectorDrawable) {
|
||||
return getBitmap((VectorDrawable) drawable);
|
||||
} else {
|
||||
return null;
|
||||
|
|
|
@ -6,7 +6,6 @@ import android.net.Uri;
|
|||
import android.provider.DocumentsContract;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -21,10 +20,6 @@ public class FastDocumentFile {
|
|||
private final long lastModified;
|
||||
|
||||
public static List<FastDocumentFile> list(Context context, Uri folderUri) {
|
||||
if (android.os.Build.VERSION.SDK_INT < 21) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Uri childrenUri = DocumentsContract.buildChildDocumentsUriUsingTree(folderUri,
|
||||
DocumentsContract.getDocumentId(folderUri));
|
||||
Cursor cursor = context.getContentResolver().query(childrenUri, new String[] {
|
||||
|
|
|
@ -4,12 +4,8 @@ import android.content.Context;
|
|||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.net.NetworkRequest;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
public class ConnectionStateMonitor
|
||||
extends ConnectivityManager.NetworkCallback
|
||||
implements ConnectivityManager.OnNetworkActiveListener {
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?attr/colorSurfaceVariant">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/black"/>
|
||||
<corners android:radius="32dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<selector>
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?attr/colorSurfaceVariant"/>
|
||||
<corners android:radius="32dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
</selector>
|
||||
</item>
|
||||
</ripple>
|
|
@ -1,16 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?attr/colorSurfaceVariant">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/black"/>
|
||||
<corners android:radius="32dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<selector>
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?attr/colorSurfaceVariant"/>
|
||||
<corners android:radius="32dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?attr/colorSurfaceVariant" />
|
||||
<corners android:radius="32dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
</selector>
|
||||
</selector>
|
||||
</item>
|
||||
</ripple>
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<style name="Theme.AntennaPod.Dynamic.Light" parent="Theme.Base.AntennaPod.Dynamic.Light">
|
||||
<!-- To make icons visible -->
|
||||
<item name="android:statusBarColor">@color/grey600</item>
|
||||
<item name="android:navigationBarColor">@color/grey600</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
<style name="Theme.AntennaPod.Dynamic.Light" parent="Theme.Base.AntennaPod.Dynamic.Light">
|
||||
<!-- Room for API dependent attributes -->
|
||||
|
||||
<!-- To make icons visible on API 21-23. Overwritten in API-specific folder -->
|
||||
<item name="android:statusBarColor">@color/grey600</item>
|
||||
<item name="android:navigationBarColor">@color/grey600</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Base.AntennaPod.Dynamic.Light" parent="Theme.Material3.DynamicColors.Light">
|
||||
|
@ -22,7 +26,7 @@
|
|||
<item name="icon_gray">#25365A</item>
|
||||
<item name="android:splitMotionEvents">false</item>
|
||||
<item name="android:fitsSystemWindows">false</item>
|
||||
<item name="android:windowContentTransitions" tools:targetApi="lollipop">true</item>
|
||||
<item name="android:windowContentTransitions">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.Light" parent="Theme.AntennaPod.Dynamic.Light">
|
||||
|
@ -59,10 +63,10 @@
|
|||
<item name="icon_gray">#CDD9E4</item>
|
||||
<item name="android:splitMotionEvents">false</item>
|
||||
<item name="android:fitsSystemWindows">false</item>
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
|
||||
<item name="android:windowContentTransitions" tools:targetApi="lollipop">true</item>
|
||||
<item name="android:navigationBarColor" tools:targetApi="lollipop">@color/background_darktheme</item>
|
||||
<item name="android:windowContentTransitions">true</item>
|
||||
<item name="android:navigationBarColor">@color/background_darktheme</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.Dark" parent="Theme.AntennaPod.Dynamic.Dark">
|
||||
|
@ -85,7 +89,7 @@
|
|||
<item name="colorSurface">@color/black</item>
|
||||
<item name="background_color">@color/black</item>
|
||||
<item name="background_elevated">@color/black</item>
|
||||
<item name="android:navigationBarColor" tools:targetApi="lollipop">@color/black</item>
|
||||
<item name="android:navigationBarColor">@color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.TrueBlack" parent="Theme.AntennaPod.Dark">
|
||||
|
@ -95,7 +99,7 @@
|
|||
<item name="colorSurface">@color/black</item>
|
||||
<item name="background_color">@color/black</item>
|
||||
<item name="background_elevated">@color/black</item>
|
||||
<item name="android:navigationBarColor" tools:targetApi="lollipop">@color/black</item>
|
||||
<item name="android:navigationBarColor">@color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.Dynamic.Light.NoTitle" parent="Theme.AntennaPod.Dynamic.Light">
|
||||
|
@ -135,7 +139,7 @@
|
|||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.Dynamic.Light.Translucent" parent="Theme.AntennaPod.Dynamic.Light.NoTitle">
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="M">false</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
|
@ -146,7 +150,7 @@
|
|||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.Light.Translucent" parent="Theme.AntennaPod.Light.NoTitle">
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="M">false</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
|
@ -157,7 +161,7 @@
|
|||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.Dynamic.Dark.Translucent" parent="Theme.AntennaPod.Dynamic.Dark.NoTitle">
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="M">false</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
|
@ -168,7 +172,7 @@
|
|||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.Dark.Translucent" parent="Theme.AntennaPod.Dark.NoTitle">
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="M">false</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
|
@ -179,7 +183,7 @@
|
|||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.Dynamic.TrueBlack.Translucent" parent="Theme.AntennaPod.Dynamic.TrueBlack.NoTitle">
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="M">false</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
|
@ -190,7 +194,7 @@
|
|||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.TrueBlack.Translucent" parent="Theme.AntennaPod.TrueBlack.NoTitle">
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="M">false</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
|
@ -209,7 +213,7 @@
|
|||
<item name="android:windowBackground">@drawable/bg_splash</item>
|
||||
<item name="colorPrimary">@color/icon_background_gradient_start</item>
|
||||
<item name="colorPrimaryDark">@color/icon_background_gradient_start</item>
|
||||
<item name="android:navigationBarColor" tools:targetApi="lollipop">@color/icon_background_gradient_end</item>
|
||||
<item name="android:navigationBarColor">@color/icon_background_gradient_end</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.AntennaPod.VideoPlayer" parent="@style/Theme.AntennaPod.Dark">
|
||||
|
|
|
@ -1,31 +1,15 @@
|
|||
package de.danoeh.antennapod.net.ssl;
|
||||
|
||||
import android.os.Build;
|
||||
import okhttp3.CipherSuite;
|
||||
import okhttp3.ConnectionSpec;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class SslClientSetup {
|
||||
public static void installCertificates(OkHttpClient.Builder builder) {
|
||||
X509TrustManager trustManager = BackportTrustManager.create();
|
||||
builder.sslSocketFactory(new AntennaPodSslSocketFactory(trustManager), trustManager);
|
||||
|
||||
ConnectionSpec tlsSpec = ConnectionSpec.MODERN_TLS;
|
||||
if (BuildConfig.FLAVOR.equals("play") && Build.VERSION.SDK_INT < 21) {
|
||||
// workaround for Android 4.x for certain web sites.
|
||||
// see: https://github.com/square/okhttp/issues/4053#issuecomment-402579554
|
||||
List<CipherSuite> cipherSuites = new ArrayList<>(ConnectionSpec.MODERN_TLS.cipherSuites());
|
||||
cipherSuites.add(CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA);
|
||||
cipherSuites.add(CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA);
|
||||
tlsSpec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
|
||||
.cipherSuites(cipherSuites.toArray(new CipherSuite[0]))
|
||||
.build();
|
||||
}
|
||||
builder.connectionSpecs(Arrays.asList(tlsSpec, ConnectionSpec.CLEARTEXT));
|
||||
builder.connectionSpecs(Arrays.asList(ConnectionSpec.MODERN_TLS, ConnectionSpec.CLEARTEXT));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,11 +18,7 @@ public class PlaybackSpeedActivityStarter {
|
|||
this.context = context;
|
||||
intent = new Intent(INTENT);
|
||||
intent.setPackage(context.getPackageName());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
} else {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
}
|
||||
}
|
||||
|
||||
public Intent getIntent() {
|
||||
|
|
|
@ -18,10 +18,8 @@ public class VideoPlayerActivityStarter {
|
|||
this.context = context;
|
||||
intent = new Intent(INTENT);
|
||||
intent.setPackage(context.getPackageName());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
}
|
||||
}
|
||||
|
||||
public Intent getIntent() {
|
||||
return intent;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package de.danoeh.antennapod.ui.common;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
|
@ -29,7 +28,6 @@ import android.graphics.Paint;
|
|||
import android.graphics.Path;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
|
@ -60,7 +58,6 @@ public class TriangleLabelView extends View {
|
|||
init(context, attrs);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public TriangleLabelView(final Context context, final AttributeSet attrs,
|
||||
final int defStyleAttr, final int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
|
|
Loading…
Reference in New Issue