mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-01-01 03:27:30 +01:00
Use correct icon for quicksettings tile
- It will be tinted by the system automatically refs #31
This commit is contained in:
parent
b920f8b095
commit
c4bc06e3bc
@ -86,7 +86,7 @@
|
|||||||
<service
|
<service
|
||||||
android:name=".helpers.MyTileService"
|
android:name=".helpers.MyTileService"
|
||||||
android:label="@string/app_launcher_name"
|
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">
|
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.simplemobiletools.flashlight.helpers
|
package com.simplemobiletools.flashlight.helpers
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import android.service.quicksettings.Tile
|
||||||
import android.service.quicksettings.TileService
|
import android.service.quicksettings.TileService
|
||||||
import android.support.annotation.RequiresApi
|
import android.support.annotation.RequiresApi
|
||||||
|
|
||||||
@ -8,5 +9,8 @@ import android.support.annotation.RequiresApi
|
|||||||
class MyTileService : TileService() {
|
class MyTileService : TileService() {
|
||||||
override fun onClick() {
|
override fun onClick() {
|
||||||
MyCameraImpl.newInstance(this).toggleFlashlight()
|
MyCameraImpl.newInstance(this).toggleFlashlight()
|
||||||
|
|
||||||
|
qsTile.state = if (MyCameraImpl.isFlashlightOn) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE
|
||||||
|
qsTile.updateTile()
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user