Skip to content

Commit

Permalink
Use correct icon for quicksettings tile
Browse files Browse the repository at this point in the history
- It will be tinted by the system automatically

refs SimpleMobileTools#31
  • Loading branch information
chrjsorg committed Nov 22, 2017
1 parent b920f8b commit c4bc06e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package com.simplemobiletools.flashlight.helpers

import android.os.Build
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
import android.support.annotation.RequiresApi

@RequiresApi(Build.VERSION_CODES.N)
class MyTileService : TileService() {
override fun onClick() {
MyCameraImpl.newInstance(this).toggleFlashlight()

qsTile.state = if (MyCameraImpl.isFlashlightOn) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE
qsTile.updateTile()
}
}

0 comments on commit c4bc06e

Please sign in to comment.