diff --git a/examples/service/src/main/java/video/api/uploader/service/example/CustomUploaderService.kt b/examples/service/src/main/java/video/api/uploader/service/example/CustomUploaderService.kt index cc62ccd..4f5ff5f 100644 --- a/examples/service/src/main/java/video/api/uploader/service/example/CustomUploaderService.kt +++ b/examples/service/src/main/java/video/api/uploader/service/example/CustomUploaderService.kt @@ -9,7 +9,7 @@ import video.api.uploader.api.services.UploadService class CustomUploaderService : UploadService( notificationId = DEFAULT_NOTIFICATION_ID, channelId = DEFAULT_NOTIFICATION_CHANNEL_ID, - channelNameResourceId = R.string.channel_name, + channelNameResourceId = R.string.upload_notification_channel_name, ) { companion object { const val DEFAULT_NOTIFICATION_CHANNEL_ID = diff --git a/src/main/java/video/api/uploader/api/services/UploadService.kt b/src/main/java/video/api/uploader/api/services/UploadService.kt index 940574f..d31f324 100644 --- a/src/main/java/video/api/uploader/api/services/UploadService.kt +++ b/src/main/java/video/api/uploader/api/services/UploadService.kt @@ -51,10 +51,10 @@ import java.util.concurrent.Future open class UploadService( private val notificationId: Int = DEFAULT_NOTIFICATION_ID, protected val channelId: String = DEFAULT_NOTIFICATION_SERVICE_CHANNEL_ID, - @StringRes private val channelNameResourceId: Int = R.string.channel_name, + @StringRes private val channelNameResourceId: Int = R.string.upload_notification_channel_name, @StringRes private val channelDescriptionResourceId: Int = 0, - @DrawableRes protected val notificationIconResourceId: Int = R.drawable.ic_api_video_logo, - @ColorRes protected val notificationColorResourceId: Int = R.color.primary_orange + @DrawableRes protected val notificationIconResourceId: Int = R.drawable.ic_upload_notification, + @ColorRes protected val notificationColorResourceId: Int = R.color.upload_notification_color ) : Service() { private val uploadFuturesMap = ConcurrentHashMap>() private val binder = UploadServiceBinder() @@ -219,7 +219,7 @@ open class UploadService( open fun onUploadErrorNotification(id: String, e: Exception): Notification? { return NotificationCompat.Builder(this, channelId) .setStyle(this, notificationIconResourceId, notificationColorResourceId) - .setContentTitle(getString(R.string.notification_error_title)) + .setContentTitle(getString(R.string.upload_notification_error_title)) .setContentText(e.localizedMessage) .build() } @@ -237,10 +237,10 @@ open class UploadService( return NotificationCompat.Builder(this, channelId) .setStyle(this, notificationIconResourceId, notificationColorResourceId) .setOngoing(true) - .setContentTitle(getString(R.string.notification_progress_title)) + .setContentTitle(getString(R.string.upload_notification_progress_title)) .setContentText( getString( - R.string.notification_progress_text, + R.string.upload_notification_progress_text, numOfUploaded, totalNumOfUploads - numOfCancelled ) diff --git a/src/main/java/video/api/uploader/api/work/stores/NotificationConfigurationStore.kt b/src/main/java/video/api/uploader/api/work/stores/NotificationConfigurationStore.kt index 5bc2e4e..6ee4da9 100644 --- a/src/main/java/video/api/uploader/api/work/stores/NotificationConfigurationStore.kt +++ b/src/main/java/video/api/uploader/api/work/stores/NotificationConfigurationStore.kt @@ -28,7 +28,7 @@ object NotificationConfigurationStore { */ @JvmStatic @StringRes - var channelNameResourceId: Int = R.string.channel_name + var channelNameResourceId: Int = R.string.upload_notification_channel_name /** * A string resource identifier for the user visible description of the notification channel, or 0 if no description is provided. @@ -42,12 +42,12 @@ object NotificationConfigurationStore { */ @JvmStatic @DrawableRes - var notificationIconResourceId: Int = R.drawable.ic_api_video_logo + var notificationIconResourceId: Int = R.drawable.ic_upload_notification /** * The color id of the notification. */ @JvmStatic @ColorRes - var notificationColorResourceId: Int = R.color.primary_orange + var notificationColorResourceId: Int = R.color.upload_notification_color } \ No newline at end of file diff --git a/src/main/java/video/api/uploader/api/work/workers/AbstractUploadWorker.kt b/src/main/java/video/api/uploader/api/work/workers/AbstractUploadWorker.kt index bbca64e..b7fbbf5 100644 --- a/src/main/java/video/api/uploader/api/work/workers/AbstractUploadWorker.kt +++ b/src/main/java/video/api/uploader/api/work/workers/AbstractUploadWorker.kt @@ -80,7 +80,7 @@ abstract class AbstractUploadWorker( open fun onUploadStarted(): Notification { return NotificationCompat.Builder(applicationContext, channelId) .setStyle(applicationContext, notificationIconResourceId, notificationColorResourceId) - .setContentTitle(applicationContext.getString(R.string.notification_upload_started_title)) + .setContentTitle(applicationContext.getString(R.string.upload_notification_upload_started_title)) .build() } @@ -95,7 +95,7 @@ abstract class AbstractUploadWorker( open fun onUploadError(e: Exception): Notification? { return NotificationCompat.Builder(applicationContext, channelId) .setStyle(applicationContext, notificationIconResourceId, notificationColorResourceId) - .setContentTitle(applicationContext.getString(R.string.notification_error_title)) + .setContentTitle(applicationContext.getString(R.string.upload_notification_error_title)) .setContentText(e.localizedMessage) .build() } @@ -120,17 +120,17 @@ abstract class AbstractUploadWorker( notificationColorResourceId ) .setOngoing(true) - .setContentTitle(applicationContext.getString(R.string.notification_progress_title)) + .setContentTitle(applicationContext.getString(R.string.upload_notification_progress_title)) .setContentText( applicationContext.getString( - R.string.notification_current_progress_text, + R.string.upload_notification_current_progress_text, progress ) ) .setProgress(100, progress, false) .addAction( android.R.drawable.ic_delete, - applicationContext.getString(R.string.notification_cancel), + applicationContext.getString(R.string.upload_notification_cancel), intent ) .build() diff --git a/src/main/res/drawable/ic_api_video_logo.xml b/src/main/res/drawable/ic_upload_notification.xml similarity index 100% rename from src/main/res/drawable/ic_api_video_logo.xml rename to src/main/res/drawable/ic_upload_notification.xml diff --git a/src/main/res/values/colors.xml b/src/main/res/values/colors.xml index fe0a09c..54af32a 100644 --- a/src/main/res/values/colors.xml +++ b/src/main/res/values/colors.xml @@ -1,10 +1,4 @@ - #FA5B30 - #FFB39E - #D9E1EC - #414F6E - #0B0F17 - #FFFFFF - #66FFFFFF + #FA5B30 \ No newline at end of file diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 6f09ffb..bbb528b 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -1,10 +1,10 @@ - api.video - Uploading - Uploaded %1d of %1d - %1d %% - Upload error - Upload starting… - Cancel + api.video + Uploading + Uploaded %1d of %1d + %1d %% + Upload error + Upload starting… + Cancel \ No newline at end of file