Compare commits

...

3 Commits

Author SHA1 Message Date
Arjan Schrijver ce456d6dcc Fossil Hybrid HR: Allow flick_away as custom event and add move_hands event 2022-09-26 14:49:39 +02:00
José Rebelo 785b6797a3 Amazfit GTR: Enable button actions 2022-09-26 12:10:59 +01:00
José Rebelo c488fd6b10 Amazfit GTR Lite: Fix DeviceType name 2022-09-26 12:10:21 +01:00
12 changed files with 45 additions and 9 deletions

View File

@ -101,6 +101,7 @@ public class AmazfitGTRCoordinator extends HuamiCoordinator {
R.xml.devicesettings_reserve_reminders_calendar,
R.xml.devicesettings_expose_hr_thirdparty,
R.xml.devicesettings_bt_connected_advertisement,
R.xml.devicesettings_buttonactions_with_longpress,
R.xml.devicesettings_device_actions,
R.xml.devicesettings_high_mtu,
R.xml.devicesettings_overwrite_settings_on_connection,

View File

@ -402,6 +402,9 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem
if (watchfaceConfig.has("toggle_backlight_event")) {
watchfaceSettings.setToggleBacklightEvent(watchfaceConfig.getString("toggle_backlight_event"));
}
if (watchfaceConfig.has("move_hands_event")) {
watchfaceSettings.setMoveHandsEvent(watchfaceConfig.getString("move_hands_event"));
}
if (watchfaceConfig.has("powersave_display")) {
watchfaceSettings.setPowersaveDisplay(watchfaceConfig.getBoolean("powersave_display"));
}

View File

@ -303,6 +303,7 @@ public class HybridHRWatchfaceFactory {
config.put("wrist_flick_move_minute", settings.getWristFlickMoveMinute());
config.put("toggle_widgets_event", settings.getToggleWidgetsEvent());
config.put("toggle_backlight_event", settings.getToggleBacklightEvent());
config.put("move_hands_event", settings.getMoveHandsEvent());
config.put("powersave_display", settings.getPowersaveDisplay());
config.put("powersave_hands", settings.getPowersaveHands());
config.put("light_up_on_notification", settings.getLightUpOnNotification());

View File

@ -27,6 +27,7 @@ public class HybridHRWatchfaceSettings implements Serializable {
private int wristFlickMoveMinute = -360;
private String toggleWidgetsEvent = "";
private String toggleBacklightEvent = "";
private String moveHandsEvent = "flick_away";
private boolean powersaveDisplay = false;
private boolean powersaveHands = false;
private boolean lightUpOnNotification = false;
@ -118,6 +119,14 @@ public class HybridHRWatchfaceSettings implements Serializable {
this.toggleBacklightEvent = event;
}
public String getMoveHandsEvent() {
return moveHandsEvent;
}
public void setMoveHandsEvent(String event) {
this.moveHandsEvent = event;
}
public boolean getPowersaveDisplay() {
return powersaveDisplay;
}

View File

@ -115,6 +115,11 @@ public class HybridHRWatchfaceSettingsActivity extends AbstractSettingsActivity
toggle_backlight.setValue(settings.getToggleBacklightEvent());
toggle_backlight.setSummary(toggle_backlight.getEntry());
ListPreference move_hands = (ListPreference) findPreference("pref_hybridhr_watchface_move_hands");
move_hands.setOnPreferenceChangeListener(this);
move_hands.setValue(settings.getMoveHandsEvent());
move_hands.setSummary(move_hands.getEntry());
SwitchPreference power_saving_display = (SwitchPreference) findPreference("pref_hybridhr_watchface_power_saving_display");
power_saving_display.setOnPreferenceChangeListener(this);
power_saving_display.setChecked(settings.getPowersaveDisplay());
@ -164,6 +169,11 @@ public class HybridHRWatchfaceSettingsActivity extends AbstractSettingsActivity
((ListPreference)preference).setValue(newValue.toString());
preference.setSummary(((ListPreference)preference).getEntry());
break;
case "pref_hybridhr_watchface_move_hands":
settings.setMoveHandsEvent(newValue.toString());
((ListPreference)preference).setValue(newValue.toString());
preference.setSummary(((ListPreference)preference).getEntry());
break;
case "pref_hybridhr_watchface_power_saving_display":
settings.setPowersaveDisplay((boolean) newValue);
break;

View File

@ -22,7 +22,7 @@ import java.util.Map;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
public final class QHybridConstants {
public static final String HYBRIDHR_WATCHFACE_VERSION = "1.6";
public static final String HYBRIDHR_WATCHFACE_VERSION = "1.7";
public static final int HYBRID_HR_WATCHFACE_WIDGET_SIZE = 76;
public static Map<String, String> KNOWN_WAPP_VERSIONS = new HashMap<String, String>() {

View File

@ -45,7 +45,7 @@ public enum DeviceType {
AMAZFITGTR(18, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_gtr),
AMAZFITGTS(19, R.drawable.ic_device_amazfit_bip, R.drawable.ic_device_amazfit_bip_disabled, R.string.devicetype_amazfit_gts),
AMAZFITBIPS(20, R.drawable.ic_device_amazfit_bip, R.drawable.ic_device_amazfit_bip_disabled, R.string.devicetype_amazfit_bips),
AMAZFITGTR_LITE(21, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_gtr),
AMAZFITGTR_LITE(21, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_gtr_lite),
AMAZFITTREX(22, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_trex),
MIBAND5(23, R.drawable.ic_device_miband2, R.drawable.ic_device_miband2_disabled, R.string.devicetype_miband5),
AMAZFITBAND5(24, R.drawable.ic_device_miband2, R.drawable.ic_device_miband2_disabled, R.string.devicetype_amazfit_band5),

View File

@ -2046,21 +2046,23 @@
<item>widget_bg_dashed_circle</item>
</string-array>
<string-array name="pref_hybridhr_watchface_buttonevents_items">
<string-array name="pref_hybridhr_watchface_events_items">
<item name="">@string/menuitem_nothing</item>
<item name="top_short_press_release">@string/pref_title_upper_button_function_short</item>
<item name="top_hold">@string/pref_title_upper_button_function_long</item>
<item name="middle_short_press_release">@string/pref_title_middle_button_function_short</item>
<item name="bottom_short_press_release">@string/pref_title_lower_button_function_short</item>
<item name="bottom_hold">@string/pref_title_lower_button_function_long</item>
<item name="flick_away">@string/watchface_setting_title_wrist_flick</item>
</string-array>
<string-array name="pref_hybridhr_watchface_buttonevents_values">
<string-array name="pref_hybridhr_watchface_events_values">
<item></item>
<item>top_short_press_release</item>
<item>top_hold</item>
<item>middle_short_press_release</item>
<item>bottom_short_press_release</item>
<item>bottom_hold</item>
<item>flick_away</item>
</string-array>
<string-array name="activity_filter_quick_filter_period_items">

View File

@ -1092,6 +1092,7 @@
<string name="devicetype_amazfit_cor">Amazfit Cor</string>
<string name="devicetype_amazfit_cor2">Amazfit Cor 2</string>
<string name="devicetype_amazfit_gtr">Amazfit GTR</string>
<string name="devicetype_amazfit_gtr_lite">Amazfit GTR Lite</string>
<string name="devicetype_amazfit_trex">Amazfit T-Rex</string>
<string name="devicetype_amazfit_bips">Amazfit Bip S</string>
<string name="devicetype_amazfit_bips_lite">Amazfit Bip S Lite</string>
@ -1558,6 +1559,7 @@
<string name="watchface_setting_title_custom_events">Custom events</string>
<string name="watchface_setting_button_toggle_widgets">Toggle widgets</string>
<string name="watchface_setting_button_toggle_backlight">Turn backlight on</string>
<string name="watchface_setting_button_move_hands">Move hands</string>
<string name="watchface_cache_confirm_overwrite">A watchface with this name already exists in the cache. Do you want to overwrite it?</string>
<string name="watchface_upload_failed">Upload of the watchface failed. Please try again.</string>
<string name="watchface_widget_type_battery">Battery</string>

View File

@ -51,18 +51,26 @@
android:persistent="false"
android:title="@string/watchface_setting_button_toggle_widgets"
android:key="pref_hybridhr_watchface_toggle_widgets"
android:entries="@array/pref_hybridhr_watchface_buttonevents_items"
android:entryValues="@array/pref_hybridhr_watchface_buttonevents_values"
android:entries="@array/pref_hybridhr_watchface_events_items"
android:entryValues="@array/pref_hybridhr_watchface_events_values"
android:dialogTitle="@string/watchface_setting_button_toggle_widgets"
android:negativeButtonText="@string/Cancel"/>
<ListPreference
android:persistent="false"
android:title="@string/watchface_setting_button_toggle_backlight"
android:key="pref_hybridhr_watchface_toggle_backlight"
android:entries="@array/pref_hybridhr_watchface_buttonevents_items"
android:entryValues="@array/pref_hybridhr_watchface_buttonevents_values"
android:entries="@array/pref_hybridhr_watchface_events_items"
android:entryValues="@array/pref_hybridhr_watchface_events_values"
android:dialogTitle="@string/watchface_setting_button_toggle_backlight"
android:negativeButtonText="@string/Cancel"/>
<ListPreference
android:persistent="false"
android:title="@string/watchface_setting_button_move_hands"
android:key="pref_hybridhr_watchface_move_hands"
android:entries="@array/pref_hybridhr_watchface_events_items"
android:entryValues="@array/pref_hybridhr_watchface_events_values"
android:dialogTitle="@string/watchface_setting_button_move_hands"
android:negativeButtonText="@string/Cancel"/>
</PreferenceCategory>

@ -1 +1 @@
Subproject commit 2cb107b23e26546ab27b8d13eacf8b0852d8b514
Subproject commit a858758bc9e287c9f902e061511f12aee4870972