Upgrade to Pro — share decks privately, control downloads, hide ads and more …

QucikSettingsTileAPI

funnelbit
September 28, 2016

 QucikSettingsTileAPI

funnelbit

September 28, 2016
Tweet

More Decks by funnelbit

Other Decks in Technology

Transcript

  1. 5JMF w TFU*DPO *DPO TFU-BCFM $IBS4FRVFODF  TFU$POUFOU%FTDSJQUJPO JOU TFU4UBUF

    JOU  w VQEBUF5JMF  w 5JMFͷঢ়ଶΛ൓өͤ͞Δʢද͕ࣔมΘΔʣ
  2. 5JMF public class QuickSettingsService
 extends TileService {
 … Tile tile

    = this.getQsTile();
 … tile.setIcon(…); tile.setTitle(…); tile.updateTile(); }
  3. 5JMF4FSWJDF public class QSService extends TileService {
 @Override
 public void

    onTileAdded() {
 super.onTileAdded();
 }
 
 @Override
 public void onTileRemoved() {
 super.onTileRemoved();
 }
 
 @Override
 public void onClick() {
 super.onClick();
 }
 
 @Override
 public void onStartListening() {
 super.onStartListening();
 }
 
 @Override
 public void onStopListening() {
 super.onStopListening();
 }
 } w 4FSWJDFͷࢠΫϥε w ܧঝͯ͠࢖͏
  4. 5JMF4FSWJDF w PO5JMF"EEFE  w 5JMF͕௥Ճ͞ΕͨΒݺ͹ΕΔ w PO5JMF3FNPWFE  w

    5JMF͕࡟আ͞ΕͨΒݺ͹ΕΔ w PO$MJDL  w 5JMF͕ΫϦοΫͨ͠Βݺ͹ΕΔ
  5. TUBSU"DUJWJUZ"OE$PMMBQTF w "DUJWJUZىಈ͠2VJDL4FUUJOHTΛͨͨΜͰ͘ΕΔ w ϩοΫதͩͱͨͨΊͳ͍ʢ"DUJWJUZىಈ͸͢Δʣ public class QSIntentService
 extends TileService

    … Intent intent = new Intent(getApplicationContext(),
 ResultActivity.class);
 startActivityAndCollapse(intent); …
 }
  6. VOMPDL"OE3VO w ʮΞϯϩοΫͨ͠Βಈ͘ʯॲཧ͕͔͚Δ public class QSService extends TileService {
 …


    @Override
 public void onClick() {
 unlockAndRun(new Runnable() {
 @Override
 public void run() {
 Log.e("ಈ͘Α", "΄͓͓͓͓͓͓͓");
 }
 });
 }
 …
 }