From 5790bb6a48b307c0301fa21b6e5581ee92cdad99 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 9 Nov 2018 16:05:10 +0000 Subject: [PATCH] Improved quick settings tiles --- app/src/main/AndroidManifest.xml | 4 ++-- .../main/java/eu/faircode/email/ServiceTileSynchronize.java | 3 +++ app/src/main/java/eu/faircode/email/ServiceTileUnseen.java | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 81e010a46b..15f764e2f4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -113,7 +113,7 @@ @@ -123,7 +123,7 @@ diff --git a/app/src/main/java/eu/faircode/email/ServiceTileSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceTileSynchronize.java index 3adbdc71eb..c6d795372f 100644 --- a/app/src/main/java/eu/faircode/email/ServiceTileSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceTileSynchronize.java @@ -21,6 +21,7 @@ package eu.faircode.email; import android.annotation.TargetApi; import android.content.SharedPreferences; +import android.graphics.drawable.Icon; import android.os.Build; import android.preference.PreferenceManager; import android.service.quicksettings.Tile; @@ -50,6 +51,8 @@ public class ServiceTileSynchronize extends TileService implements SharedPrefere Tile tile = getQsTile(); if (tile != null) { tile.setState(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE); + tile.setIcon(Icon.createWithResource(this, + enabled ? R.drawable.baseline_sync_24 : R.drawable.baseline_sync_disabled_24)); tile.updateTile(); } } diff --git a/app/src/main/java/eu/faircode/email/ServiceTileUnseen.java b/app/src/main/java/eu/faircode/email/ServiceTileUnseen.java index bcc100deb0..21a00d0043 100644 --- a/app/src/main/java/eu/faircode/email/ServiceTileUnseen.java +++ b/app/src/main/java/eu/faircode/email/ServiceTileUnseen.java @@ -21,6 +21,7 @@ package eu.faircode.email; import android.annotation.TargetApi; import android.content.Intent; +import android.graphics.drawable.Icon; import android.os.Build; import android.os.IBinder; import android.service.quicksettings.Tile; @@ -72,6 +73,8 @@ public class ServiceTileUnseen extends TileService { Tile tile = getQsTile(); if (tile != null) { tile.setState(messages.size() > 0 ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE); + tile.setIcon(Icon.createWithResource(ServiceTileUnseen.this, + messages.size() > 0 ? R.drawable.baseline_mail_24 : R.drawable.baseline_mail_outline_24)); tile.setLabel(getResources().getQuantityString( R.plurals.title_tile_unseen, messages.size(), messages.size())); tile.updateTile();