mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Debug: Add button to send a PebbleKit notification
This commit is contained in:
parent
f3e16c5b1d
commit
22de76620d
@ -224,6 +224,14 @@ public class DebugActivity extends AbstractGBActivity {
|
||||
}
|
||||
});
|
||||
|
||||
Button testPebbleKitNotificationButton = findViewById(R.id.testPebbleKitNotificationButton);
|
||||
testPebbleKitNotificationButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
testPebbleKitNotification();
|
||||
}
|
||||
});
|
||||
|
||||
Button fetchDebugLogsButton = findViewById(R.id.fetchDebugLogsButton);
|
||||
fetchDebugLogsButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -328,6 +336,13 @@ public class DebugActivity extends AbstractGBActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void testPebbleKitNotification() {
|
||||
Intent pebbleKitIntent = new Intent("com.getpebble.action.SEND_NOTIFICATION");
|
||||
pebbleKitIntent.putExtra("messageType", "PEBBLE_ALERT");
|
||||
pebbleKitIntent.putExtra("notificationData", "[{\"title\":\"PebbleKitTest\",\"body\":\"sent from Gadgetbridge\"}]");
|
||||
getApplicationContext().sendBroadcast(pebbleKitIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
|
@ -124,6 +124,13 @@
|
||||
grid:layout_columnSpan="2"
|
||||
grid:layout_gravity="fill_horizontal"
|
||||
android:text="create test notification" />
|
||||
<Button
|
||||
android:id="@+id/testPebbleKitNotificationButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
grid:layout_columnSpan="2"
|
||||
grid:layout_gravity="fill_horizontal"
|
||||
android:text="create PebbleKit test notification" />
|
||||
<Button
|
||||
android:id="@+id/fetchDebugLogsButton"
|
||||
android:layout_width="wrap_content"
|
||||
|
Loading…
Reference in New Issue
Block a user