Use correct icon for quicksettings tile

- It will be tinted by the system automatically

refs #31
This commit is contained in:
Christopher Jakob 2017-11-22 21:20:05 +01:00
parent b920f8b095
commit c4bc06e3bc
2 changed files with 5 additions and 1 deletions

View File

@ -86,7 +86,7 @@
<service
android:name=".helpers.MyTileService"
android:label="@string/app_launcher_name"
android:icon="@mipmap/ic_launcher"
android:icon="@drawable/img_widget_preview"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />

View File

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