1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Improved quick settings tiles

This commit is contained in:
M66B 2018-11-09 16:05:10 +00:00
parent d56296eda3
commit 5790bb6a48
3 changed files with 8 additions and 2 deletions

View file

@ -113,7 +113,7 @@
<service
android:name=".ServiceTileSynchronize"
android:icon="@drawable/baseline_compare_arrows_24"
android:icon="@drawable/baseline_sync_disabled_24"
android:label="@string/tile_synchronize"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
@ -123,7 +123,7 @@
<service
android:name=".ServiceTileUnseen"
android:icon="@drawable/baseline_mail_24"
android:icon="@drawable/baseline_mail_outline_24"
android:label="@string/tile_unseen"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>

View file

@ -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();
}
}

View file

@ -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();