File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed
kotlin/com/simplemobiletools/flashlight/helpers Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 6363 <activity
6464 android : name =" .activities.BrightDisplayActivity"
6565 android : exported =" false"
66+ android : launchMode =" singleInstance"
6667 android : label =" @string/bright_display"
6768 android : theme =" @style/FullScreenTheme" />
6869
131132 </receiver >
132133
133134 <service
134- android : name =" .helpers.MyTileService "
135+ android : name =" .helpers.FlashlightTileService "
135136 android : exported =" true"
136137 android : icon =" @drawable/img_torch_widget_preview"
137138 android : label =" @string/app_launcher_name"
141142 </intent-filter >
142143 </service >
143144
145+ <service
146+ android : name =" .helpers.BrightDisplayTileService"
147+ android : exported =" true"
148+ android : icon =" @drawable/img_bright_display_widget_preview"
149+ android : label =" @string/bright_display"
150+ android : permission =" android.permission.BIND_QUICK_SETTINGS_TILE" >
151+ <intent-filter >
152+ <action android : name =" android.service.quicksettings.action.QS_TILE" />
153+ </intent-filter >
154+ </service >
155+
144156 <activity-alias
145157 android : name =" .activities.SplashActivity.Red"
146158 android : enabled =" false"
Original file line number Diff line number Diff line change 1+ package com.simplemobiletools.flashlight.helpers
2+
3+ import android.annotation.TargetApi
4+ import android.content.Intent
5+ import android.os.Build
6+ import android.service.quicksettings.TileService
7+ import com.simplemobiletools.flashlight.activities.BrightDisplayActivity
8+
9+ @TargetApi(Build .VERSION_CODES .N )
10+ class BrightDisplayTileService : TileService () {
11+
12+ override fun onClick () {
13+ val intent = Intent (applicationContext, BrightDisplayActivity ::class .java)
14+ intent.addFlags(Intent .FLAG_ACTIVITY_SINGLE_TOP or Intent .FLAG_ACTIVITY_NEW_TASK )
15+ startActivityAndCollapse(intent)
16+ }
17+ }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import android.service.quicksettings.Tile
66import android.service.quicksettings.TileService
77
88@TargetApi(Build .VERSION_CODES .N )
9- class MyTileService : TileService () {
9+ class FlashlightTileService : TileService () {
1010
1111 override fun onClick () {
1212 MyCameraImpl .newInstance(this ).toggleFlashlight()
You can’t perform that action at this time.
0 commit comments