-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Quick-Tile service to start tradow tracking from quick-setting-…
…drawer
- Loading branch information
1 parent
d157410
commit 9354dae
Showing
7 changed files
with
49 additions
and
14 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/src/main/java/dev/harsh/tradow/quicksetting/TrackingQsTile.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package dev.harsh.tradow.quicksetting | ||
|
||
import android.content.Intent | ||
import android.service.quicksettings.TileService | ||
import dev.harsh.tradow.service.BackgroundService | ||
import dev.harsh.tradow.util.showShortToast | ||
|
||
class TrackingQsTile : TileService() { | ||
|
||
override fun onClick() { | ||
super.onClick() | ||
startService(Intent(applicationContext, BackgroundService::class.java)) | ||
applicationContext.showShortToast("Tradow is active") | ||
} | ||
|
||
override fun onDestroy() { | ||
super.onDestroy() | ||
stopService(Intent(applicationContext, BackgroundService::class.java)) | ||
applicationContext.showShortToast("Tradow is inactive") | ||
} | ||
} |