mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-09 03:37:03 +01:00
Pebble: split the pebble device specific settings in the existing root screens
This commit is contained in:
parent
13be343392
commit
6b38d5b283
@ -227,28 +227,26 @@ public class PebbleCoordinator extends AbstractBLClassicDeviceCoordinator {
|
||||
return true;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
||||
// return new int[]{
|
||||
// ,
|
||||
// R.xml.devicesettings_transliteration
|
||||
// };
|
||||
// }
|
||||
|
||||
@Override
|
||||
public DeviceSpecificSettings getDeviceSpecificSettings(final GBDevice device) {
|
||||
final DeviceSpecificSettings deviceSpecificSettings = new DeviceSpecificSettings();
|
||||
|
||||
final List<Integer> notifications = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.CALLS_AND_NOTIFICATIONS);
|
||||
notifications.add(R.xml.devicesettings_autoremove_notifications);
|
||||
notifications.add(R.xml.devicesettings_pebble_calls_notifications);
|
||||
notifications.add(R.xml.devicesettings_canned_reply_16);
|
||||
notifications.add(R.xml.devicesettings_canned_dismisscall_16);
|
||||
notifications.add(R.xml.devicesettings_transliteration);
|
||||
|
||||
final List<Integer> calendar = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.CALENDAR);
|
||||
calendar.add(R.xml.devicesettings_sync_calendar);
|
||||
calendar.add(R.xml.devicesettings_pebble_calendar);
|
||||
|
||||
deviceSpecificSettings.addRootScreen(R.xml.devicesettings_pebble_preferences);
|
||||
final List<Integer> activity = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.ACTIVITY_INFO);
|
||||
activity.add(R.xml.devicesettings_pebble_activity);
|
||||
|
||||
final List<Integer> dev = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.DEVELOPER);
|
||||
dev.add(R.xml.devicesettings_pebble_developer);
|
||||
|
||||
return deviceSpecificSettings;
|
||||
}
|
||||
|
43
app/src/main/res/xml/devicesettings_pebble_activity.xml
Normal file
43
app/src/main/res/xml/devicesettings_pebble_activity.xml
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/pref_header_activitytrackers"
|
||||
app:iconSpaceReserved="false">
|
||||
<ListPreference
|
||||
android:defaultValue="4"
|
||||
android:entries="@array/pebble_activitytracker"
|
||||
android:entryValues="@array/pebble_activitytracker_values"
|
||||
android:key="pebble_activitytracker"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_title_pebble_activitytracker"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="pebble_sync_health"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:title="@string/pref_title_pebble_sync_health"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:dependency="pebble_sync_health"
|
||||
android:key="pebble_health_store_raw"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_health_store_raw"
|
||||
android:title="@string/pref_title_pebble_health_store_raw"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="pebble_sync_misfit"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:title="@string/pref_title_pebble_sync_misfit"
|
||||
app:iconSpaceReserved="false" />>
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="pebble_sync_morpheuz"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:title="@string/pref_title_pebble_sync_morpheuz"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
</androidx.preference.PreferenceScreen>
|
16
app/src/main/res/xml/devicesettings_pebble_calendar.xml
Normal file
16
app/src/main/res/xml/devicesettings_pebble_calendar.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/pref_header_pebble_timeline"
|
||||
app:iconSpaceReserved="false">
|
||||
<SwitchPreferenceCompat
|
||||
android:key="send_sunrise_sunset"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_sunrise_sunset"
|
||||
android:title="@string/pref_title_sunrise_sunset"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
|
||||
</androidx.preference.PreferenceScreen>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<ListPreference
|
||||
android:defaultValue="@string/p_pebble_privacy_mode_off"
|
||||
android:entries="@array/pebble_privacymode"
|
||||
android:entryValues="@array/pebble_privacymode_values"
|
||||
android:key="pebble_pref_privacy_mode"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_title_pebble_privacy_mode"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="pebble_enable_outgoing_call"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_enable_outgoing_call"
|
||||
android:title="@string/pref_title_enable_outgoing_call"
|
||||
app:iconSpaceReserved="false" />
|
||||
</androidx.preference.PreferenceScreen>
|
60
app/src/main/res/xml/devicesettings_pebble_developer.xml
Normal file
60
app/src/main/res/xml/devicesettings_pebble_developer.xml
Normal file
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/pref_header_development"
|
||||
app:iconSpaceReserved="false">
|
||||
<EditTextPreference
|
||||
android:defaultValue="512"
|
||||
android:inputType="number"
|
||||
android:key="pebble_mtu_limit"
|
||||
android:maxLength="3"
|
||||
android:summary="@string/pref_summary_pebble_mtu_limit"
|
||||
android:title="@string/pref_title_pebble_mtu_limit"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_force_untested"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_forceuntested"
|
||||
android:title="@string/pref_title_pebble_forceuntested"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_force_protocol"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_forceprotocol"
|
||||
android:title="@string/pref_title_pebble_forceprotocol"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_gatt_clientonly"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_gatt_clientonly"
|
||||
android:title="@string/pref_title_pebble_gatt_clientonly"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_enable_applogs"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_enable_applogs"
|
||||
android:title="@string/pref_title_pebble_enable_applogs"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_always_ack_pebblekit"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_always_ack_pebblekit"
|
||||
android:title="@string/pref_title_pebble_always_ack_pebblekit"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="pebble_force_untested"
|
||||
android:key="pebble_enable_background_javascript"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_enable_bgjs"
|
||||
android:title="@string/pref_title_pebble_enable_bgjs"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
</androidx.preference.PreferenceScreen>
|
@ -1,145 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<PreferenceCategory
|
||||
android:title="@string/pref_header_general"
|
||||
app:iconSpaceReserved="false">
|
||||
<ListPreference
|
||||
android:defaultValue="@string/p_pebble_privacy_mode_off"
|
||||
android:entries="@array/pebble_privacymode"
|
||||
android:entryValues="@array/pebble_privacymode_values"
|
||||
android:key="pebble_pref_privacy_mode"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_title_pebble_privacy_mode"
|
||||
app:iconSpaceReserved="false" />
|
||||
<!--
|
||||
<EditTextPreference
|
||||
android:defaultValue="12"
|
||||
android:inputType="number"
|
||||
android:key="pebble_reconnect_attempts"
|
||||
android:maxLength="4"
|
||||
android:title="@string/pref_title_pebble_reconnect_attempts"
|
||||
app:iconSpaceReserved="false"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
-->
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="pebble_enable_outgoing_call"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_enable_outgoing_call"
|
||||
android:title="@string/pref_title_enable_outgoing_call"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:title="@string/pref_header_pebble_timeline"
|
||||
app:iconSpaceReserved="false">
|
||||
<SwitchPreferenceCompat
|
||||
android:key="send_sunrise_sunset"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_sunrise_sunset"
|
||||
android:title="@string/pref_title_sunrise_sunset"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:title="@string/pref_header_activitytrackers"
|
||||
app:iconSpaceReserved="false">
|
||||
<ListPreference
|
||||
android:defaultValue="4"
|
||||
android:entries="@array/pebble_activitytracker"
|
||||
android:entryValues="@array/pebble_activitytracker_values"
|
||||
android:key="pebble_activitytracker"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_title_pebble_activitytracker"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="pebble_sync_health"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:title="@string/pref_title_pebble_sync_health"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:dependency="pebble_sync_health"
|
||||
android:key="pebble_health_store_raw"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_health_store_raw"
|
||||
android:title="@string/pref_title_pebble_health_store_raw"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="pebble_sync_misfit"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:title="@string/pref_title_pebble_sync_misfit"
|
||||
app:iconSpaceReserved="false" />>
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="pebble_sync_morpheuz"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:title="@string/pref_title_pebble_sync_morpheuz"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:title="@string/pref_header_development"
|
||||
app:iconSpaceReserved="false">
|
||||
<EditTextPreference
|
||||
android:defaultValue="512"
|
||||
android:inputType="number"
|
||||
android:key="pebble_mtu_limit"
|
||||
android:maxLength="3"
|
||||
android:summary="@string/pref_summary_pebble_mtu_limit"
|
||||
android:title="@string/pref_title_pebble_mtu_limit"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_force_untested"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_forceuntested"
|
||||
android:title="@string/pref_title_pebble_forceuntested"
|
||||
app:iconSpaceReserved="false" />
|
||||
<!--
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_force_le"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_forcele"
|
||||
android:title="@string/pref_title_pebble_forcele"
|
||||
app:iconSpaceReserved="false" />
|
||||
-->
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_force_protocol"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_forceprotocol"
|
||||
android:title="@string/pref_title_pebble_forceprotocol"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_gatt_clientonly"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_gatt_clientonly"
|
||||
android:title="@string/pref_title_pebble_gatt_clientonly"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_enable_applogs"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_enable_applogs"
|
||||
android:title="@string/pref_title_pebble_enable_applogs"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_always_ack_pebblekit"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_always_ack_pebblekit"
|
||||
android:title="@string/pref_title_pebble_always_ack_pebblekit"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="pebble_force_untested"
|
||||
android:key="pebble_enable_background_javascript"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_pebble_enable_bgjs"
|
||||
android:title="@string/pref_title_pebble_enable_bgjs"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
</androidx.preference.PreferenceScreen>
|
Loading…
Reference in New Issue
Block a user