Java Code Examples for android.service.quicksettings.Tile#setContentDescription()
The following examples show how to use
android.service.quicksettings.Tile#setContentDescription() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MyTileService.java From journaldev with MIT License | 6 votes |
@Override public void onClick() { super.onClick(); Tile tile = getQsTile(); boolean isActive = (tile.getState() == Tile.STATE_ACTIVE); if (isActive) { tile.setState(Tile.STATE_INACTIVE); startActivityAndCollapse(new Intent(this, MainActivity.class)); tile.setLabel("Disabled"); tile.setContentDescription("Test App"); tile.setIcon(Icon.createWithResource(this, android.R.drawable.ic_media_play)); } else { mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); int counter = mSharedPreferences.getInt("counter", 0); tile.setState(Tile.STATE_ACTIVE); tile.setIcon(Icon.createWithResource(this, android.R.drawable.ic_media_pause)); tile.setLabel("Count " + counter); } tile.updateTile(); }
Example 2
Source File: QuickSettingsTapService.java From ui with Apache License 2.0 | 6 votes |
@Override public void onStartListening() { Log.d(TAG, "onStartListening"); boolean working = getServiceStatus(); Tile tile = getQsTile(); if (working) { //turn on the tile here. tile.setIcon(Icon.createWithResource(this, R.drawable.cooltile_on)); tile.setLabel("Cool tile"); tile.setContentDescription("cool tile is On"); tile.setState(Tile.STATE_ACTIVE); } else { //turn on the tile here. tile.setIcon(Icon.createWithResource(this, R.drawable.cooltile_off)); tile.setLabel("Cool tile"); tile.setContentDescription("cool tile is Off"); tile.setState(Tile.STATE_INACTIVE); } tile.updateTile(); }
Example 3
Source File: QuickSettingsTapService.java From ui with Apache License 2.0 | 6 votes |
@Override public void onClick() { Log.d(TAG, "onClick"); boolean working = getServiceStatus(); Tile tile = getQsTile(); if (working) { //turn on the tile here. tile.setIcon(Icon.createWithResource(this, R.drawable.cooltile_on)); tile.setLabel("Cool tile"); tile.setContentDescription("cool tile is On"); tile.setState(Tile.STATE_ACTIVE); } else { //turn on the tile here. tile.setIcon(Icon.createWithResource(this, R.drawable.cooltile_off)); tile.setLabel("Cool tile"); tile.setContentDescription("cool tile is Off"); tile.setState(Tile.STATE_INACTIVE); } tile.updateTile(); }
Example 4
Source File: DaedalusTileService.java From Daedalus with GNU General Public License v3.0 | 5 votes |
@Override public void onClick() { Tile tile = getQsTile(); tile.setLabel(getString(R.string.quick_toggle)); tile.setContentDescription(getString(R.string.app_name)); tile.setState(Daedalus.switchService() ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE); tile.updateTile(); }
Example 5
Source File: DaedalusTileService.java From Daedalus with GNU General Public License v3.0 | 5 votes |
private void updateTile() { boolean activate = DaedalusVpnService.isActivated(); Tile tile = getQsTile(); tile.setLabel(getString(R.string.quick_toggle)); tile.setContentDescription(getString(R.string.app_name)); tile.setState(activate ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE); tile.updateTile(); }