Link Search Menu Expand Document

Quick Settings Detail View

Add an extended view to your Quick Settings Tile, which gets displayed by clicking on the tile label below the icon, like the Wi-Fi or Bluetooth tile.

For the Detail View you’ll need to know how to use RemoteViews and how they work, since this is used for the view layout and functionality.


How to add it in your app

Override the following methods inside your service class which is extending TileService. These will be called by the system to retrieve the necessary information for the detail view. They aren’t all required and if not provided the default will be used.

  • Return the title.
    public CharSequence semGetDetailViewTitle() {
      return null;
    }
    
  • If returning true, the main switchbar will be shown.
    public boolean semIsToggleButtonExists() {
      return true;
    }
    
  • Return the switchbar checked state at start. This only gets called once. See below to toggle it manually later on.
    public boolean semIsToggleButtonChecked() {
      return false;
    }
    
  • Return the RemoteViews for the Detail View.
    public RemoteViews semGetDetailView() {
      return null;
    }
    
  • Return the Intent which should be started when clicking the Details button. It will also replace the long click action defined in manifest. If null the button won’t be shown.
    public Intent semGetSettingsIntent() {
      return null;
    }
    
  • This will get called each time you toggle the switchbar and therefore serves as listener.
    public void semSetToggleButtonChecked(boolean checked) {
    }
    
  • Unknown. If somebody finds out what it does, please let us know :).
    public CharSequence semGetDetailViewSettingButtonName() {
      return null;
    }
    

Inside your tile service class you can trigger an update for the Detail View with this piece of code.

try {
    getClass().getMethod("semUpdateDetailView").invoke(this);
} catch (Exception e) {
    e.printStackTrace();
}

And to toggle and enable/disable the main switchbar use this.

try {
    getClass().getMethod("semFireToggleStateChanged", boolean.class, boolean.class).invoke(this, checked, enabled);
} catch (Exception e) {
    e.printStackTrace();
}