diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c2094c52..620505499 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ ###Changelog ####Version 0.1.3 -* List all suported devices and connect on tap -* Remove the connect button +* Remove the connect button, list all suported devices and connect on tap instead +* Display firmware version of connected devices +* Remove quit button from the service notification, put a quit item in the context menu instead ####Version 0.1.2 * Added option to start Gadgetbridge and connect automatically when bluetooth is turned on diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java index a8f313489..88f7f23a9 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java @@ -96,18 +96,13 @@ public class BluetoothCommunicationService extends Service { PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); - Intent stopIntent = new Intent(this, StopServiceReceiver.class); - PendingIntent pendingIntentStop = PendingIntent.getBroadcast(this, 0, stopIntent, PendingIntent.FLAG_UPDATE_CURRENT); - return new NotificationCompat.Builder(this) .setContentTitle("Gadgetbridge") .setTicker(text) .setContentText(text) .setSmallIcon(R.drawable.ic_notification) - .addAction(android.R.drawable.ic_menu_close_clear_cancel, "Quit", pendingIntentStop) .setContentIntent(pendingIntent) .setOngoing(true).build(); - } private void updateNotification(String text) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java index 747ac0a1c..0cced562b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java @@ -125,11 +125,18 @@ public class ControlCenter extends Activity { startActivity(intent); return true; } - if (id == R.id.action_debug) { + else if (id == R.id.action_debug) { Intent intent = new Intent(this, DebugActivity.class); startActivity(intent); return true; } + else if (id == R.id.action_quit) { + Intent stopIntent = new Intent(this, BluetoothCommunicationService.class); + stopService(stopIntent); + + Intent quitIntent = new Intent(ControlCenter.ACTION_QUIT); + sendBroadcast(quitIntent); + } return super.onOptionsItemSelected(item); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/StopServiceReceiver.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/StopServiceReceiver.java deleted file mode 100644 index 6416bb25f..000000000 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/StopServiceReceiver.java +++ /dev/null @@ -1,16 +0,0 @@ -package nodomain.freeyourgadget.gadgetbridge; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -public class StopServiceReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - Intent stopIntent = new Intent(context, BluetoothCommunicationService.class); - context.stopService(stopIntent); - - Intent quitIntent = new Intent(ControlCenter.ACTION_QUIT); - context.sendBroadcast(quitIntent); - } -} diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index 19854b200..cf9153fd8 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -6,4 +6,6 @@ android:orderInCategory="100" app:showAsAction="never" /> + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a897a68bb..5abcd510e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,10 +1,9 @@ - Gadgetbridge Gadgetbridge Control Center Settings Debug + Quit Debug -