Guest User

Untitled

a guest
Jan 13th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. public boolean onOptionsItemSelected(MenuItem item) {
  2. switch (item.getItemId()) {
  3. case R.id.notification:
  4. if (MetaWatchService.watchType == WatchType.DIGITAL)
  5. Notification.addTextNotification(this, "Notification", new VibratePattern(true, 500, 500, 3), Notification.notificationTimeout);
  6. else
  7. Notification.addOledNotification(this, Protocol.createOled2lines(this, "Display A, line 1", "Display A, line 2"), Protocol.createOled2lines(this, "Display B, line 1", "Display B, line 2"), null, 0, null);
  8. return true;
  9. case R.id.application_start:
  10. if (MetaWatchService.watchType == WatchType.DIGITAL)
  11. Application.startAppMode();
  12. return true;
  13. case R.id.sms_start:
  14. startSmsTestLoop(this);
  15. return true;
  16. case R.id.sms_stop:
  17. stopSmsTestLoop();
  18. return true;
  19. case R.id.application_update:
  20. if (MetaWatchService.watchType == WatchType.DIGITAL)
  21. Application.updateAppMode(this);
  22. return true;
  23. case R.id.application_stop:
  24. if (MetaWatchService.watchType == WatchType.DIGITAL)
  25. Application.stopAppMode(this);
  26. return true;
  27. case R.id.sms:
  28. NotificationBuilder.createSMS(this, "555-123-456", "Rights groups report systematic state violence is being unleashed on Bahrain's opposition movement.");
  29. //NotificationBuilder.createSMS(this, "123-456-789", "Test SMS #" + "x");
  30. return true;
  31. case R.id.k9:
  32. NotificationBuilder.createK9(this, "e@mail.com", "Subject line");
  33. return true;
  34. case R.id.gmail:
  35. NotificationBuilder.createGmailBlank(this, "me@gmail.com");
  36. return true;
  37. case R.id.alarm:
  38. NotificationBuilder.createAlarm(this);
  39. return true;
  40. case R.id.music:
  41. NotificationBuilder.createMusic(this, "Park", "Who is Aliandra");
  42. return true;
  43. case R.id.call_start:
  44. Call.startCall(this, "555-123-4567");
  45. return true;
  46. case R.id.call_stop:
  47. Call.endCall(this);
  48. return true;
  49. case R.id.vibrate:
  50. Protocol.vibrate(300, 500, 3);
  51. return true;
  52. case R.id.set_rtc:
  53. Protocol.sendRtcNow(this);
  54. return true;
  55. case R.id.load_template:
  56. if (MetaWatchService.watchType == WatchType.DIGITAL)
  57. Protocol.loadTemplate(0);
  58. return true;
  59. case R.id.activate_buffer:
  60. if (MetaWatchService.watchType == WatchType.DIGITAL)
  61. Protocol.activateBuffer(0);
  62. return true;
  63. case R.id.update_display:
  64. if (MetaWatchService.watchType == WatchType.DIGITAL)
  65. Protocol.updateDisplay(0);
  66. return true;
  67. case R.id.write_bufer:
  68. if (MetaWatchService.watchType == WatchType.DIGITAL)
  69. Protocol.writeBuffer();
  70. return true;
  71. case R.id.test: {
  72. //Protocol.test(this);
  73. //NotificationBuilder.createSMS(this, "555-123-4567", "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20.");
  74. Protocol.setNvalTime(true);
  75. //Protocol.configureMode();
  76. //Protocol.readButtonConfiguration();
  77. //Protocol.enableMediaButtons();
  78. //Protocol.queryNvalTime();
  79. /*
  80. Log.d(MetaWatch.TAG, "sending notif test");
  81. Protocol.loadTemplate(2);
  82. Protocol.sendLcdBitmap(Protocol.createTextBitmap(this, "abc"), true);
  83. Protocol.updateDisplay(2);
  84. */
  85. }
  86. return true;
  87. default:
  88. return super.onOptionsItemSelected(item);
  89. }
  90. }
Add Comment
Please, Sign In to add comment