Example usage for android.service.quicksettings Tile STATE_ACTIVE

List of usage examples for android.service.quicksettings Tile STATE_ACTIVE

Introduction

In this page you can find the example usage for android.service.quicksettings Tile STATE_ACTIVE.

Prototype

int STATE_ACTIVE

To view the source code for android.service.quicksettings Tile STATE_ACTIVE.

Click Source Link

Document

This represents a tile that is currently active.

Usage

From source file:net.hyx.app.volumenotification.NotificationFactory.java

@TargetApi(Build.VERSION_CODES.N)
void updateTile(Tile tile, int position) {
    //tile.setIcon(Icon.createWithResource(context, settings.getDrawable(context, R.array.pref_buttons_icons_entries, settings.getButtonIcon(position))));
    //tile.setLabel(settings.getButtonLabel(position));
    if (settings.getButtonChecked(position)) {
        tile.setState(Tile.STATE_ACTIVE);
    } else {/*from  w  w  w .j  a v  a 2s  .c  o m*/
        tile.setState(Tile.STATE_INACTIVE);
    }
    tile.updateTile();
}

From source file:net.hyx.app.volumenotification.factory.NotificationFactory.java

@TargetApi(Build.VERSION_CODES.N)
public void updateTile(Tile tile, int id) {
    VolumeControl item = model.parseItem(model.getItemById(id));
    if (item != null && tile != null) {
        tile.setIcon(Icon.createWithResource(context, model.getIconDrawable(item.icon)));
        tile.setLabel(item.label);/*from   w w w  .j  a  v  a  2  s  .  c  o  m*/
        tile.setState(Tile.STATE_ACTIVE);
        tile.updateTile();
    }
}