Skip to content

Commit

Permalink
- restore notification icons
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj0011 committed Mar 15, 2021
1 parent 0fdaa35 commit 006ba03
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LibraryRefreshWorker (private val appContext: Context, parameters: WorkerP
val librariesViewModel = LibrariesViewModel(dataSource, application)

val foregroundNotification = NotificationCompat.Builder(applicationContext, NotificationHelper.UPDATES_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_baseline_sync_24)
.setSmallIcon(R.drawable.ic_notif_baseline_sync_24)
.setContentTitle(appContext.getString(R.string.notification_text_checking_for_newer_lib_versions))
.setOnlyAlertOnce(true)
.setColor(ContextCompat.getColor(appContext, R.color.colorPrimary))
Expand Down Expand Up @@ -115,7 +115,7 @@ class LibraryRefreshWorker (private val appContext: Context, parameters: WorkerP

if (newArtifactVersionsToNotifySet.isNotEmpty()) {
val summaryNotification = NotificationCompat.Builder(appContext, NotificationHelper.NEW_LIBRARY_VERSIONS_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_new_releases_outline_24dp)
.setSmallIcon(R.drawable.ic_notif_new_releases_outline_24dp)
.setStyle(NotificationCompat.InboxStyle()
.setSummaryText(appContext.getString(R.string.notification_text_new_versions_available)))
.setOnlyAlertOnce(true)
Expand All @@ -142,7 +142,7 @@ class LibraryRefreshWorker (private val appContext: Context, parameters: WorkerP
val notification = NotificationCompat.Builder(appContext, NotificationHelper.NEW_LIBRARY_VERSIONS_CHANNEL_ID)
.setContentIntent(contentPendingIntent)
.setContentText(str)
.setSmallIcon(R.drawable.ic_new_releases_outline_24dp)
.setSmallIcon(R.drawable.ic_notif_new_releases_outline_24dp)
.setOnlyAlertOnce(true)
.setAutoCancel(true)
.setColor(ContextCompat.getColor(appContext, R.color.colorPrimary))
Expand Down Expand Up @@ -175,7 +175,7 @@ class LibraryRefreshWorker (private val appContext: Context, parameters: WorkerP

private fun showProgress(progress: Int, message: String) {
val notification = NotificationCompat.Builder(applicationContext, NotificationHelper.UPDATES_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_baseline_sync_24)
.setSmallIcon(R.drawable.ic_notif_baseline_sync_24)
.setContentTitle(appContext.getString(R.string.notification_text_checking_for_newer_lib_versions))
.setStyle(NotificationCompat.BigTextStyle().bigText(message))
.setProgress(100, progress, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ProjectSyncAllWorker (private val appContext: Context, parameters: WorkerP
val projectSyncs = dataSource.getAllProjectSyncsForWorker()

val notification = NotificationCompat.Builder(applicationContext, NotificationHelper.PROJECT_SYNC_ALL_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_baseline_sync_24)
.setSmallIcon(R.drawable.ic_notif_baseline_sync_24)
.setContentTitle(appContext.getString(R.string.notification_text_syncing_all_projects))
.setOnlyAlertOnce(true)
.setColor(ContextCompat.getColor(appContext, R.color.colorPrimary))
Expand Down Expand Up @@ -79,7 +79,7 @@ class ProjectSyncAllWorker (private val appContext: Context, parameters: WorkerP

private fun showProgress(progress: Int, message: String) {
val notification = NotificationCompat.Builder(applicationContext, NotificationHelper.PROJECT_SYNC_ALL_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_baseline_sync_24)
.setSmallIcon(R.drawable.ic_notif_baseline_sync_24)
.setContentTitle(appContext.getString(R.string.notification_text_syncing_all_projects))
.setContentText(message)
.setProgress(100, progress, false)
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/ic_notif_baseline_sync_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<vector android:height="24dp" android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,4L12,1L8,5l4,4L12,6c3.31,0 6,2.69 6,6 0,1.01 -0.25,1.97 -0.7,2.8l1.46,1.46C19.54,15.03 20,13.57 20,12c0,-4.42 -3.58,-8 -8,-8zM12,18c-3.31,0 -6,-2.69 -6,-6 0,-1.01 0.25,-1.97 0.7,-2.8L5.24,7.74C4.46,8.97 4,10.43 4,12c0,4.42 3.58,8 8,8v3l4,-4 -4,-4v3z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_notif_new_releases_outline_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?attr/colorControlNormal"
android:pathData="M23,12l-2.44,-2.78 0.34,-3.68 -3.61,-0.82 -1.89,-3.18L12,3 8.6,1.54 6.71,4.72l-3.61,0.81 0.34,3.68L1,12l2.44,2.78 -0.34,3.69 3.61,0.82 1.89,3.18L12,21l3.4,1.46 1.89,-3.18 3.61,-0.82 -0.34,-3.68L23,12zM18.49,14.11l0.26,2.79 -2.74,0.62 -1.43,2.41L12,18.82l-2.58,1.11 -1.43,-2.41 -2.74,-0.62 0.26,-2.8L3.66,12l1.85,-2.12 -0.26,-2.78 2.74,-0.61 1.43,-2.41L12,5.18l2.58,-1.11 1.43,2.41 2.74,0.62 -0.26,2.79L20.34,12l-1.85,2.11zM11,15h2v2h-2zM11,7h2v6h-2z"/>
</vector>

0 comments on commit 006ba03

Please sign in to comment.