mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-11 01:21: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);
|
Button fetchDebugLogsButton = findViewById(R.id.fetchDebugLogsButton);
|
||||||
fetchDebugLogsButton.setOnClickListener(new View.OnClickListener() {
|
fetchDebugLogsButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@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
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
|
@ -124,6 +124,13 @@
|
|||||||
grid:layout_columnSpan="2"
|
grid:layout_columnSpan="2"
|
||||||
grid:layout_gravity="fill_horizontal"
|
grid:layout_gravity="fill_horizontal"
|
||||||
android:text="create test notification" />
|
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
|
<Button
|
||||||
android:id="@+id/fetchDebugLogsButton"
|
android:id="@+id/fetchDebugLogsButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
Loading…
Reference in New Issue
Block a user