diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ee0d0da8..35f3d5123 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,13 @@ ###Changelog -####Version 0.17.0 (next) +####Version 0.17.0 * Add weather support through "Weather Notification" app * Various fixes for K9 mail when using the generic notification receiver +* Add a preference to hide the persistent notification icon of Gadgetbridge * Pebble: Support for build-in weather system app (FW 4.x) * Pebble: Add weather support for various watchfaces * Pebble: Add option to disable call display -* Pebble: Delete notifications that got dismissed on the phone +* Pebble: Add option to automatically delete notifications that got dismissed on the phone * Pebble: Bugfix for some PebbleKit enabled 3rd party apps (TCW and maybe other) * Pebble 2/LE: Improve reliablitly and transfer speed * HPlus: Improved discovery and pairing diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e1b691f81..ff2b210f5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -220,7 +220,7 @@ - diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/WeatherNotificationConfig.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/WeatherNotificationConfig.java new file mode 100644 index 000000000..49574bed7 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/WeatherNotificationConfig.java @@ -0,0 +1,15 @@ +package nodomain.freeyourgadget.gadgetbridge.activities; + +import android.os.Bundle; +import android.os.PersistableBundle; +import android.widget.TextView; + +import nodomain.freeyourgadget.gadgetbridge.R; + +public class WeatherNotificationConfig extends GBActivity { + @Override + public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) { + super.onCreate(savedInstanceState, persistentState); + setContentView(R.layout.activity_weather_notification); + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/appmanager/AbstractAppManagerFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/appmanager/AbstractAppManagerFragment.java index 3e68b2dfa..946d72ae3 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/appmanager/AbstractAppManagerFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/appmanager/AbstractAppManagerFragment.java @@ -4,6 +4,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.content.pm.PackageManager; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; @@ -298,6 +299,7 @@ public abstract class AbstractAppManagerFragment extends Fragment { if (!PebbleProtocol.UUID_WEATHER.equals(selectedApp.getUUID())) { menu.removeItem(R.id.appmanager_weather_activate); menu.removeItem(R.id.appmanager_weather_deactivate); + menu.removeItem(R.id.appmanager_weather_install_provider); } if (selectedApp.getType() == GBDeviceApp.Type.APP_SYSTEM || selectedApp.getType() == GBDeviceApp.Type.WATCHFACE_SYSTEM) { menu.removeItem(R.id.appmanager_app_delete); @@ -305,6 +307,18 @@ public abstract class AbstractAppManagerFragment extends Fragment { if (!selectedApp.isConfigurable()) { menu.removeItem(R.id.appmanager_app_configure); } + + if (PebbleProtocol.UUID_WEATHER.equals(selectedApp.getUUID())) { + PackageManager pm = getActivity().getPackageManager(); + try { + pm.getPackageInfo("ru.gelin.android.weather.notification", PackageManager.GET_ACTIVITIES); + menu.removeItem(R.id.appmanager_weather_install_provider); + } catch (PackageManager.NameNotFoundException e) { + menu.removeItem(R.id.appmanager_weather_activate); + menu.removeItem(R.id.appmanager_weather_deactivate); + } + } + switch (selectedApp.getType()) { case WATCHFACE: case APP_GENERIC: @@ -382,6 +396,9 @@ public abstract class AbstractAppManagerFragment extends Fragment { case R.id.appmanager_weather_deactivate: GBApplication.deviceService().onAppDelete(selectedApp.getUUID()); return true; + case R.id.appmanager_weather_install_provider: + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://f-droid.org/app/ru.gelin.android.weather.notification"))); + return true; case R.id.appmanager_app_configure: GBApplication.deviceService().onAppStart(selectedApp.getUUID(), true); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java index 80942dd94..81a417951 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -410,9 +410,12 @@ public class NotificationListener extends NotificationListenerService { return; } - LOG.info("notification removed, will ask device to delete it"); + Prefs prefs = GBApplication.getPrefs(); + if (prefs.getBoolean("autoremove_notifications", false)) { + LOG.info("notification removed, will ask device to delete it"); - GBApplication.deviceService().onDeleteNotification((int) sbn.getPostTime()); //FIMXE: a truly unique id would be better + GBApplication.deviceService().onDeleteNotification((int) sbn.getPostTime()); //FIMXE: a truly unique id would be better + } } private void dumpExtras(Bundle bundle) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/WeatherNotificationConfig.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/WeatherNotificationConfig.java deleted file mode 100644 index a2b325e35..000000000 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/WeatherNotificationConfig.java +++ /dev/null @@ -1,9 +0,0 @@ -package nodomain.freeyourgadget.gadgetbridge.externalevents; - -import android.app.Activity; - -public class WeatherNotificationConfig extends Activity { - - //TODO: we just need the user to enable us in the weather notification settings. There must be a better way - -} diff --git a/app/src/main/res/layout/activity_weather_notification.xml b/app/src/main/res/layout/activity_weather_notification.xml new file mode 100644 index 000000000..bbb5a7377 --- /dev/null +++ b/app/src/main/res/layout/activity_weather_notification.xml @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/appmanager_context.xml b/app/src/main/res/menu/appmanager_context.xml index 766f6c5a2..2f281ce82 100644 --- a/app/src/main/res/menu/appmanager_context.xml +++ b/app/src/main/res/menu/appmanager_context.xml @@ -27,6 +27,9 @@ + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 765cc4612..e219e6106 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,6 +32,7 @@ Deactivate HRM Activate system weather app Deactivate system weather app + Install the weather notification app Configure Move to top @@ -115,6 +116,9 @@ Sunrise and Sunset Send sunrise and sunset times based on the location to the pebble timeline + Autoremove dismissed Notifications + Notifications are automatically removed from the Pebble when dismissed from the Android device + Location Acquire Location Latitude @@ -374,4 +378,6 @@ Pebble Pairing A pairing dialog is expected to pop up on your Android device. If that does not happen, look in the notification drawer and accept the pairing request. After that accept the pairing request on your Pebble + + Make sure that this skin is enabled in the Weather Notification app to get weather information on your Pebble.\n\nNo configuration is needed here.\n\nYou can enable the system weather app of your Pebble from the app management.\n\nSupported watchfaces will show the weather automatically. diff --git a/app/src/main/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index 672517f60..6dac6eb9a 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -2,12 +2,14 @@ Add weather support through "Weather Notification" app - Various fixes for K9 mail when using the generic notification receiver + Various fixes for K9 mail when using the generic notification receiver Added transliteration option for notifications in the settings screen + Add a preference to hide the notification icon of Gadgetbridge + Pebble: Support for build-in weather system app (FW 4.x) Pebble: Add weather support for various watchfaces - Pebble: Delete notifications that got dismissed on the phone - Pebble: Add option to disable call display + Pebble: Add option to automatically delete notifications that got dismissed on the phone + Pebble: Add option to disable call display Pebble: Bugfix for some PebbleKit enabled 3rd party apps (TCW and maybe other) Pebble 2/LE: Improve reliablitly and transfer speed HPlus: Improved discovery and pairing diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 48eb91d87..39c7d9ed9 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -179,6 +179,11 @@ android:title="@string/pref_title_sunrise_sunset" android:summary="@string/pref_summary_sunrise_sunset" android:key="send_sunrise_sunset" /> +