Add Quicksettings Tile

- Icon adjustments are still missing

refs #31
This commit is contained in:
Christopher Jakob 2017-11-22 17:39:05 +01:00
parent f9a64bf6cc
commit b920f8b095
2 changed files with 22 additions and 0 deletions

View File

@ -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>

View File

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