Merge pull request #5368 from TacoTheDank/librarybump
Update AppCompat to 1.3.x
This commit is contained in:
commit
222f305d66
|
@ -121,6 +121,7 @@ dependencies {
|
||||||
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
||||||
implementation "androidx.appcompat:appcompat:$appcompatVersion"
|
implementation "androidx.appcompat:appcompat:$appcompatVersion"
|
||||||
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
|
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
|
||||||
|
implementation "androidx.core:core:$coreVersion"
|
||||||
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
||||||
implementation "androidx.media:media:$mediaVersion"
|
implementation "androidx.media:media:$mediaVersion"
|
||||||
implementation "androidx.preference:preference:$preferenceVersion"
|
implementation "androidx.preference:preference:$preferenceVersion"
|
||||||
|
|
|
@ -205,6 +205,7 @@ public class OpmlImportActivity extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
|
||||||
@NonNull int[] grantResults) {
|
@NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
if (requestCode != PERMISSION_REQUEST_READ_EXTERNAL_STORAGE) {
|
if (requestCode != PERMISSION_REQUEST_READ_EXTERNAL_STORAGE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.preference.PreferenceFragmentCompat;
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
|
@ -39,7 +40,7 @@ public class UserInterfacePreferencesFragment extends PreferenceFragmentCompat {
|
||||||
findPreference(UserPreferences.PREF_THEME)
|
findPreference(UserPreferences.PREF_THEME)
|
||||||
.setOnPreferenceChangeListener(
|
.setOnPreferenceChangeListener(
|
||||||
(preference, newValue) -> {
|
(preference, newValue) -> {
|
||||||
getActivity().recreate();
|
ActivityCompat.recreate(getActivity());
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,9 @@ subprojects {
|
||||||
|
|
||||||
project.ext {
|
project.ext {
|
||||||
// AndroidX
|
// AndroidX
|
||||||
annotationVersion = "1.1.0"
|
annotationVersion = "1.2.0"
|
||||||
appcompatVersion = "1.2.0"
|
appcompatVersion = "1.3.1"
|
||||||
|
coreVersion = "1.5.0"
|
||||||
mediaVersion = "1.1.0"
|
mediaVersion = "1.1.0"
|
||||||
preferenceVersion = "1.1.1"
|
preferenceVersion = "1.1.1"
|
||||||
workManagerVersion = "2.3.4"
|
workManagerVersion = "2.3.4"
|
||||||
|
|
|
@ -32,6 +32,7 @@ dependencies {
|
||||||
|
|
||||||
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
||||||
implementation "androidx.appcompat:appcompat:$appcompatVersion"
|
implementation "androidx.appcompat:appcompat:$appcompatVersion"
|
||||||
|
implementation "androidx.core:core:$coreVersion"
|
||||||
implementation 'androidx.documentfile:documentfile:1.0.1'
|
implementation 'androidx.documentfile:documentfile:1.0.1'
|
||||||
implementation "androidx.media:media:$mediaVersion"
|
implementation "androidx.media:media:$mediaVersion"
|
||||||
implementation "androidx.preference:preference:$preferenceVersion"
|
implementation "androidx.preference:preference:$preferenceVersion"
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
package de.danoeh.antennapod.core.util.gui;
|
package de.danoeh.antennapod.core.util.gui;
|
||||||
|
|
||||||
|
|
||||||
import android.app.NotificationChannel;
|
|
||||||
import android.app.NotificationChannelGroup;
|
|
||||||
import android.app.NotificationManager;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Build;
|
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.core.app.NotificationChannelCompat;
|
||||||
|
import androidx.core.app.NotificationChannelGroupCompat;
|
||||||
|
import androidx.core.app.NotificationManagerCompat;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import de.danoeh.antennapod.core.R;
|
import de.danoeh.antennapod.core.R;
|
||||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||||
|
@ -23,113 +24,112 @@ public class NotificationUtils {
|
||||||
public static final String GROUP_ID_ERRORS = "group_errors";
|
public static final String GROUP_ID_ERRORS = "group_errors";
|
||||||
public static final String GROUP_ID_NEWS = "group_news";
|
public static final String GROUP_ID_NEWS = "group_news";
|
||||||
|
|
||||||
public static void createChannels(Context context) {
|
public static void createChannels(final Context context) {
|
||||||
if (Build.VERSION.SDK_INT < 26) {
|
final NotificationManagerCompat mNotificationManager = NotificationManagerCompat.from(context);
|
||||||
return;
|
|
||||||
}
|
|
||||||
NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
|
||||||
|
|
||||||
if (mNotificationManager != null) {
|
final List<NotificationChannelGroupCompat> channelGroups = Arrays.asList(
|
||||||
mNotificationManager.createNotificationChannelGroup(createGroupErrors(context));
|
createGroupErrors(context),
|
||||||
mNotificationManager.createNotificationChannelGroup(createGroupNews(context));
|
createGroupNews(context));
|
||||||
|
mNotificationManager.createNotificationChannelGroupsCompat(channelGroups);
|
||||||
|
|
||||||
mNotificationManager.createNotificationChannel(createChannelUserAction(context));
|
final List<NotificationChannelCompat> channels = Arrays.asList(
|
||||||
mNotificationManager.createNotificationChannel(createChannelDownloading(context));
|
createChannelUserAction(context),
|
||||||
mNotificationManager.createNotificationChannel(createChannelPlaying(context));
|
createChannelDownloading(context),
|
||||||
mNotificationManager.createNotificationChannel(createChannelError(context));
|
createChannelPlaying(context),
|
||||||
mNotificationManager.createNotificationChannel(createChannelSyncError(context));
|
createChannelError(context),
|
||||||
mNotificationManager.createNotificationChannel(createChannelAutoDownload(context));
|
createChannelSyncError(context),
|
||||||
mNotificationManager.createNotificationChannel(createChannelEpisodeNotification(context));
|
createChannelAutoDownload(context),
|
||||||
}
|
createChannelEpisodeNotification(context));
|
||||||
|
mNotificationManager.createNotificationChannelsCompat(channels);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
private static NotificationChannelCompat createChannelUserAction(final Context c) {
|
||||||
private static NotificationChannel createChannelUserAction(Context c) {
|
return new NotificationChannelCompat.Builder(
|
||||||
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID_USER_ACTION,
|
CHANNEL_ID_USER_ACTION, NotificationManagerCompat.IMPORTANCE_HIGH)
|
||||||
c.getString(R.string.notification_channel_user_action), NotificationManager.IMPORTANCE_HIGH);
|
.setName(c.getString(R.string.notification_channel_user_action))
|
||||||
notificationChannel.setDescription(c.getString(R.string.notification_channel_user_action_description));
|
.setDescription(c.getString(R.string.notification_channel_user_action_description))
|
||||||
notificationChannel.setGroup(GROUP_ID_ERRORS);
|
.setGroup(GROUP_ID_ERRORS)
|
||||||
return notificationChannel;
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
private static NotificationChannelCompat createChannelDownloading(final Context c) {
|
||||||
private static NotificationChannel createChannelDownloading(Context c) {
|
return new NotificationChannelCompat.Builder(
|
||||||
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID_DOWNLOADING,
|
CHANNEL_ID_DOWNLOADING, NotificationManagerCompat.IMPORTANCE_LOW)
|
||||||
c.getString(R.string.notification_channel_downloading), NotificationManager.IMPORTANCE_LOW);
|
.setName(c.getString(R.string.notification_channel_downloading))
|
||||||
notificationChannel.setDescription(c.getString(R.string.notification_channel_downloading_description));
|
.setDescription(c.getString(R.string.notification_channel_downloading_description))
|
||||||
notificationChannel.setShowBadge(false);
|
.setShowBadge(false)
|
||||||
return notificationChannel;
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
private static NotificationChannelCompat createChannelPlaying(final Context c) {
|
||||||
private static NotificationChannel createChannelPlaying(Context c) {
|
return new NotificationChannelCompat.Builder(
|
||||||
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID_PLAYING,
|
CHANNEL_ID_PLAYING, NotificationManagerCompat.IMPORTANCE_LOW)
|
||||||
c.getString(R.string.notification_channel_playing), NotificationManager.IMPORTANCE_LOW);
|
.setName(c.getString(R.string.notification_channel_playing))
|
||||||
notificationChannel.setDescription(c.getString(R.string.notification_channel_playing_description));
|
.setDescription(c.getString(R.string.notification_channel_playing_description))
|
||||||
notificationChannel.setShowBadge(false);
|
.setShowBadge(false)
|
||||||
return notificationChannel;
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
private static NotificationChannelCompat createChannelError(final Context c) {
|
||||||
private static NotificationChannel createChannelError(Context c) {
|
final NotificationChannelCompat.Builder notificationChannel = new NotificationChannelCompat.Builder(
|
||||||
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID_DOWNLOAD_ERROR,
|
CHANNEL_ID_DOWNLOAD_ERROR, NotificationManagerCompat.IMPORTANCE_HIGH)
|
||||||
c.getString(R.string.notification_channel_download_error), NotificationManager.IMPORTANCE_HIGH);
|
.setName(c.getString(R.string.notification_channel_download_error))
|
||||||
notificationChannel.setDescription(c.getString(R.string.notification_channel_download_error_description));
|
.setDescription(c.getString(R.string.notification_channel_download_error_description))
|
||||||
notificationChannel.setGroup(GROUP_ID_ERRORS);
|
.setGroup(GROUP_ID_ERRORS);
|
||||||
|
|
||||||
if (!UserPreferences.getShowDownloadReportRaw()) {
|
if (!UserPreferences.getShowDownloadReportRaw()) {
|
||||||
// Migration from app managed setting: disable notification
|
// Migration from app managed setting: disable notification
|
||||||
notificationChannel.setImportance(NotificationManager.IMPORTANCE_NONE);
|
notificationChannel.setImportance(NotificationManagerCompat.IMPORTANCE_NONE);
|
||||||
}
|
}
|
||||||
return notificationChannel;
|
return notificationChannel.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
private static NotificationChannelCompat createChannelSyncError(final Context c) {
|
||||||
private static NotificationChannel createChannelSyncError(Context c) {
|
final NotificationChannelCompat.Builder notificationChannel = new NotificationChannelCompat.Builder(
|
||||||
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID_SYNC_ERROR,
|
CHANNEL_ID_SYNC_ERROR, NotificationManagerCompat.IMPORTANCE_HIGH)
|
||||||
c.getString(R.string.notification_channel_sync_error), NotificationManager.IMPORTANCE_HIGH);
|
.setName(c.getString(R.string.notification_channel_sync_error))
|
||||||
notificationChannel.setDescription(c.getString(R.string.notification_channel_sync_error_description));
|
.setDescription(c.getString(R.string.notification_channel_sync_error_description))
|
||||||
notificationChannel.setGroup(GROUP_ID_ERRORS);
|
.setGroup(GROUP_ID_ERRORS);
|
||||||
|
|
||||||
if (!UserPreferences.getGpodnetNotificationsEnabledRaw()) {
|
if (!UserPreferences.getGpodnetNotificationsEnabledRaw()) {
|
||||||
// Migration from app managed setting: disable notification
|
// Migration from app managed setting: disable notification
|
||||||
notificationChannel.setImportance(NotificationManager.IMPORTANCE_NONE);
|
notificationChannel.setImportance(NotificationManagerCompat.IMPORTANCE_NONE);
|
||||||
}
|
}
|
||||||
return notificationChannel;
|
return notificationChannel.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
private static NotificationChannelCompat createChannelAutoDownload(final Context c) {
|
||||||
private static NotificationChannel createChannelAutoDownload(Context c) {
|
final NotificationChannelCompat.Builder notificationChannel = new NotificationChannelCompat.Builder(
|
||||||
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID_AUTO_DOWNLOAD,
|
CHANNEL_ID_AUTO_DOWNLOAD, NotificationManagerCompat.IMPORTANCE_NONE)
|
||||||
c.getString(R.string.notification_channel_auto_download), NotificationManager.IMPORTANCE_NONE);
|
.setName(c.getString(R.string.notification_channel_auto_download))
|
||||||
notificationChannel.setDescription(c.getString(R.string.notification_channel_episode_auto_download));
|
.setDescription(c.getString(R.string.notification_channel_episode_auto_download))
|
||||||
notificationChannel.setGroup(GROUP_ID_NEWS);
|
.setGroup(GROUP_ID_NEWS);
|
||||||
|
|
||||||
if (UserPreferences.getShowAutoDownloadReportRaw()) {
|
if (UserPreferences.getShowAutoDownloadReportRaw()) {
|
||||||
// Migration from app managed setting: enable notification
|
// Migration from app managed setting: enable notification
|
||||||
notificationChannel.setImportance(NotificationManager.IMPORTANCE_DEFAULT);
|
notificationChannel.setImportance(NotificationManagerCompat.IMPORTANCE_DEFAULT);
|
||||||
}
|
}
|
||||||
return notificationChannel;
|
return notificationChannel.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
private static NotificationChannelCompat createChannelEpisodeNotification(final Context c) {
|
||||||
private static NotificationChannel createChannelEpisodeNotification(Context c) {
|
return new NotificationChannelCompat.Builder(
|
||||||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID_EPISODE_NOTIFICATIONS,
|
CHANNEL_ID_EPISODE_NOTIFICATIONS, NotificationManagerCompat.IMPORTANCE_DEFAULT)
|
||||||
c.getString(R.string.notification_channel_new_episode), NotificationManager.IMPORTANCE_DEFAULT);
|
.setName(c.getString(R.string.notification_channel_new_episode))
|
||||||
channel.setDescription(c.getString(R.string.notification_channel_new_episode_description));
|
.setDescription(c.getString(R.string.notification_channel_new_episode_description))
|
||||||
channel.setGroup(GROUP_ID_NEWS);
|
.setGroup(GROUP_ID_NEWS)
|
||||||
return channel;
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
private static NotificationChannelGroupCompat createGroupErrors(final Context c) {
|
||||||
private static NotificationChannelGroup createGroupErrors(Context c) {
|
return new NotificationChannelGroupCompat.Builder(GROUP_ID_ERRORS)
|
||||||
return new NotificationChannelGroup(GROUP_ID_ERRORS,
|
.setName(c.getString(R.string.notification_group_errors))
|
||||||
c.getString(R.string.notification_group_errors));
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
private static NotificationChannelGroupCompat createGroupNews(final Context c) {
|
||||||
private static NotificationChannelGroup createGroupNews(Context c) {
|
return new NotificationChannelGroupCompat.Builder(GROUP_ID_NEWS)
|
||||||
return new NotificationChannelGroup(GROUP_ID_NEWS,
|
.setName(c.getString(R.string.notification_group_news))
|
||||||
c.getString(R.string.notification_group_news));
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ apply from: "../common.gradle"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
||||||
implementation "androidx.appcompat:appcompat:$appcompatVersion"
|
|
||||||
implementation "androidx.media:media:$mediaVersion"
|
implementation "androidx.media:media:$mediaVersion"
|
||||||
|
|
||||||
implementation "org.apache.commons:commons-lang3:$commonslangVersion"
|
implementation "org.apache.commons:commons-lang3:$commonslangVersion"
|
||||||
|
|
|
@ -12,7 +12,7 @@ dependencies {
|
||||||
|
|
||||||
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
||||||
|
|
||||||
implementation "androidx.core:core:$appcompatVersion"
|
implementation "androidx.core:core:$coreVersion"
|
||||||
|
|
||||||
implementation "org.apache.commons:commons-lang3:$commonslangVersion"
|
implementation "org.apache.commons:commons-lang3:$commonslangVersion"
|
||||||
implementation "commons-io:commons-io:$commonsioVersion"
|
implementation "commons-io:commons-io:$commonsioVersion"
|
||||||
|
|
|
@ -3,5 +3,4 @@ apply from: "../../common.gradle"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
||||||
implementation "androidx.appcompat:appcompat:$appcompatVersion"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,5 +10,4 @@ android {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
|
||||||
implementation "androidx.appcompat:appcompat:$appcompatVersion"
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue