mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 09:01:55 +01:00
Fossil Hybrid HR: Allow flick_away as custom event and add move_hands event
This commit is contained in:
parent
785b6797a3
commit
ce456d6dcc
Binary file not shown.
@ -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"));
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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>() {
|
||||
|
@ -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">
|
||||
|
@ -1559,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>
|
||||
|
@ -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>
|
||||
|
||||
|
2
external/fossil-hr-watchface
vendored
2
external/fossil-hr-watchface
vendored
@ -1 +1 @@
|
||||
Subproject commit 2cb107b23e26546ab27b8d13eacf8b0852d8b514
|
||||
Subproject commit a858758bc9e287c9f902e061511f12aee4870972
|
Loading…
Reference in New Issue
Block a user