mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-25 11:26:47 +01:00
Fossil/Skagen Hybrids: Show device specific settings in more logical order
This commit is contained in:
parent
f090898aef
commit
59dafc54b6
@ -242,20 +242,21 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
}
|
||||
//Settings applicable to all firmware versions
|
||||
int[] supportedSettings = new int[]{
|
||||
R.xml.devicesettings_fossilhybridhr,
|
||||
R.xml.devicesettings_inactivity,
|
||||
R.xml.devicesettings_fossilhybridhr_all_fw,
|
||||
R.xml.devicesettings_autoremove_notifications,
|
||||
R.xml.devicesettings_canned_dismisscall_16,
|
||||
R.xml.devicesettings_transliteration
|
||||
R.xml.devicesettings_transliteration,
|
||||
R.xml.devicesettings_fossilhybridhr_dev
|
||||
};
|
||||
//Firmware specific settings
|
||||
// Firmware version specific settings
|
||||
if (getFirmwareVersion() != null && getFirmwareVersion().smallerThan(new Version("3.0"))) {
|
||||
supportedSettings = ArrayUtils.insert(0, supportedSettings, R.xml.devicesettings_fossilhybridhr_buttonconfiguration_pre_fw30);
|
||||
supportedSettings = ArrayUtils.insert(0, supportedSettings, R.xml.devicesettings_fossilhybridhr_pre_fw300);
|
||||
} else {
|
||||
supportedSettings = ArrayUtils.insert(0, supportedSettings, R.xml.devicesettings_fossilhybridhr_buttonconfiguration);
|
||||
supportedSettings = ArrayUtils.insert(0, supportedSettings, R.xml.devicesettings_fossilhybridhr_post_fw300);
|
||||
}
|
||||
if (getFirmwareVersion() != null && getFirmwareVersion().smallerThan(new Version("2.20"))) {
|
||||
supportedSettings = ArrayUtils.insert(1, supportedSettings, R.xml.devicesettings_fossilhybridhr_pre_fw20);
|
||||
supportedSettings = ArrayUtils.insert(1, supportedSettings, R.xml.devicesettings_fossilhybridhr_pre_fw220);
|
||||
}
|
||||
return supportedSettings;
|
||||
}
|
||||
|
@ -114,15 +114,6 @@
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
<Preference
|
||||
android:title="@string/qhybrid_pref_title_actions"
|
||||
android:icon="@drawable/ic_pending_actions"
|
||||
android:summary="@string/qhybrid_pref_summary_actions">
|
||||
<intent
|
||||
android:targetPackage="@string/applicationId"
|
||||
android:targetClass="nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.CommuteActionsActivity" />
|
||||
</Preference>
|
||||
|
||||
<SeekBarPreference
|
||||
android:defaultValue="2"
|
||||
android:icon="@drawable/ic_vibration"
|
||||
@ -140,49 +131,4 @@
|
||||
android:targetClass="nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.CalibrationActivity" />
|
||||
</Preference>
|
||||
|
||||
<PreferenceScreen
|
||||
android:key="developer_settings"
|
||||
android:icon="@drawable/ic_developer_mode"
|
||||
android:title="@string/pref_title_developer_settings"
|
||||
android:summary="@string/pref_summary_developer_settings">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="save_raw_activity_files"
|
||||
android:title="@string/pref_qhybrid_save_raw_activity_files" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="dangerous_external_intents"
|
||||
android:title="@string/qhybrid_pref_title_external_intents"
|
||||
android:summary="@string/qhybrid_pref_summary_external_intents" />
|
||||
|
||||
<Preference
|
||||
android:title="@string/qhybrid_title_file_management"
|
||||
android:summary="@string/qhybrid_summary_file_management">
|
||||
<intent
|
||||
android:targetPackage="@string/applicationId"
|
||||
android:targetClass="nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.FileManagementActivity" />
|
||||
</Preference>
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="enable_on_device_confirmation"
|
||||
android:title="@string/qhybrid_title_on_device_confirmation"
|
||||
android:summary="@string/qhybrid_summary_on_device_confirmation" />
|
||||
|
||||
<EditTextPreference
|
||||
android:key="voice_service_package"
|
||||
android:title="@string/voice_service_package_title"
|
||||
android:summary="@string/voice_service_package_summary"
|
||||
app:useSimpleSummaryProvider="true"/>
|
||||
|
||||
<EditTextPreference
|
||||
android:key="voice_service_class"
|
||||
android:title="@string/voice_service_class_title"
|
||||
android:summary="@string/voice_service_class_summary"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
</androidx.preference.PreferenceScreen>
|
50
app/src/main/res/xml/devicesettings_fossilhybridhr_dev.xml
Normal file
50
app/src/main/res/xml/devicesettings_fossilhybridhr_dev.xml
Normal file
@ -0,0 +1,50 @@
|
||||
<?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">
|
||||
|
||||
<PreferenceScreen
|
||||
android:key="developer_settings"
|
||||
android:icon="@drawable/ic_developer_mode"
|
||||
android:title="@string/pref_title_developer_settings"
|
||||
android:summary="@string/pref_summary_developer_settings">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="save_raw_activity_files"
|
||||
android:title="@string/pref_qhybrid_save_raw_activity_files" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="dangerous_external_intents"
|
||||
android:title="@string/qhybrid_pref_title_external_intents"
|
||||
android:summary="@string/qhybrid_pref_summary_external_intents" />
|
||||
|
||||
<Preference
|
||||
android:title="@string/qhybrid_title_file_management"
|
||||
android:summary="@string/qhybrid_summary_file_management">
|
||||
<intent
|
||||
android:targetPackage="@string/applicationId"
|
||||
android:targetClass="nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.FileManagementActivity" />
|
||||
</Preference>
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="enable_on_device_confirmation"
|
||||
android:title="@string/qhybrid_title_on_device_confirmation"
|
||||
android:summary="@string/qhybrid_summary_on_device_confirmation" />
|
||||
|
||||
<EditTextPreference
|
||||
android:key="voice_service_package"
|
||||
android:title="@string/voice_service_package_title"
|
||||
android:summary="@string/voice_service_package_summary"
|
||||
app:useSimpleSummaryProvider="true"/>
|
||||
|
||||
<EditTextPreference
|
||||
android:key="voice_service_class"
|
||||
android:title="@string/voice_service_class_title"
|
||||
android:summary="@string/voice_service_class_summary"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
</androidx.preference.PreferenceScreen>
|
@ -54,5 +54,14 @@
|
||||
android:key="button_1_function_long_warning"
|
||||
android:summary="@string/fossil_hr_button_config_info" />
|
||||
</PreferenceScreen>
|
||||
|
||||
|
||||
<Preference
|
||||
android:title="@string/qhybrid_pref_title_actions"
|
||||
android:icon="@drawable/ic_pending_actions"
|
||||
android:summary="@string/qhybrid_pref_summary_actions">
|
||||
<intent
|
||||
android:targetPackage="@string/applicationId"
|
||||
android:targetClass="nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.CommuteActionsActivity" />
|
||||
</Preference>
|
||||
|
||||
</androidx.preference.PreferenceScreen>
|
Loading…
Reference in New Issue
Block a user