Skip to content

Commit

Permalink
Add Quicksettings Tile
Browse files Browse the repository at this point in the history
- Icon adjustments are still missing

refs SimpleMobileTools#31
  • Loading branch information
chrjsorg committed Nov 22, 2017
1 parent f9a64bf commit b920f8b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,15 @@
android:name="android.appwidget.provider"
android:resource="@xml/widget_info"/>
</receiver>

<service
android:name=".helpers.MyTileService"
android:label="@string/app_launcher_name"
android:icon="@mipmap/ic_launcher"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.simplemobiletools.flashlight.helpers

import android.os.Build
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()
}
}

0 comments on commit b920f8b

Please sign in to comment.