diff --git a/parts/AndroidManifest.xml b/parts/AndroidManifest.xml index f7325e8..1fe6efb 100644 --- a/parts/AndroidManifest.xml +++ b/parts/AndroidManifest.xml @@ -67,6 +67,14 @@ - + + + + + diff --git a/parts/res/drawable/dirac_qs_tile_icon.xml b/parts/res/drawable/dirac_qs_tile_icon.xml new file mode 100644 index 0000000..1f3d24f --- /dev/null +++ b/parts/res/drawable/dirac_qs_tile_icon.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/parts/res/values-ru-rRU/strings.xml b/parts/res/values-ru-rRU/strings.xml index 741c208..8c2e8a7 100644 --- a/parts/res/values-ru-rRU/strings.xml +++ b/parts/res/values-ru-rRU/strings.xml @@ -56,4 +56,6 @@ Кантри Танцевальная Металл + + Mi звук diff --git a/parts/res/values-uk-rUA/strings.xml b/parts/res/values-uk-rUA/strings.xml index 3e6c865..bb26757 100644 --- a/parts/res/values-uk-rUA/strings.xml +++ b/parts/res/values-uk-rUA/strings.xml @@ -56,4 +56,6 @@ Кантрі Танцювальна Метал + + Mi звук diff --git a/parts/res/values/strings.xml b/parts/res/values/strings.xml index ed47cc5..96dd7bd 100644 --- a/parts/res/values/strings.xml +++ b/parts/res/values/strings.xml @@ -57,4 +57,6 @@ Country Dance Metal + + Mi sound diff --git a/parts/src/org/lineageos/settings/dirac/DiracTileService.java b/parts/src/org/lineageos/settings/dirac/DiracTileService.java new file mode 100644 index 0000000..1ae6bfa --- /dev/null +++ b/parts/src/org/lineageos/settings/dirac/DiracTileService.java @@ -0,0 +1,42 @@ +package org.lineageos.settings.dirac; + + import android.service.quicksettings.Tile; +import android.service.quicksettings.TileService; + + public class DiracTileService extends TileService { + + private DiracUtils mDiracUtils; + + @Override + public void onStartListening() { + + mDiracUtils = new DiracUtils(getApplicationContext()); + + boolean enhancerEnabled = mDiracUtils.isDiracEnabled(); + + Tile tile = getQsTile(); + if (enhancerEnabled) { + tile.setState(Tile.STATE_ACTIVE); + } else { + tile.setState(Tile.STATE_INACTIVE); + } + + tile.updateTile(); + + super.onStartListening(); + } + + @Override + public void onClick() { + Tile tile = getQsTile(); + if (mDiracUtils.isDiracEnabled()) { + mDiracUtils.setEnabled(false); + tile.setState(Tile.STATE_INACTIVE); + } else { + mDiracUtils.setEnabled(true); + tile.setState(Tile.STATE_ACTIVE); + } + tile.updateTile(); + super.onClick(); + } +} \ No newline at end of file