Example usage for android.service.quicksettings Tile updateTile

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

Introduction

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

Prototype

public void updateTile() 

Source Link

Document

Pushes the state of the Tile to Quick Settings to be displayed.

Usage

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  .jav a 2s  .  c  o  m
        tile.setState(Tile.STATE_ACTIVE);
        tile.updateTile();
    }
}

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 {//  w ww  .  ja  v a  2  s.c o  m
        tile.setState(Tile.STATE_INACTIVE);
    }
    tile.updateTile();
}