Skip to content

Commit

Permalink
Tile inactive when missing permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
cvzi committed Feb 2, 2019
1 parent 7d5c0f4 commit 7835ffa
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.github.ipcjs.screenshottile.Utils.p
*/


class ScreenshotTileService : TileService() {
class ScreenshotTileService : TileService(), OnAcquireScreenshotPermissionListener {
companion object {
var instance: ScreenshotTileService? = null
}
Expand All @@ -32,12 +32,19 @@ class ScreenshotTileService : TileService() {
override fun onTileAdded() {
super.onTileAdded()

// qsTile.state = Tile.STATE_INACTIVE // TODO tile state should resemble current permission situation
qsTile.state = Tile.STATE_INACTIVE

App.aquireScreenshotPermission(this)
App.aquireScreenshotPermission(this, this)
p("onTileAdded")
qsTile.updateTile()
}

override fun onAcquireScreenshotPermission() {
qsTile.state = Tile.STATE_ACTIVE
qsTile.updateTile()
}


override fun onTileRemoved() {
super.onTileRemoved()
p("onTileRemoved")
Expand Down

0 comments on commit 7835ffa

Please sign in to comment.