Move notification icons and widget icons to separate modules (#6995)

This commit is contained in:
ByteHamster 2024-03-17 12:06:41 +01:00 committed by GitHub
parent 8dc8cc64a8
commit 17f5a5d1b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
33 changed files with 44 additions and 15 deletions

View File

@ -40,7 +40,8 @@ dependencies {
implementation project(':ui:app-start-intent')
implementation project(':ui:common')
implementation project(':ui:i18n')
implementation project(':ui:png-icons')
implementation project(':ui:notifications')
implementation project(':ui:widget')
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
implementation "androidx.appcompat:appcompat:$appcompatVersion"

View File

@ -12,10 +12,10 @@ import de.danoeh.antennapod.core.sync.SyncService;
import de.danoeh.antennapod.core.sync.queue.SynchronizationQueueSink;
import de.danoeh.antennapod.core.util.NetworkUtils;
import de.danoeh.antennapod.core.util.download.NetworkConnectionChangeHandler;
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
import de.danoeh.antennapod.net.ssl.SslProviderInstaller;
import de.danoeh.antennapod.storage.database.PodDBAdapter;
import de.danoeh.antennapod.ui.notifications.NotificationUtils;
import java.io.File;
public class ClientConfigurator {

View File

@ -26,12 +26,12 @@ import de.danoeh.antennapod.core.storage.DBTasks;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.util.NetworkUtils;
import de.danoeh.antennapod.core.util.download.FeedUpdateManager;
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
import de.danoeh.antennapod.model.download.DownloadError;
import de.danoeh.antennapod.model.download.DownloadResult;
import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadRequest;
import de.danoeh.antennapod.ui.notifications.NotificationUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;

View File

@ -20,7 +20,6 @@ import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.core.service.download.handler.MediaDownloadedHandler;
import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
import de.danoeh.antennapod.event.MessageEvent;
import de.danoeh.antennapod.model.download.DownloadError;
import de.danoeh.antennapod.model.download.DownloadResult;
@ -28,6 +27,7 @@ import de.danoeh.antennapod.model.feed.FeedMedia;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadRequest;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadServiceInterface;
import de.danoeh.antennapod.ui.appstartintent.MainActivityStarter;
import de.danoeh.antennapod.ui.notifications.NotificationUtils;
import org.apache.commons.io.FileUtils;
import org.greenrobot.eventbus.EventBus;

View File

@ -19,9 +19,9 @@ import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.model.feed.FeedCounter;
import de.danoeh.antennapod.model.feed.FeedPreferences;
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
import de.danoeh.antennapod.storage.database.PodDBAdapter;
import de.danoeh.antennapod.ui.notifications.NotificationUtils;
import java.util.Map;
public class NewEpisodesNotification {

View File

@ -47,6 +47,7 @@ import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import androidx.media.MediaBrowserServiceCompat;
import de.danoeh.antennapod.ui.notifications.NotificationUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@ -73,7 +74,6 @@ import de.danoeh.antennapod.core.util.FeedItemUtil;
import de.danoeh.antennapod.core.util.FeedUtil;
import de.danoeh.antennapod.core.util.IntentUtils;
import de.danoeh.antennapod.core.util.NetworkUtils;
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
import de.danoeh.antennapod.core.util.playback.PlayableUtils;
import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter;
import de.danoeh.antennapod.core.widget.WidgetUpdater;

View File

@ -24,8 +24,8 @@ import de.danoeh.antennapod.core.receiver.MediaButtonReceiver;
import de.danoeh.antennapod.core.util.Converter;
import de.danoeh.antennapod.core.feed.util.ImageResourceUtils;
import de.danoeh.antennapod.core.util.TimeSpeedConverter;
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
import de.danoeh.antennapod.model.playback.Playable;
import de.danoeh.antennapod.ui.notifications.NotificationUtils;
import java.util.ArrayList;
import java.util.concurrent.ExecutionException;

View File

@ -25,6 +25,7 @@ import de.danoeh.antennapod.event.FeedUpdateRunningEvent;
import de.danoeh.antennapod.event.MessageEvent;
import de.danoeh.antennapod.model.feed.FeedItemFilter;
import de.danoeh.antennapod.model.feed.SortOrder;
import de.danoeh.antennapod.ui.notifications.NotificationUtils;
import org.apache.commons.lang3.StringUtils;
import org.greenrobot.eventbus.EventBus;
@ -45,7 +46,6 @@ import de.danoeh.antennapod.core.sync.queue.SynchronizationQueueStorage;
import de.danoeh.antennapod.core.util.FeedItemUtil;
import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.net.common.UrlChecker;
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.model.feed.FeedItem;
import de.danoeh.antennapod.model.feed.FeedMedia;

View File

@ -42,5 +42,6 @@ include ':ui:common'
include ':ui:echo'
include ':ui:glide'
include ':ui:i18n'
include ':ui:png-icons'
include ':ui:notifications'
include ':ui:statistics'
include ':ui:widget'

View File

@ -0,0 +1,6 @@
# :ui:notifications
This module contains generic notification-related resources, for example the notification channel IDs and notification icons. The icons specified in this module are rasterized to png. This is necessary to support old Android versions that do not support VectorDrawables. This is only needed for notification icons - for the icons within the app, appcompat handles drawing the vectors.
This module is not meant for all notification handling (this should be done in the respective modules), just generic setup code and icons.

View File

@ -0,0 +1,21 @@
plugins {
id("com.android.library")
}
apply from: "../../common.gradle"
android {
namespace "de.danoeh.antennapod.ui.notifications"
defaultConfig {
vectorDrawables.useSupportLibrary false
vectorDrawables.generatedDensities = ["xhdpi"]
}
}
dependencies {
implementation project(':storage:preferences')
implementation project(':ui:i18n')
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
implementation "androidx.core:core:$coreVersion"
}

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.util.gui;
package de.danoeh.antennapod.ui.notifications;
import android.content.Context;
@ -9,7 +9,6 @@ import androidx.core.app.NotificationManagerCompat;
import java.util.Arrays;
import java.util.List;
import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
public class NotificationUtils {

View File

@ -1,3 +0,0 @@
# :ui:png-icons
This module provides icon resources. It is necessary to support old Android versions that do not support VectorDrawables. The module generates png versions of all contained icons automatically. This is only needed for notification icons - for the icons within the app, appcompat handles drawing the vectors.

4
ui/widget/README.md Normal file
View File

@ -0,0 +1,4 @@
# :ui:widget
This module manages the widget. The icons specified in this module are rasterized to png. This is necessary to support old Android versions that do not support VectorDrawables. This is only needed for external icons - for the icons within the app, appcompat handles drawing the vectors.

View File

@ -4,7 +4,7 @@ plugins {
apply from: "../../common.gradle"
android {
namespace "de.danoeh.antennapod.ui.pngicons"
namespace "de.danoeh.antennapod.ui.widget"
defaultConfig {
vectorDrawables.useSupportLibrary false