mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-06-14 09:00:04 +02:00
[Huawei] Rework settings menu with sub-screens
This commit is contained in:
parent
c63fa19550
commit
23c39280c7
|
@ -31,6 +31,7 @@ import java.util.List;
|
||||||
|
|
||||||
import de.greenrobot.dao.query.QueryBuilder;
|
import de.greenrobot.dao.query.QueryBuilder;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettings;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
|
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLClassicDeviceCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLClassicDeviceCoordinator;
|
||||||
|
@ -76,7 +77,12 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
||||||
public Class<? extends Activity> getPairingActivity() {
|
public Class<? extends Activity> getPairingActivity() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getSupportedLanguageSettings(GBDevice device) {
|
||||||
|
return huaweiCoordinator.getSupportedLanguageSettings(device);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBondingStyle(){
|
public int getBondingStyle(){
|
||||||
return BONDING_STYLE_ASK;
|
return BONDING_STYLE_ASK;
|
||||||
|
@ -193,7 +199,7 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsMusicInfo() {
|
public boolean supportsMusicInfo() {
|
||||||
return getHuaweiCoordinator().supportsMusic();
|
return huaweiCoordinator.supportsMusic();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -206,8 +212,8 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
||||||
return new HuaweiSampleProvider(device, session);
|
return new HuaweiSampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
public DeviceSpecificSettings getDeviceSpecificSettings(final GBDevice device) {
|
||||||
return new int[]{};
|
return huaweiCoordinator.getDeviceSpecificSettings(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -30,6 +30,8 @@ import org.slf4j.Logger;
|
||||||
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettings;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsScreen;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.packets.Notifications.NotificationConstraintsType;
|
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.packets.Notifications.NotificationConstraintsType;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||||
|
@ -177,36 +179,59 @@ public class HuaweiCoordinator {
|
||||||
return notificationConstraints.get(which);
|
return notificationConstraints.get(which);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] genericHuaweiSupportedDeviceSpecificSettings(int[] additionalDeviceSpecificSettings) {
|
public DeviceSpecificSettings getDeviceSpecificSettings(final GBDevice device) {
|
||||||
// Add all settings in the default table
|
final DeviceSpecificSettings deviceSpecificSettings = new DeviceSpecificSettings();
|
||||||
// Hide / show table in HuaweiSettingsCustommizer
|
|
||||||
List<Integer> dynamicSupportedDeviceSpecificSettings = new ArrayList<>();
|
|
||||||
|
|
||||||
// Could be limited to 0x04 0x01, but I don't know if that'll work properly
|
// Health
|
||||||
dynamicSupportedDeviceSpecificSettings.add(R.xml.devicesettings_allow_accept_reject_calls);
|
if (supportsInactivityWarnings())
|
||||||
|
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.HEALTH, R.xml.devicesettings_inactivity_sheduled);
|
||||||
|
if (supportsTruSleep())
|
||||||
|
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.HEALTH, R.xml.devicesettings_trusleep);
|
||||||
|
if (supportsHeartRate())
|
||||||
|
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.HEALTH, R.xml.devicesettings_heartrate_automatic_enable);
|
||||||
|
if (supportsSPo2())
|
||||||
|
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.HEALTH, R.xml.devicesettings_spo_automatic_enable);
|
||||||
|
|
||||||
// Only supported on specific devices
|
// Notifications
|
||||||
dynamicSupportedDeviceSpecificSettings.add(R.xml.devicesettings_huawei);
|
final List<Integer> notifications = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.NOTIFICATIONS);
|
||||||
dynamicSupportedDeviceSpecificSettings.add(R.xml.devicesettings_trusleep);
|
notifications.add(R.xml.devicesettings_notifications_enable);
|
||||||
dynamicSupportedDeviceSpecificSettings.add(R.xml.devicesettings_wearlocation);
|
if (supportsNotificationOnBluetoothLoss())
|
||||||
dynamicSupportedDeviceSpecificSettings.add(R.xml.devicesettings_dateformat);
|
notifications.add(R.xml.devicesettings_disconnectnotification_noshed);
|
||||||
dynamicSupportedDeviceSpecificSettings.add(R.xml.devicesettings_timeformat);
|
if (supportsDoNotDisturb(device))
|
||||||
dynamicSupportedDeviceSpecificSettings.add(R.xml.devicesettings_workmode);
|
notifications.add(R.xml.devicesettings_donotdisturb_allday_liftwirst_notwear);
|
||||||
dynamicSupportedDeviceSpecificSettings.add(R.xml.devicesettings_liftwrist_display_noshed);
|
|
||||||
dynamicSupportedDeviceSpecificSettings.add(R.xml.devicesettings_rotatewrist_cycleinfo);
|
|
||||||
|
|
||||||
int size = dynamicSupportedDeviceSpecificSettings.size();
|
// Workout
|
||||||
if (additionalDeviceSpecificSettings != null)
|
|
||||||
size += additionalDeviceSpecificSettings.length;
|
|
||||||
int[] result = new int[size];
|
|
||||||
|
|
||||||
for (int i = 0; i < dynamicSupportedDeviceSpecificSettings.size(); i++)
|
// Other
|
||||||
result[i] = dynamicSupportedDeviceSpecificSettings.get(i);
|
deviceSpecificSettings.addRootScreen(R.xml.devicesettings_find_phone);
|
||||||
|
deviceSpecificSettings.addRootScreen(R.xml.devicesettings_disable_find_phone_with_dnd);
|
||||||
|
deviceSpecificSettings.addRootScreen(R.xml.devicesettings_allow_accept_reject_calls);
|
||||||
|
|
||||||
if (additionalDeviceSpecificSettings != null)
|
// Time
|
||||||
System.arraycopy(additionalDeviceSpecificSettings, 0, result, dynamicSupportedDeviceSpecificSettings.size(), additionalDeviceSpecificSettings.length);
|
if (supportsDateFormat()) {
|
||||||
|
final List<Integer> dateTime = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.DATE_TIME);
|
||||||
|
dateTime.add(R.xml.devicesettings_dateformat);
|
||||||
|
dateTime.add(R.xml.devicesettings_timeformat);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
// Display
|
||||||
|
if (supportsWearLocation(device))
|
||||||
|
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.DISPLAY, R.xml.devicesettings_wearlocation);
|
||||||
|
if (supportsAutoWorkMode())
|
||||||
|
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.DISPLAY, R.xml.devicesettings_workmode);
|
||||||
|
if (supportsActivateOnLift())
|
||||||
|
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.DISPLAY, R.xml.devicesettings_liftwrist_display_noshed);
|
||||||
|
if (supportsRotateToCycleInfo())
|
||||||
|
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.DISPLAY, R.xml.devicesettings_rotatewrist_cycleinfo);
|
||||||
|
// Currently on main setting menu.
|
||||||
|
/*if (supportsLanguageSetting())
|
||||||
|
deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.DISPLAY, R.xml.devicesettings_language_generic);*/
|
||||||
|
|
||||||
|
// Developer
|
||||||
|
final List<Integer> developer = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.DEVELOPER);
|
||||||
|
developer.add(R.xml.devicesettings_huawei_debug);
|
||||||
|
|
||||||
|
return deviceSpecificSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean supportsDateFormat() {
|
public boolean supportsDateFormat() {
|
||||||
|
@ -301,6 +326,10 @@ public class HuaweiCoordinator {
|
||||||
return supportsCommandForService(0x07, 0x23);
|
return supportsCommandForService(0x07, 0x23);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean supportsSPo2() {
|
||||||
|
return supportsCommandForService(0x07, 0x24);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean supportsFitnessThresholdValue() {
|
public boolean supportsFitnessThresholdValue() {
|
||||||
return supportsCommandForService(0x07, 0x29);
|
return supportsCommandForService(0x07, 0x29);
|
||||||
}
|
}
|
||||||
|
@ -476,4 +505,21 @@ public class HuaweiCoordinator {
|
||||||
public boolean isTransactionCrypted() {
|
public boolean isTransactionCrypted() {
|
||||||
return this.transactionCrypted;
|
return this.transactionCrypted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String[] getSupportedLanguageSettings(GBDevice device) {
|
||||||
|
return new String[]{
|
||||||
|
"auto",
|
||||||
|
"cs_CZ",
|
||||||
|
"de_DE",
|
||||||
|
"en_US",
|
||||||
|
"es_ES",
|
||||||
|
"fr_FR",
|
||||||
|
"it_IT",
|
||||||
|
"pt_BR",
|
||||||
|
"ru_RU",
|
||||||
|
"tr_TR",
|
||||||
|
"zh_CN",
|
||||||
|
"zh_TW",
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import de.greenrobot.dao.query.QueryBuilder;
|
import de.greenrobot.dao.query.QueryBuilder;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettings;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
|
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||||
|
@ -76,6 +77,11 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
||||||
public Class<? extends Activity> getPairingActivity() {
|
public Class<? extends Activity> getPairingActivity() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getSupportedLanguageSettings(GBDevice device) {
|
||||||
|
return huaweiCoordinator.getSupportedLanguageSettings(device);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBondingStyle(){
|
public int getBondingStyle(){
|
||||||
|
@ -193,7 +199,7 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsMusicInfo() {
|
public boolean supportsMusicInfo() {
|
||||||
return getHuaweiCoordinator().supportsMusic();
|
return huaweiCoordinator.supportsMusic();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -206,8 +212,8 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
||||||
return new HuaweiSampleProvider(device, session);
|
return new HuaweiSampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
public DeviceSpecificSettings getDeviceSpecificSettings(final GBDevice device) {
|
||||||
return new int[]{};
|
return huaweiCoordinator.getDeviceSpecificSettings(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -112,77 +112,6 @@ public class HuaweiSettingsCustomizer implements DeviceSpecificSettingsCustomize
|
||||||
handler.addPreferenceHandlerFor(PREF_HUAWEI_TRUSLEEP);
|
handler.addPreferenceHandlerFor(PREF_HUAWEI_TRUSLEEP);
|
||||||
handler.addPreferenceHandlerFor(PREF_HUAWEI_DEBUG_REQUEST);
|
handler.addPreferenceHandlerFor(PREF_HUAWEI_DEBUG_REQUEST);
|
||||||
|
|
||||||
// Only supported on specific devices
|
|
||||||
final ListPreference languageSetting = handler.findPreference(PREF_LANGUAGE);
|
|
||||||
if (languageSetting != null) {
|
|
||||||
languageSetting.setVisible(false);
|
|
||||||
if (this.coordinator.supportsLanguageSetting())
|
|
||||||
languageSetting.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
final Preference dnd = handler.findPreference("screen_do_not_disturb");
|
|
||||||
if (dnd != null) {
|
|
||||||
dnd.setVisible(false);
|
|
||||||
if (this.coordinator.supportsDoNotDisturb(handler.getDevice()))
|
|
||||||
dnd.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
final Preference trusleep = handler.findPreference(PREF_HUAWEI_TRUSLEEP);
|
|
||||||
if (trusleep != null) {
|
|
||||||
trusleep.setVisible(false);
|
|
||||||
if (this.coordinator.supportsTruSleep())
|
|
||||||
trusleep.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if (this.coordinator.supportsHeartRate())
|
|
||||||
// dynamicSupportedDeviceSpecificSettings.add(R.xml.devicesettings_heartrate_automatic_enable);
|
|
||||||
|
|
||||||
final Preference inactivity = handler.findPreference("screen_inactivity");
|
|
||||||
if (inactivity != null) {
|
|
||||||
inactivity.setVisible(false);
|
|
||||||
if (this.coordinator.supportsInactivityWarnings())
|
|
||||||
inactivity.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
final ListPreference wearLocation = handler.findPreference(PREF_WEARLOCATION);
|
|
||||||
if (wearLocation != null) {
|
|
||||||
wearLocation.setVisible(false);
|
|
||||||
if (this.coordinator.supportsWearLocation(handler.getDevice()))
|
|
||||||
wearLocation.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
final ListPreference date = handler.findPreference(PREF_DATEFORMAT);
|
|
||||||
final ListPreference time = handler.findPreference(PREF_TIMEFORMAT);
|
|
||||||
if (date != null) {
|
|
||||||
date.setVisible(false);
|
|
||||||
time.setVisible(false);
|
|
||||||
if (this.coordinator.supportsDateFormat()) {
|
|
||||||
date.setVisible(true);
|
|
||||||
time.setVisible(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final ListPreference workmode = handler.findPreference(PREF_HUAWEI_WORKMODE);
|
|
||||||
if (workmode != null) {
|
|
||||||
workmode.setVisible(false);
|
|
||||||
if (this.coordinator.supportsAutoWorkMode())
|
|
||||||
workmode.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
final SwitchPreferenceCompat liftwirst = handler.findPreference(PREF_LIFTWRIST_NOSHED);
|
|
||||||
if (liftwirst != null) {
|
|
||||||
liftwirst.setVisible(false);
|
|
||||||
if (this.coordinator.supportsActivateOnLift())
|
|
||||||
liftwirst.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
final SwitchPreferenceCompat rotatewirst = handler.findPreference(PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO);
|
|
||||||
if (rotatewirst != null) {
|
|
||||||
rotatewirst.setVisible(false);
|
|
||||||
if (this.coordinator.supportsRotateToCycleInfo())
|
|
||||||
rotatewirst.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
final Preference forceOptions = handler.findPreference(PREF_FORCE_OPTIONS);
|
final Preference forceOptions = handler.findPreference(PREF_FORCE_OPTIONS);
|
||||||
if (forceOptions != null) {
|
if (forceOptions != null) {
|
||||||
forceOptions.setVisible(false);
|
forceOptions.setVisible(false);
|
||||||
|
@ -203,13 +132,6 @@ public class HuaweiSettingsCustomizer implements DeviceSpecificSettingsCustomize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final SwitchPreferenceCompat disconnectNotification = handler.findPreference(PREF_DISCONNECTNOTIF_NOSHED);
|
|
||||||
if (disconnectNotification != null) {
|
|
||||||
disconnectNotification.setVisible(false);
|
|
||||||
if (this.coordinator.supportsNotificationOnBluetoothLoss())
|
|
||||||
disconnectNotification.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
final SwitchPreferenceCompat reparseWorkout = handler.findPreference("huawei_reparse_workout_data");
|
final SwitchPreferenceCompat reparseWorkout = handler.findPreference("huawei_reparse_workout_data");
|
||||||
if (reparseWorkout != null) {
|
if (reparseWorkout != null) {
|
||||||
reparseWorkout.setVisible(false);
|
reparseWorkout.setVisible(false);
|
||||||
|
|
|
@ -51,15 +51,6 @@ public class HonorBand3Coordinator extends HuaweiLECoordinator {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_honor_band3;
|
return R.string.devicetype_honor_band3;
|
||||||
|
|
|
@ -50,14 +50,6 @@ public class HonorBand4Coordinator extends HuaweiLECoordinator {
|
||||||
return Pattern.compile(HuaweiConstants.HO_BAND4_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HO_BAND4_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_honor_band4;
|
return R.string.devicetype_honor_band4;
|
||||||
|
|
|
@ -65,16 +65,6 @@ public class HonorBand5Coordinator extends HuaweiLECoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_honor_band5;
|
return R.string.devicetype_honor_band5;
|
||||||
|
|
|
@ -60,16 +60,6 @@ public class HonorBand6Coordinator extends HuaweiLECoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_honor_band6;
|
return R.string.devicetype_honor_band6;
|
||||||
|
|
|
@ -60,16 +60,6 @@ public class HonorBand7Coordinator extends HuaweiLECoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_honor_band7;
|
return R.string.devicetype_honor_band7;
|
||||||
|
|
|
@ -64,13 +64,6 @@ public class HonorMagicWatch2Coordinator extends HuaweiBRCoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_honor_magicwatch2;
|
return R.string.devicetype_honor_magicwatch2;
|
||||||
|
|
|
@ -60,16 +60,6 @@ public class HuaweiBand4ProCoordinator extends HuaweiLECoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_band4pro;
|
return R.string.devicetype_huawei_band4pro;
|
||||||
|
|
|
@ -60,16 +60,6 @@ public class HuaweiBand6Coordinator extends HuaweiLECoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_band6;
|
return R.string.devicetype_huawei_band6;
|
||||||
|
|
|
@ -60,16 +60,6 @@ public class HuaweiBand7Coordinator extends HuaweiLECoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_band7;
|
return R.string.devicetype_huawei_band7;
|
||||||
|
|
|
@ -60,16 +60,6 @@ public class HuaweiBand8Coordinator extends HuaweiLECoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_band8;
|
return R.string.devicetype_huawei_band8;
|
||||||
|
|
|
@ -41,14 +41,6 @@ public class HuaweiBandAw70Coordinator extends HuaweiLECoordinator {
|
||||||
return Pattern.compile("(" + HuaweiConstants.HU_BAND3E_NAME + "|" + HuaweiConstants.HU_BAND4E_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile("(" + HuaweiConstants.HU_BAND3E_NAME + "|" + HuaweiConstants.HU_BAND4E_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_band_aw70;
|
return R.string.devicetype_huawei_band_aw70;
|
||||||
|
|
|
@ -46,11 +46,6 @@ public class HuaweiTalkBandB6Coordinator extends HuaweiBRCoordinator {
|
||||||
return Pattern.compile(HuaweiConstants.HU_TALKBANDB6_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HU_TALKBANDB6_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_talk_band_b6;
|
return R.string.devicetype_huawei_talk_band_b6;
|
||||||
|
|
|
@ -59,16 +59,6 @@ public class HuaweiWatchFitCoordinator extends HuaweiLECoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_watchfit;
|
return R.string.devicetype_huawei_watchfit;
|
||||||
|
|
|
@ -60,16 +60,6 @@ public class HuaweiWatchGTCoordinator extends HuaweiLECoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_watch_gt;
|
return R.string.devicetype_huawei_watch_gt;
|
||||||
|
|
|
@ -59,13 +59,6 @@ public class HuaweiWatchGT2Coordinator extends HuaweiBRCoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_watchgt2;
|
return R.string.devicetype_huawei_watchgt2;
|
||||||
|
|
|
@ -64,16 +64,6 @@ public class HuaweiWatchGT2eCoordinator extends HuaweiLECoordinator {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_watchgt2e;
|
return R.string.devicetype_huawei_watchgt2e;
|
||||||
|
|
|
@ -45,16 +45,6 @@ public class HuaweiWatchGT3Coordinator extends HuaweiBRCoordinator {
|
||||||
return Pattern.compile("(" + HuaweiConstants.HU_WATCHGT3_NAME + "|" + HuaweiConstants.HU_WATCHGT3PRO_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile("(" + HuaweiConstants.HU_WATCHGT3_NAME + "|" + HuaweiConstants.HU_WATCHGT3PRO_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_watchgt3;
|
return R.string.devicetype_huawei_watchgt3;
|
||||||
|
|
|
@ -46,16 +46,6 @@ public class HuaweiWatchGT4Coordinator extends HuaweiBRCoordinator {
|
||||||
return Pattern.compile("(" + HuaweiConstants.HU_WATCHGT4_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile("(" + HuaweiConstants.HU_WATCHGT4_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_watchgt4;
|
return R.string.devicetype_huawei_watchgt4;
|
||||||
|
|
|
@ -45,16 +45,6 @@ public class HuaweiWatchUltimateCoordinator extends HuaweiBRCoordinator {
|
||||||
return Pattern.compile("(" + HuaweiConstants.HU_WATCHULTIMATE_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile("(" + HuaweiConstants.HU_WATCHULTIMATE_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
||||||
return getHuaweiCoordinator().genericHuaweiSupportedDeviceSpecificSettings(new int[]{
|
|
||||||
R.xml.devicesettings_heartrate_automatic_enable,
|
|
||||||
R.xml.devicesettings_spo_automatic_enable,
|
|
||||||
R.xml.devicesettings_find_phone,
|
|
||||||
R.xml.devicesettings_disable_find_phone_with_dnd,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeviceNameResource() {
|
public int getDeviceNameResource() {
|
||||||
return R.string.devicetype_huawei_watchultimate;
|
return R.string.devicetype_huawei_watchultimate;
|
||||||
|
|
|
@ -5,5 +5,6 @@
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="disconnect_notification_noshed"
|
android:key="disconnect_notification_noshed"
|
||||||
android:layout="@layout/preference_checkbox"
|
android:layout="@layout/preference_checkbox"
|
||||||
android:title="@string/prefs_disconnect_notification" />
|
android:title="@string/prefs_disconnect_notification"
|
||||||
|
android:summary="@string/prefs_disconnect_notification_summary"/>
|
||||||
</androidx.preference.PreferenceScreen>
|
</androidx.preference.PreferenceScreen>
|
|
@ -0,0 +1,78 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<PreferenceScreen
|
||||||
|
android:icon="@drawable/ic_block"
|
||||||
|
android:key="screen_do_not_disturb"
|
||||||
|
android:persistent="false"
|
||||||
|
android:summary="@string/mi2_prefs_do_not_disturb_summary"
|
||||||
|
android:title="@string/mi2_prefs_do_not_disturb">
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="@string/p_off"
|
||||||
|
android:entries="@array/do_not_disturb_allday"
|
||||||
|
android:entryValues="@array/mi2_do_not_disturb_values"
|
||||||
|
android:key="do_not_disturb"
|
||||||
|
android:summary="%s"
|
||||||
|
android:title="@string/mi2_prefs_do_not_disturb" />
|
||||||
|
|
||||||
|
<nodomain.freeyourgadget.gadgetbridge.util.XTimePreference
|
||||||
|
android:defaultValue="00:00"
|
||||||
|
android:key="do_not_disturb_start"
|
||||||
|
android:title="@string/mi2_prefs_do_not_disturb_start" />
|
||||||
|
|
||||||
|
<nodomain.freeyourgadget.gadgetbridge.util.XTimePreference
|
||||||
|
android:defaultValue="23:59"
|
||||||
|
android:key="do_not_disturb_end"
|
||||||
|
android:title="@string/mi2_prefs_do_not_disturb_end" />
|
||||||
|
|
||||||
|
<SwitchPreferenceCompat
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:icon="@drawable/ic_arrow_upward"
|
||||||
|
android:key="do_not_disturb_lift_wrist"
|
||||||
|
android:layout="@layout/preference_checkbox"
|
||||||
|
android:title="@string/mi2_prefs_do_not_disturb_lift_wrist"
|
||||||
|
android:summary="@string/do_not_disturb_lift_wrist_summary"/>
|
||||||
|
|
||||||
|
<SwitchPreferenceCompat
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:icon="@drawable/ic_notification_disconnected"
|
||||||
|
android:key="do_not_disturb_not_wear"
|
||||||
|
android:layout="@layout/preference_checkbox"
|
||||||
|
android:title="@string/pref_do_not_disturb_not_wear" />
|
||||||
|
|
||||||
|
<!-- workaround for missing toolbar -->
|
||||||
|
<PreferenceCategory android:title="@string/zetime_prefs_inactivity_repetitions">
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="pref_do_not_disturb_mo"
|
||||||
|
android:title="@string/zetime_prefs_inactivity_mo" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="pref_do_not_disturb_tu"
|
||||||
|
android:title="@string/zetime_prefs_inactivity_tu" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="pref_do_not_disturb_we"
|
||||||
|
android:title="@string/zetime_prefs_inactivity_we" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="pref_do_not_disturb_th"
|
||||||
|
android:title="@string/zetime_prefs_inactivity_th" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="pref_do_not_disturb_fr"
|
||||||
|
android:title="@string/zetime_prefs_inactivity_fr" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="pref_do_not_disturb_sa"
|
||||||
|
android:title="@string/zetime_prefs_inactivity_sa" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="pref_do_not_disturb_su"
|
||||||
|
android:title="@string/zetime_prefs_inactivity_su" />
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.preference.PreferenceScreen>
|
|
@ -1,252 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<PreferenceScreen
|
|
||||||
android:icon="@drawable/ic_notifications"
|
|
||||||
android:key="screen_notification"
|
|
||||||
android:persistent="false"
|
|
||||||
android:title="@string/menuitem_notifications">
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:icon="@drawable/ic_notifications"
|
|
||||||
android:key="notification_enable"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="@string/prefs_notifications_enable"
|
|
||||||
android:summary="@string/enable_notifications_summary"/>
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:icon="@drawable/ic_signal_cellular_connected_no_internet_4_bar"
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="disconnect_notification_noshed"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="@string/prefs_disconnect_notification"
|
|
||||||
android:summary="@string/prefs_disconnect_notification_summary"/>
|
|
||||||
|
|
||||||
<PreferenceScreen
|
|
||||||
android:icon="@drawable/ic_chair"
|
|
||||||
android:key="screen_inactivity"
|
|
||||||
android:persistent="false"
|
|
||||||
android:summary="@string/mi2_prefs_inactivity_warnings_summary"
|
|
||||||
android:title="@string/mi2_prefs_inactivity_warnings">
|
|
||||||
|
|
||||||
<!-- workaround for missing toolbar -->
|
|
||||||
<PreferenceCategory android:title="@string/mi2_prefs_inactivity_warnings" />
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="inactivity_warnings_enable"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="@string/mi2_prefs_inactivity_warnings"
|
|
||||||
android:summary="@string/mi2_prefs_inactivity_warnings_summary" />
|
|
||||||
|
|
||||||
<EditTextPreference
|
|
||||||
android:defaultValue="60"
|
|
||||||
android:dependency="inactivity_warnings_enable"
|
|
||||||
android:key="inactivity_warnings_threshold"
|
|
||||||
android:inputType="numberSigned"
|
|
||||||
android:maxLength="3"
|
|
||||||
android:title="@string/mi2_prefs_inactivity_warnings_threshold"/>
|
|
||||||
|
|
||||||
<nodomain.freeyourgadget.gadgetbridge.util.XTimePreference
|
|
||||||
android:defaultValue="06:00"
|
|
||||||
android:dependency="inactivity_warnings_enable"
|
|
||||||
android:key="inactivity_warnings_start"
|
|
||||||
android:title="@string/mi2_prefs_do_not_disturb_start" />
|
|
||||||
|
|
||||||
<nodomain.freeyourgadget.gadgetbridge.util.XTimePreference
|
|
||||||
android:defaultValue="23:00"
|
|
||||||
android:dependency="inactivity_warnings_enable"
|
|
||||||
android:key="inactivity_warnings_end"
|
|
||||||
android:title="@string/mi2_prefs_do_not_disturb_end" />
|
|
||||||
|
|
||||||
<!-- workaround for missing toolbar -->
|
|
||||||
<PreferenceCategory android:title="@string/zetime_prefs_inactivity_repetitions"
|
|
||||||
android:dependency="inactivity_warnings_enable">
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="inactivity_warnings_mo"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_mo" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="inactivity_warnings_tu"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_tu" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="inactivity_warnings_we"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_we" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="inactivity_warnings_th"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_th" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="inactivity_warnings_fr"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_fr" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="inactivity_warnings_sa"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_sa" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="inactivity_warnings_su"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_su" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
</PreferenceScreen>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
||||||
|
|
||||||
<PreferenceScreen
|
|
||||||
android:icon="@drawable/ic_block"
|
|
||||||
android:key="screen_do_not_disturb"
|
|
||||||
android:persistent="false"
|
|
||||||
android:title="@string/mi2_prefs_do_not_disturb">
|
|
||||||
|
|
||||||
<!-- workaround for missing toolbar -->
|
|
||||||
<!--PreferenceCategory
|
|
||||||
android:title="@string/mi2_prefs_do_not_disturb"
|
|
||||||
android:summary="@string/mi2_prefs_do_not_disturb_summary"/-->
|
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:defaultValue="@string/p_off"
|
|
||||||
android:entries="@array/do_not_disturb_allday"
|
|
||||||
android:entryValues="@array/mi2_do_not_disturb_values"
|
|
||||||
android:key="do_not_disturb"
|
|
||||||
android:summary="%s"
|
|
||||||
android:title="@string/mi2_prefs_do_not_disturb" />
|
|
||||||
|
|
||||||
<nodomain.freeyourgadget.gadgetbridge.util.XTimePreference
|
|
||||||
android:defaultValue="00:00"
|
|
||||||
android:key="do_not_disturb_start"
|
|
||||||
android:title="@string/mi2_prefs_do_not_disturb_start" />
|
|
||||||
|
|
||||||
<nodomain.freeyourgadget.gadgetbridge.util.XTimePreference
|
|
||||||
android:defaultValue="23:59"
|
|
||||||
android:key="do_not_disturb_end"
|
|
||||||
android:title="@string/mi2_prefs_do_not_disturb_end" />
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:icon="@drawable/ic_arrow_upward"
|
|
||||||
android:key="do_not_disturb_lift_wrist"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="@string/mi2_prefs_do_not_disturb_lift_wrist"
|
|
||||||
android:summary="@string/do_not_disturb_lift_wrist_summary"/>
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:icon="@drawable/ic_notification_disconnected"
|
|
||||||
android:key="do_not_disturb_not_wear"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="@string/pref_do_not_disturb_not_wear" />
|
|
||||||
|
|
||||||
<!-- workaround for missing toolbar -->
|
|
||||||
<PreferenceCategory android:title="@string/zetime_prefs_inactivity_repetitions">
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="pref_do_not_disturb_mo"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_mo" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="pref_do_not_disturb_tu"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_tu" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="pref_do_not_disturb_we"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_we" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="pref_do_not_disturb_th"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_th" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="pref_do_not_disturb_fr"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_fr" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="pref_do_not_disturb_sa"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_sa" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="pref_do_not_disturb_su"
|
|
||||||
android:title="@string/zetime_prefs_inactivity_su" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
||||||
|
|
||||||
<PreferenceScreen
|
|
||||||
android:icon="@drawable/ic_warning"
|
|
||||||
android:key="debug_huawei"
|
|
||||||
android:persistent="false"
|
|
||||||
android:title="@string/title_activity_debug">
|
|
||||||
|
|
||||||
<EditTextPreference
|
|
||||||
android:icon="@drawable/ic_warning"
|
|
||||||
android:key="debug_huawei_request"
|
|
||||||
android:maxLength="16"
|
|
||||||
android:summary="@string/pref_summary_debug"
|
|
||||||
android:title="@string/pref_title_debug" />
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="huawei_reparse_workout_data"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="Reparse workout data"
|
|
||||||
android:summary="This will only do something after certain updates" />
|
|
||||||
|
|
||||||
<PreferenceCategory
|
|
||||||
android:icon="@drawable/ic_settings"
|
|
||||||
android:key="pref_force_options"
|
|
||||||
android:title="@string/pref_force_options"
|
|
||||||
android:summary="@string/pref_force_options_summary">
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:icon="@drawable/ic_access_time"
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_force_enable_smart_alarm"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="@string/pref_force_smart_alarm"
|
|
||||||
android:summary="@string/pref_force_smart_alarm_summary"/>
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:icon="@drawable/ic_switch_left"
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_force_enable_wear_location"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="@string/pref_force_wear_location"
|
|
||||||
android:summary="@string/pref_force_wear_location_summary" />
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:icon="@drawable/ic_block"
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_force_dnd_support"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="@string/pref_force_dnd_support"
|
|
||||||
android:summary="@string/pref_force_dnd_support_summary" />
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:icon="@drawable/ic_activity_sleep"
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_force_ignore_wakeup_status_start"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="@string/huawei_ignore_wakeup_status_start"
|
|
||||||
android:summary="@string/huawei_ignore_wakeup_status_start_description"/>
|
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
|
||||||
android:icon="@drawable/ic_activity_sleep"
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_force_ignore_wakeup_status_end"
|
|
||||||
android:layout="@layout/preference_checkbox"
|
|
||||||
android:title="@string/huawei_ignore_wakeup_status_end"
|
|
||||||
android:summary="@string/huawei_ignore_wakeup_status_end_description"/>
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
||||||
<ListPreference
|
|
||||||
android:icon="@drawable/ic_language"
|
|
||||||
android:defaultValue="auto"
|
|
||||||
android:entries="@array/pref_amazfitbip_language"
|
|
||||||
android:entryValues="@array/pref_amazfitbip_language_values"
|
|
||||||
android:key="language"
|
|
||||||
android:summary="%s"
|
|
||||||
android:title="@string/pref_title_language" />
|
|
||||||
</androidx.preference.PreferenceScreen>
|
|
67
app/src/main/res/xml/devicesettings_huawei_debug.xml
Normal file
67
app/src/main/res/xml/devicesettings_huawei_debug.xml
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<EditTextPreference
|
||||||
|
android:icon="@drawable/ic_warning"
|
||||||
|
android:key="debug_huawei_request"
|
||||||
|
android:maxLength="16"
|
||||||
|
android:summary="@string/pref_summary_debug"
|
||||||
|
android:title="@string/pref_title_debug" />
|
||||||
|
|
||||||
|
<SwitchPreferenceCompat
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="huawei_reparse_workout_data"
|
||||||
|
android:layout="@layout/preference_checkbox"
|
||||||
|
android:title="Reparse workout data"
|
||||||
|
android:summary="This will only do something after certain updates" />
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:key="pref_force_options"
|
||||||
|
android:title="@string/pref_force_options">
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:icon="@drawable/ic_settings"
|
||||||
|
android:summary="@string/pref_force_options_summary"/>
|
||||||
|
|
||||||
|
<SwitchPreferenceCompat
|
||||||
|
android:icon="@drawable/ic_access_time"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="pref_force_enable_smart_alarm"
|
||||||
|
android:layout="@layout/preference_checkbox"
|
||||||
|
android:title="@string/pref_force_smart_alarm"
|
||||||
|
android:summary="@string/pref_force_smart_alarm_summary"/>
|
||||||
|
|
||||||
|
<SwitchPreferenceCompat
|
||||||
|
android:icon="@drawable/ic_switch_left"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="pref_force_enable_wear_location"
|
||||||
|
android:layout="@layout/preference_checkbox"
|
||||||
|
android:title="@string/pref_force_wear_location"
|
||||||
|
android:summary="@string/pref_force_wear_location_summary" />
|
||||||
|
|
||||||
|
<SwitchPreferenceCompat
|
||||||
|
android:icon="@drawable/ic_block"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="pref_force_dnd_support"
|
||||||
|
android:layout="@layout/preference_checkbox"
|
||||||
|
android:title="@string/pref_force_dnd_support"
|
||||||
|
android:summary="@string/pref_force_dnd_support_summary" />
|
||||||
|
|
||||||
|
<SwitchPreferenceCompat
|
||||||
|
android:icon="@drawable/ic_activity_sleep"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="pref_force_ignore_wakeup_status_start"
|
||||||
|
android:layout="@layout/preference_checkbox"
|
||||||
|
android:title="@string/huawei_ignore_wakeup_status_start"
|
||||||
|
android:summary="@string/huawei_ignore_wakeup_status_start_description"/>
|
||||||
|
|
||||||
|
<SwitchPreferenceCompat
|
||||||
|
android:icon="@drawable/ic_activity_sleep"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="pref_force_ignore_wakeup_status_end"
|
||||||
|
android:layout="@layout/preference_checkbox"
|
||||||
|
android:title="@string/huawei_ignore_wakeup_status_end"
|
||||||
|
android:summary="@string/huawei_ignore_wakeup_status_end_description"/>
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
</androidx.preference.PreferenceScreen>
|
Loading…
Reference in New Issue
Block a user