From c4bc06e3bcc3b8c7d563fb21f006fcdf9656ed74 Mon Sep 17 00:00:00 2001 From: Christopher Jakob Date: Wed, 22 Nov 2017 21:20:05 +0100 Subject: [PATCH] Use correct icon for quicksettings tile - It will be tinted by the system automatically refs #31 --- app/src/main/AndroidManifest.xml | 2 +- .../com/simplemobiletools/flashlight/helpers/MyTileService.kt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 38257dd..297b543 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -86,7 +86,7 @@ diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyTileService.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyTileService.kt index bf8d99f..35c24c6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyTileService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyTileService.kt @@ -1,6 +1,7 @@ package com.simplemobiletools.flashlight.helpers import android.os.Build +import android.service.quicksettings.Tile import android.service.quicksettings.TileService import android.support.annotation.RequiresApi @@ -8,5 +9,8 @@ import android.support.annotation.RequiresApi class MyTileService : TileService() { override fun onClick() { MyCameraImpl.newInstance(this).toggleFlashlight() + + qsTile.state = if (MyCameraImpl.isFlashlightOn) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE + qsTile.updateTile() } } \ No newline at end of file