mirror of
				https://github.com/SimpleMobileTools/Simple-Flashlight.git
				synced 2025-06-05 21:59:19 +02:00 
			
		
		
		
	Use correct icon for quicksettings tile
- It will be tinted by the system automatically refs #31
This commit is contained in:
		| @@ -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" /> | ||||
|   | ||||
| @@ -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() | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user