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

QucikSettingsTileAPI

8928b5277aa7234dbca4ff782952343a?s=47 funnelbit
September 28, 2016

 QucikSettingsTileAPI

8928b5277aa7234dbca4ff782952343a?s=128

funnelbit

September 28, 2016
Tweet

More Decks by funnelbit

Other Decks in Technology

Transcript

  1. 2VJDL4FUUJOHT5JMF "1*

  2. ࣗݾ঺հ ๺ଜྋ גࣜձࣾ͸ͯͳ )BUFOBGVOOFMCJU 5XJUUFS!FYQFSPQFSP

  3. 2VJDL4FUUJOHT5JMF"1*

  4. 2VJDL4FUUJOHT5JMF"1* w ͔Β"1*͕ެ։͞Εͨ w BOESPJETFSWJDFRVJDLTFUUJOHT5JMF w BOESPJETFSWJDFRVJDLTFUUJOHT5JMF4FSWJDF

  5. 5JMF

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

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

    = this.getQsTile();
 … tile.setIcon(…); tile.setTitle(…); tile.updateTile(); }
  8. 5JMF4FSWJDF

  9. 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 ܧঝͯ͠࢖͏
  10. 5JMF4FSWJDF w PO5JMF"EEFE  w 5JMF͕௥Ճ͞ΕͨΒݺ͹ΕΔ w PO5JMF3FNPWFE  w

    5JMF͕࡟আ͞ΕͨΒݺ͹ΕΔ w PO$MJDL  w 5JMF͕ΫϦοΫͨ͠Βݺ͹ΕΔ
  11. 5JMF4FSWJDF w PO4UBSU-JTUFOJOH  w Ϧεχϯάঢ়ଶʹೖͬͨΒݺ͹ΕΔ w PO4UPQ-JTUFOJOH  w

    Ϧεχϯάঢ়ଶͰແ͘ͳͬͨΒݺ͹ΕΔ
  12. "OESPJE.BOJGFTU

  13. "OESPJE.BOJGFTU <service
 android:name=".QuickSettingsService"
 android:icon="@drawable/ic_android_black_24dp"
 android:label="@string/tile_label"
 android:permission="android.permission.BIND_QUICK_SETTINGS_ TILE">
 <intent-filter>
 <action android:name="android.service.quicksettings.action.QS_TILE"

    />
 </intent-filter>
 </service>
  14. "OESPJE.BOJGFTU <service
 android:name=".QuickSettingsService"
 android:icon="@drawable/ic_android_black_24dp"
 android:label="@string/tile_label"
 android:permission="android.permission.BIND_QUICK_SETTINGS_ TILE">
 <intent-filter>
 <action android:name="android.service.quicksettings.action.QS_TILE"

    />
 </intent-filter>
 </service>
  15. 5JMF4FSWJDF TUBSU"DUJWJUZ"OE$PMMBQTF TIPX%JBMPH VOMPDL"OE3VO

  16. TUBSU"DUJWJUZ"OE$PMMBQTF w "DUJWJUZىಈ͠2VJDL4FUUJOHTΛͨͨΜͰ͘ΕΔ w ϩοΫதͩͱͨͨΊͳ͍ʢ"DUJWJUZىಈ͸͢Δʣ public class QSIntentService
 extends TileService

    … Intent intent = new Intent(getApplicationContext(),
 ResultActivity.class);
 startActivityAndCollapse(intent); …
 }
  17. TIPX%JBMPH w 2VJDL4FUUJOHTΛดͯ͡%JBMPHΛग़͢ w ϩοΫதͩͱͨͨΊͳ͍ʢ%JBMPHىಈ͸͢Δʣ public class QSDialogService
 extends TileService

    { … DialogFragment dialog = DialogFragment.create(); showDialog(dialog); …
 }
  18. VOMPDL"OE3VO w ʮΞϯϩοΫͨ͠Βಈ͘ʯॲཧ͕͔͚Δ public class QSService extends TileService {
 …


    @Override
 public void onClick() {
 unlockAndRun(new Runnable() {
 @Override
 public void run() {
 Log.e("ಈ͘Α", "΄͓͓͓͓͓͓͓");
 }
 });
 }
 …
 }
  19. ·ͱΊ w ໾ཱͯΕΔ͔Ͳ͏͔͸ϓϩμΫτʹΑΔ w ʮϩοΫத΋ԡͤΔʯͱ͍͏ͷ͕ϙΠϯτ w Ϣʔβʹ͓͍ͯ΋Β͏ಋઢΛͲ͏͢Δ͔ʁ

  20. ࢀߟ w IUUQTDPEFMBCTEFWFMPQFSTHPPHMFDPN DPEFMBCTBOESPJEORVJDLTFUUJOHT JOEFYIUNM JOEFY''JP

  21. ͋Γ͕ͱ͏͍͟͝·ͨ͠