use of android.service.quicksettings.Tile in project platform_frameworks_base by android.
the class NekoTile method updateState.
private void updateState() {
Tile tile = getQsTile();
int foodState = mPrefs.getFoodState();
Food food = new Food(foodState);
if (foodState != 0) {
NekoService.registerJobIfNeeded(this, food.getInterval(this));
}
tile.setIcon(food.getIcon(this));
tile.setLabel(food.getName(this));
tile.setState(foodState != 0 ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
tile.updateTile();
}
use of android.service.quicksettings.Tile in project AnimatorDurationTile by nickbutcher.
the class ToggleAnimatorDuration method updateTile.
private void updateTile() {
final float scale = getAnimatorScale(getContentResolver());
final Tile tile = getQsTile();
tile.setIcon(Icon.createWithResource(getApplicationContext(), getIcon(scale)));
tile.updateTile();
}
use of android.service.quicksettings.Tile in project cw-omnibus by commonsguy.
the class ToggleTileService method updateTile.
private void updateTile() {
Tile tile = getQsTile();
if (tile != null) {
boolean isEnabled = getPrefs().getBoolean(SettingsFragment.PREF_ENABLED, false);
int state = isEnabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
tile.setIcon(Icon.createWithResource(this, R.drawable.ic_new_releases_24dp));
tile.setLabel(getString(R.string.app_name_short));
tile.setState(state);
tile.updateTile();
}
}
use of android.service.quicksettings.Tile in project android_frameworks_base by ResurrectionRemix.
the class QSTileHost method changeTiles.
public void changeTiles(List<String> previousTiles, List<String> newTiles) {
final int NP = previousTiles.size();
final int NA = newTiles.size();
for (int i = 0; i < NP; i++) {
String tileSpec = previousTiles.get(i);
if (!tileSpec.startsWith(CustomTile.PREFIX))
continue;
if (!newTiles.contains(tileSpec)) {
ComponentName component = CustomTile.getComponentFromSpec(tileSpec);
Intent intent = new Intent().setComponent(component);
TileLifecycleManager lifecycleManager = new TileLifecycleManager(new Handler(), mContext, mServices, new Tile(), intent, new UserHandle(ActivityManager.getCurrentUser()));
lifecycleManager.onStopListening();
lifecycleManager.onTileRemoved();
TileLifecycleManager.setTileAdded(mContext, component, false);
lifecycleManager.flushMessagesAndUnbind();
}
}
if (DEBUG)
Log.d(TAG, "saveCurrentTiles " + newTiles);
Secure.putStringForUser(getContext().getContentResolver(), QSTileHost.TILES_SETTING, TextUtils.join(",", newTiles), ActivityManager.getCurrentUser());
}
use of android.service.quicksettings.Tile in project android_frameworks_base by ResurrectionRemix.
the class NekoTile method updateState.
private void updateState() {
Tile tile = getQsTile();
int foodState = mPrefs.getFoodState();
Food food = new Food(foodState);
if (foodState != 0) {
NekoService.registerJobIfNeeded(this, food.getInterval(this));
}
tile.setIcon(food.getIcon(this));
tile.setLabel(food.getName(this));
tile.setState(foodState != 0 ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
tile.updateTile();
}
Aggregations