mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-26 03:46:49 +01:00
Add more preference settings for ZeTime: time and date format, activity tracking, do-not-disturb scheduling, wrist-flick, analog mode and calories type.
This commit is contained in:
parent
6617c45fec
commit
6be181047a
@ -55,6 +55,8 @@ public class ZeTimeConstants {
|
|||||||
public static final byte CMD_SCREEN_ON_TIME = (byte) 0x13;
|
public static final byte CMD_SCREEN_ON_TIME = (byte) 0x13;
|
||||||
public static final byte CMD_SNOOZE = (byte) 0x14;
|
public static final byte CMD_SNOOZE = (byte) 0x14;
|
||||||
public static final byte CMD_DO_NOT_DISTURB = (byte) 0x15;
|
public static final byte CMD_DO_NOT_DISTURB = (byte) 0x15;
|
||||||
|
public static final byte CMD_ANALOG_MODE = (byte) 0x17;
|
||||||
|
public static final byte CMD_CONTROL_DEVICE = (byte) 0x1A;
|
||||||
public static final byte CMD_DISPLAY_TIMEOUT = (byte) 0x25;
|
public static final byte CMD_DISPLAY_TIMEOUT = (byte) 0x25;
|
||||||
public static final byte CMD_USER_INFO = (byte) 0x30;
|
public static final byte CMD_USER_INFO = (byte) 0x30;
|
||||||
public static final byte CMD_USAGE_HABITS = (byte) 0x31;
|
public static final byte CMD_USAGE_HABITS = (byte) 0x31;
|
||||||
@ -74,6 +76,7 @@ public class ZeTimeConstants {
|
|||||||
public static final byte CMD_GET_HEARTRATE_EXDATA = (byte) 0x61;
|
public static final byte CMD_GET_HEARTRATE_EXDATA = (byte) 0x61;
|
||||||
public static final byte CMD_PUSH_EX_MSG = (byte) 0x76;
|
public static final byte CMD_PUSH_EX_MSG = (byte) 0x76;
|
||||||
public static final byte CMD_PUSH_WEATHER_DATA = (byte) 0x77;
|
public static final byte CMD_PUSH_WEATHER_DATA = (byte) 0x77;
|
||||||
|
public static final byte CMD_SWITCH_SETTINGS = (byte) 0x90;
|
||||||
public static final byte CMD_PUSH_CALENDAR_DAY = (byte) 0x99;
|
public static final byte CMD_PUSH_CALENDAR_DAY = (byte) 0x99;
|
||||||
public static final byte CMD_MUSIC_CONTROL = (byte) 0xD0;
|
public static final byte CMD_MUSIC_CONTROL = (byte) 0xD0;
|
||||||
// here are the action commands
|
// here are the action commands
|
||||||
@ -120,4 +123,14 @@ public class ZeTimeConstants {
|
|||||||
public static final String PREF_ZETIME_MAX_HEARTRATE = "alarm_max_heart_rate";
|
public static final String PREF_ZETIME_MAX_HEARTRATE = "alarm_max_heart_rate";
|
||||||
public static final String PREF_ZETIME_MIN_HEARTRATE = "alarm_min_heart_rate";
|
public static final String PREF_ZETIME_MIN_HEARTRATE = "alarm_min_heart_rate";
|
||||||
|
|
||||||
|
public static final String PREF_DO_NOT_DISTURB = "zetime_do_not_disturb";
|
||||||
|
public static final String PREF_DO_NOT_DISTURB_START = "zetime_do_not_disturb_start";
|
||||||
|
public static final String PREF_DO_NOT_DISTURB_END = "zetime_do_not_disturb_end";
|
||||||
|
|
||||||
|
public static final String PREF_ANALOG_MODE = "zetime_analog_mode";
|
||||||
|
public static final String PREF_ACTIVITY_TRACKING = "zetime_activity_tracking";
|
||||||
|
public static final String PREF_HANDMOVE_DISPLAY = "zetime_handmove_display";
|
||||||
|
public static final String PREF_CALORIES_TYPE = "zetime_calories_type";
|
||||||
|
public static final String PREF_TIME_FORMAT = "zetime_time_format";
|
||||||
|
public static final String PREF_DATE_FORMAT = "zetime_date_format";
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public class ZeTimePreferenceActivity extends AbstractSettingsActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
addPreferencesFromResource(R.xml.preferences);
|
addPreferencesFromResource(R.xml.zetime_preferences);
|
||||||
|
|
||||||
//addTryListeners();
|
//addTryListeners();
|
||||||
|
|
||||||
@ -49,6 +49,87 @@ public class ZeTimePreferenceActivity extends AbstractSettingsActivity {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final Preference analogMode = findPreference(ZeTimeConstants.PREF_ANALOG_MODE);
|
||||||
|
analogMode.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||||
|
GBApplication.deviceService().onSendConfiguration(ZeTimeConstants.PREF_ANALOG_MODE);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final Preference activity = findPreference(ZeTimeConstants.PREF_ACTIVITY_TRACKING);
|
||||||
|
activity.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||||
|
GBApplication.deviceService().onSendConfiguration(ZeTimeConstants.PREF_ACTIVITY_TRACKING);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final Preference handmove = findPreference(ZeTimeConstants.PREF_HANDMOVE_DISPLAY);
|
||||||
|
handmove.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||||
|
GBApplication.deviceService().onSendConfiguration(ZeTimeConstants.PREF_HANDMOVE_DISPLAY);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final Preference dnd = findPreference(ZeTimeConstants.PREF_DO_NOT_DISTURB);
|
||||||
|
dnd.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||||
|
GBApplication.deviceService().onSendConfiguration(ZeTimeConstants.PREF_DO_NOT_DISTURB);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final Preference dnd_start = findPreference(ZeTimeConstants.PREF_DO_NOT_DISTURB_START);
|
||||||
|
dnd_start.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||||
|
GBApplication.deviceService().onSendConfiguration(ZeTimeConstants.PREF_DO_NOT_DISTURB);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final Preference dnd_end = findPreference(ZeTimeConstants.PREF_DO_NOT_DISTURB_END);
|
||||||
|
dnd_end.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||||
|
GBApplication.deviceService().onSendConfiguration(ZeTimeConstants.PREF_DO_NOT_DISTURB);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final Preference caloriesType = findPreference(ZeTimeConstants.PREF_CALORIES_TYPE);
|
||||||
|
caloriesType.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||||
|
GBApplication.deviceService().onSendConfiguration(ZeTimeConstants.PREF_CALORIES_TYPE);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final Preference timeFormat = findPreference(ZeTimeConstants.PREF_TIME_FORMAT);
|
||||||
|
timeFormat.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||||
|
GBApplication.deviceService().onSendConfiguration(ZeTimeConstants.PREF_TIME_FORMAT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final Preference dateFormat = findPreference(ZeTimeConstants.PREF_DATE_FORMAT);
|
||||||
|
dateFormat.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||||
|
GBApplication.deviceService().onSendConfiguration(ZeTimeConstants.PREF_DATE_FORMAT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void addTryListeners() {
|
// private void addTryListeners() {
|
||||||
|
@ -27,6 +27,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
@ -124,8 +126,6 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
requestDeviceInfo(builder);
|
requestDeviceInfo(builder);
|
||||||
requestBatteryInfo(builder);
|
requestBatteryInfo(builder);
|
||||||
setUserInfo(builder);
|
setUserInfo(builder);
|
||||||
setWrist(builder);
|
|
||||||
setScreenTime(builder);
|
|
||||||
setUserGoals(builder);
|
setUserGoals(builder);
|
||||||
setHeartRateLimits(builder);
|
setHeartRateLimits(builder);
|
||||||
requestActivityInfo(builder);
|
requestActivityInfo(builder);
|
||||||
@ -149,6 +149,27 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
case ZeTimeConstants.PREF_SCREENTIME:
|
case ZeTimeConstants.PREF_SCREENTIME:
|
||||||
setScreenTime(builder);
|
setScreenTime(builder);
|
||||||
break;
|
break;
|
||||||
|
case ZeTimeConstants.PREF_ANALOG_MODE:
|
||||||
|
setAnalogMode(builder);
|
||||||
|
break;
|
||||||
|
case ZeTimeConstants.PREF_ACTIVITY_TRACKING:
|
||||||
|
setActivityTracking(builder);
|
||||||
|
break;
|
||||||
|
case ZeTimeConstants.PREF_HANDMOVE_DISPLAY:
|
||||||
|
setDisplayOnMovement(builder);
|
||||||
|
break;
|
||||||
|
case ZeTimeConstants.PREF_DO_NOT_DISTURB:
|
||||||
|
setDoNotDisturb(builder);
|
||||||
|
break;
|
||||||
|
case ZeTimeConstants.PREF_CALORIES_TYPE:
|
||||||
|
setCaloriesType(builder);
|
||||||
|
break;
|
||||||
|
case ZeTimeConstants.PREF_TIME_FORMAT:
|
||||||
|
setTimeFormate(builder);
|
||||||
|
break;
|
||||||
|
case ZeTimeConstants.PREF_DATE_FORMAT:
|
||||||
|
setDateFormate(builder);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
builder.queue(getQueue());
|
builder.queue(getQueue());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -1433,4 +1454,164 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
volume,
|
volume,
|
||||||
ZeTimeConstants.CMD_END});
|
ZeTimeConstants.CMD_END});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setAnalogMode(TransactionBuilder builder)
|
||||||
|
{
|
||||||
|
Prefs prefs = GBApplication.getPrefs();
|
||||||
|
int mode = prefs.getInt(ZeTimeConstants.PREF_ANALOG_MODE, 0);
|
||||||
|
|
||||||
|
byte[] analog = {ZeTimeConstants.CMD_PREAMBLE,
|
||||||
|
ZeTimeConstants.CMD_ANALOG_MODE,
|
||||||
|
ZeTimeConstants.CMD_SEND,
|
||||||
|
(byte)0x1,
|
||||||
|
(byte)0x0,
|
||||||
|
(byte)mode,
|
||||||
|
ZeTimeConstants.CMD_END};
|
||||||
|
|
||||||
|
sendMsgToWatch(builder, analog);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setActivityTracking(TransactionBuilder builder)
|
||||||
|
{
|
||||||
|
Prefs prefs = GBApplication.getPrefs();
|
||||||
|
boolean tracking = prefs.getBoolean(ZeTimeConstants.PREF_ACTIVITY_TRACKING, false);
|
||||||
|
|
||||||
|
byte[] activity = {ZeTimeConstants.CMD_PREAMBLE,
|
||||||
|
ZeTimeConstants.CMD_CONTROL_DEVICE,
|
||||||
|
ZeTimeConstants.CMD_SEND,
|
||||||
|
(byte)0x1,
|
||||||
|
(byte)0x0,
|
||||||
|
(byte)0x9,
|
||||||
|
ZeTimeConstants.CMD_END};
|
||||||
|
if(tracking)
|
||||||
|
{
|
||||||
|
activity[5] = (byte)0xa;
|
||||||
|
}
|
||||||
|
sendMsgToWatch(builder, activity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setDisplayOnMovement(TransactionBuilder builder)
|
||||||
|
{
|
||||||
|
Prefs prefs = GBApplication.getPrefs();
|
||||||
|
boolean movement = prefs.getBoolean(ZeTimeConstants.PREF_ACTIVITY_TRACKING, false);
|
||||||
|
|
||||||
|
byte[] handmove = {ZeTimeConstants.CMD_PREAMBLE,
|
||||||
|
ZeTimeConstants.CMD_SWITCH_SETTINGS,
|
||||||
|
ZeTimeConstants.CMD_SEND,
|
||||||
|
(byte)0x3,
|
||||||
|
(byte)0x0,
|
||||||
|
(byte)0x1,
|
||||||
|
(byte)0xe,
|
||||||
|
(byte)0x0,
|
||||||
|
ZeTimeConstants.CMD_END};
|
||||||
|
if(movement)
|
||||||
|
{
|
||||||
|
handmove[7] = (byte)0x1;
|
||||||
|
}
|
||||||
|
sendMsgToWatch(builder, handmove);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setDoNotDisturb(TransactionBuilder builder)
|
||||||
|
{
|
||||||
|
Prefs prefs = GBApplication.getPrefs();
|
||||||
|
String scheduled = prefs.getString(ZeTimeConstants.PREF_DO_NOT_DISTURB, "off");
|
||||||
|
String dndScheduled = getContext().getString(R.string.p_scheduled);
|
||||||
|
String start = prefs.getString(ZeTimeConstants.PREF_DO_NOT_DISTURB_START, "22:00");
|
||||||
|
String end = prefs.getString(ZeTimeConstants.PREF_DO_NOT_DISTURB_END, "07:00");
|
||||||
|
DateFormat df_start = new SimpleDateFormat("HH:mm");
|
||||||
|
DateFormat df_end = new SimpleDateFormat("HH:mm");
|
||||||
|
Calendar calendar = GregorianCalendar.getInstance();
|
||||||
|
Calendar calendar_end = GregorianCalendar.getInstance();
|
||||||
|
|
||||||
|
try {
|
||||||
|
calendar.setTime(df_start.parse(start));
|
||||||
|
try {
|
||||||
|
calendar_end.setTime(df_end.parse(end));
|
||||||
|
|
||||||
|
byte[] doNotDisturb = {ZeTimeConstants.CMD_PREAMBLE,
|
||||||
|
ZeTimeConstants.CMD_DO_NOT_DISTURB,
|
||||||
|
ZeTimeConstants.CMD_SEND,
|
||||||
|
(byte)0x5,
|
||||||
|
(byte)0x0,
|
||||||
|
(byte)0x0,
|
||||||
|
(byte)calendar.get(Calendar.HOUR_OF_DAY),
|
||||||
|
(byte)calendar.get(Calendar.MINUTE),
|
||||||
|
(byte)calendar_end.get(Calendar.HOUR_OF_DAY),
|
||||||
|
(byte)calendar_end.get(Calendar.MINUTE),
|
||||||
|
ZeTimeConstants.CMD_END};
|
||||||
|
|
||||||
|
if(scheduled.equals(dndScheduled))
|
||||||
|
{
|
||||||
|
doNotDisturb[5] = (byte)0x1;
|
||||||
|
}
|
||||||
|
sendMsgToWatch(builder, doNotDisturb);
|
||||||
|
} catch(Exception e) {
|
||||||
|
LOG.error("Unexpected exception in ZeTimeDeviceSupport.setDoNotDisturb: " + e.getMessage());
|
||||||
|
}
|
||||||
|
} catch(Exception e) {
|
||||||
|
LOG.error("Unexpected exception in ZeTimeDeviceSupport.setDoNotDisturb: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setCaloriesType(TransactionBuilder builder)
|
||||||
|
{
|
||||||
|
Prefs prefs = GBApplication.getPrefs();
|
||||||
|
int type = prefs.getInt(ZeTimeConstants.PREF_CALORIES_TYPE, 0);
|
||||||
|
|
||||||
|
byte[] calories = {ZeTimeConstants.CMD_PREAMBLE,
|
||||||
|
ZeTimeConstants.CMD_CALORIES_TYPE,
|
||||||
|
ZeTimeConstants.CMD_SEND,
|
||||||
|
(byte)0x1,
|
||||||
|
(byte)0x0,
|
||||||
|
(byte)type,
|
||||||
|
ZeTimeConstants.CMD_END};
|
||||||
|
|
||||||
|
sendMsgToWatch(builder, calories);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setTimeFormate(TransactionBuilder builder)
|
||||||
|
{
|
||||||
|
Prefs prefs = GBApplication.getPrefs();
|
||||||
|
int type = prefs.getInt(ZeTimeConstants.PREF_TIME_FORMAT, 0);
|
||||||
|
|
||||||
|
byte[] timeformat = {ZeTimeConstants.CMD_PREAMBLE,
|
||||||
|
ZeTimeConstants.CMD_TIME_SURFACE_SETTINGS,
|
||||||
|
ZeTimeConstants.CMD_SEND,
|
||||||
|
(byte)0x8,
|
||||||
|
(byte)0x0,
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)type,
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
ZeTimeConstants.CMD_END};
|
||||||
|
|
||||||
|
sendMsgToWatch(builder, timeformat);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setDateFormate(TransactionBuilder builder)
|
||||||
|
{
|
||||||
|
Prefs prefs = GBApplication.getPrefs();
|
||||||
|
int type = prefs.getInt(ZeTimeConstants.PREF_TIME_FORMAT, 0);
|
||||||
|
|
||||||
|
byte[] dateformat = {ZeTimeConstants.CMD_PREAMBLE,
|
||||||
|
ZeTimeConstants.CMD_TIME_SURFACE_SETTINGS,
|
||||||
|
ZeTimeConstants.CMD_SEND,
|
||||||
|
(byte)0x8,
|
||||||
|
(byte)0x0,
|
||||||
|
(byte)type,
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
(byte)0xff, // set to ff to not change anything on the watch
|
||||||
|
ZeTimeConstants.CMD_END};
|
||||||
|
|
||||||
|
sendMsgToWatch(builder, dateformat);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,15 @@
|
|||||||
<item>@string/p_scheduled</item>
|
<item>@string/p_scheduled</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="zetime_do_not_disturb">
|
||||||
|
<item>@string/mi2_dnd_off</item>
|
||||||
|
<item>@string/mi2_dnd_scheduled</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="zetime_do_not_disturb_values">
|
||||||
|
<item>@string/p_off</item>
|
||||||
|
<item>@string/p_scheduled</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<string-array name="activate_display_on_lift">
|
<string-array name="activate_display_on_lift">
|
||||||
<item>@string/off</item>
|
<item>@string/off</item>
|
||||||
<item>@string/on</item>
|
<item>@string/on</item>
|
||||||
@ -407,7 +416,9 @@
|
|||||||
<item name="0">@string/off</item>
|
<item name="0">@string/off</item>
|
||||||
<item name="300">@string/interval_five_minutes</item>
|
<item name="300">@string/interval_five_minutes</item>
|
||||||
<item name="600">@string/interval_ten_minutes</item>
|
<item name="600">@string/interval_ten_minutes</item>
|
||||||
|
<item name="900">@string/interval_fifteen_minutes</item>
|
||||||
<item name="1800">@string/interval_thirty_minutes</item>
|
<item name="1800">@string/interval_thirty_minutes</item>
|
||||||
|
<item name="2700">@string/interval_forty_five_minutes</item>
|
||||||
<item name="3600">@string/interval_one_hour</item>
|
<item name="3600">@string/interval_one_hour</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
@ -415,7 +426,9 @@
|
|||||||
<item>0</item>
|
<item>0</item>
|
||||||
<item>300</item>
|
<item>300</item>
|
||||||
<item>600</item>
|
<item>600</item>
|
||||||
|
<item>900</item>
|
||||||
<item>1800</item>
|
<item>1800</item>
|
||||||
|
<item>2700</item>
|
||||||
<item>3600</item>
|
<item>3600</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
@ -442,4 +455,40 @@
|
|||||||
<item>1800</item>
|
<item>1800</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<!-- Note: ZeTime preferences -->
|
||||||
|
<string-array name="zetime_analog_mode">
|
||||||
|
<item name="0">@string/zetime_analog_mode_hands</item>
|
||||||
|
<item name="1">@string/zetime_analog_mode_handsandsteps</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="zetime_analog_mode_values">
|
||||||
|
<item>0</item>
|
||||||
|
<item>1</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="zetime_calories_type">
|
||||||
|
<item name="0">@string/zetime_calories_type_active</item>
|
||||||
|
<item name="1">@string/zetime_calories_type_all</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="zetime_calories_type_values">
|
||||||
|
<item>0</item>
|
||||||
|
<item>1</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="zetime_time_format">
|
||||||
|
<item name="1">@string/zetime_time_format_24h</item>
|
||||||
|
<item name="2">@string/zetime_time_format_12h</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="zetime_time_format_values">
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="zetime_date_format">
|
||||||
|
<item name="1">@string/zetime_date_format_1</item>
|
||||||
|
<item name="2">@string/zetime_date_format_2</item>
|
||||||
|
<item name="3">@string/zetime_date_format_3</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="zetime_date_format_values">
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
<item>3</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -207,9 +207,27 @@
|
|||||||
|
|
||||||
<!-- ZeTime Preferences -->
|
<!-- ZeTime Preferences -->
|
||||||
<string name="zetime_title_settings">ZeTime settings</string>
|
<string name="zetime_title_settings">ZeTime settings</string>
|
||||||
|
<string name="zetime_title_heartrate">Heart rate settings</string>
|
||||||
<string name="zetime_title_screentime">Screen on duration in seconds</string>
|
<string name="zetime_title_screentime">Screen on duration in seconds</string>
|
||||||
<string name="activity_prefs_alarm_max_heart_rate">Max heart rate alarm</string>
|
<string name="activity_prefs_alarm_max_heart_rate">Max heart rate alarm</string>
|
||||||
<string name="activity_prefs_alarm_min_heart_rate">Min heart rate alarm</string>
|
<string name="activity_prefs_alarm_min_heart_rate">Min heart rate alarm</string>
|
||||||
|
<string name="zetime_analog_mode">Analog mode</string>
|
||||||
|
<string name="zetime_analog_mode_hands">Only hands</string>
|
||||||
|
<string name="zetime_analog_mode_handsandsteps">Hands and steps</string>
|
||||||
|
<string name="zetime_activity_tracking">Activity tracking</string>
|
||||||
|
<string name="zetime_activity_tracking_summary">Switching the activity tracking on, will count your steps and so on.</string>
|
||||||
|
<string name="zetime_handmove_display">Hand movement</string>
|
||||||
|
<string name="zetime_handmove_display_summary">Rotate your wrist to activate or deactivate the display.</string>
|
||||||
|
<string name="zetime_calories_type">Calories type</string>
|
||||||
|
<string name="zetime_calories_type_active">Only active burnt calories</string>
|
||||||
|
<string name="zetime_calories_type_all">Active and inactive burnt calories</string>
|
||||||
|
<string name="zetime_time_format">Time format</string>
|
||||||
|
<string name="zetime_time_format_24h">24h</string>
|
||||||
|
<string name="zetime_time_format_12h">12h</string>
|
||||||
|
<string name="zetime_date_format">Date format</string>
|
||||||
|
<string name="zetime_date_format_1">YY/MM/DD</string>
|
||||||
|
<string name="zetime_date_format_2">DD/MM/YY</string>
|
||||||
|
<string name="zetime_date_format_3">MM/DD/YY</string>
|
||||||
|
|
||||||
<!-- Auto export preferences -->
|
<!-- Auto export preferences -->
|
||||||
<string name="pref_header_auto_export">Auto export</string>
|
<string name="pref_header_auto_export">Auto export</string>
|
||||||
@ -317,7 +335,9 @@
|
|||||||
<string name="interval_one_minute">once a minute</string>
|
<string name="interval_one_minute">once a minute</string>
|
||||||
<string name="interval_five_minutes">every 5 minutes</string>
|
<string name="interval_five_minutes">every 5 minutes</string>
|
||||||
<string name="interval_ten_minutes">every 10 minutes</string>
|
<string name="interval_ten_minutes">every 10 minutes</string>
|
||||||
|
<string name="interval_fifteen_minutes">every 15 minutes</string>
|
||||||
<string name="interval_thirty_minutes">every 30 minutes</string>
|
<string name="interval_thirty_minutes">every 30 minutes</string>
|
||||||
|
<string name="interval_forty_five_minutes">every 45 minutes</string>
|
||||||
<string name="interval_one_hour">once an hour</string>
|
<string name="interval_one_hour">once an hour</string>
|
||||||
|
|
||||||
<string name="stats_title">Speed zones</string>
|
<string name="stats_title">Speed zones</string>
|
||||||
|
@ -722,54 +722,10 @@
|
|||||||
android:summary="%s" />
|
android:summary="%s" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
<PreferenceScreen
|
<Preference
|
||||||
android:icon="@drawable/ic_device_zetime"
|
android:icon="@drawable/ic_device_zetime"
|
||||||
android:key="pref_key_zetime"
|
android:key="pref_key_zetime"
|
||||||
android:title="@string/zetime_title_settings">
|
android:title="@string/zetime_title_settings"/>
|
||||||
<PreferenceCategory
|
|
||||||
android:key="pref_category_zetime_general"
|
|
||||||
android:title="@string/pref_header_general">
|
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:defaultValue="left"
|
|
||||||
android:entries="@array/wearside"
|
|
||||||
android:entryValues="@array/wearside_values"
|
|
||||||
android:key="zetime_wrist"
|
|
||||||
android:title="@string/miband_prefs_wearside"
|
|
||||||
android:summary="%s" />
|
|
||||||
<EditTextPreference
|
|
||||||
android:inputType="number"
|
|
||||||
android:maxLength="5"
|
|
||||||
android:defaultValue="30"
|
|
||||||
android:key="zetime_screentime"
|
|
||||||
android:title="@string/zetime_title_screentime"/>
|
|
||||||
<ListPreference
|
|
||||||
android:defaultValue="0"
|
|
||||||
android:entries="@array/prefs_zetime_heartrate_measurement_interval"
|
|
||||||
android:entryValues="@array/prefs_zetime_heartrate_measurement_interval_values"
|
|
||||||
android:key="heartrate_measurement_interval"
|
|
||||||
android:summary="%s"
|
|
||||||
android:title="@string/prefs_title_heartrate_measurement_interval" />
|
|
||||||
<EditTextPreference
|
|
||||||
android:inputType="number"
|
|
||||||
android:key="alarm_max_heart_rate"
|
|
||||||
android:maxLength="3"
|
|
||||||
android:defaultValue="180"
|
|
||||||
android:title="@string/activity_prefs_alarm_max_heart_rate" />
|
|
||||||
|
|
||||||
<EditTextPreference
|
|
||||||
android:inputType="number"
|
|
||||||
android:key="alarm_min_heart_rate"
|
|
||||||
android:maxLength="3"
|
|
||||||
android:defaultValue="60"
|
|
||||||
android:title="@string/activity_prefs_alarm_min_heart_rate" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="zetime_dont_del_actdata"
|
|
||||||
android:title="@string/pref_title_keep_data_on_device"
|
|
||||||
android:summary="@string/pref_summary_keep_data_on_device"
|
|
||||||
android:defaultValue="true" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
</PreferenceScreen>
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
|
126
app/src/main/res/xml/zetime_preferences.xml
Normal file
126
app/src/main/res/xml/zetime_preferences.xml
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<PreferenceCategory
|
||||||
|
android:key="pref_category_zetime_general"
|
||||||
|
android:title="@string/pref_header_general">
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="left"
|
||||||
|
android:entries="@array/wearside"
|
||||||
|
android:entryValues="@array/wearside_values"
|
||||||
|
android:key="zetime_wrist"
|
||||||
|
android:title="@string/miband_prefs_wearside"
|
||||||
|
android:summary="%s" />
|
||||||
|
<EditTextPreference
|
||||||
|
android:inputType="number"
|
||||||
|
android:maxLength="5"
|
||||||
|
android:defaultValue="30"
|
||||||
|
android:key="zetime_screentime"
|
||||||
|
android:title="@string/zetime_title_screentime"/>
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="zetime_activity_tracking"
|
||||||
|
android:title="@string/zetime_activity_tracking"
|
||||||
|
android:summary="@string/zetime_activity_tracking_summary" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/zetime_calories_type"
|
||||||
|
android:entryValues="@array/zetime_calories_type_values"
|
||||||
|
android:key="zetime_calories_type"
|
||||||
|
android:title="@string/zetime_calories_type"
|
||||||
|
android:summary="%s" />
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="zetime_handmove_display"
|
||||||
|
android:title="@string/zetime_handmove_display"
|
||||||
|
android:summary="@string/zetime_handmove_display_summary" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/zetime_analog_mode"
|
||||||
|
android:entryValues="@array/zetime_analog_mode_values"
|
||||||
|
android:key="zetime_analog_mode"
|
||||||
|
android:title="@string/zetime_analog_mode"
|
||||||
|
android:summary="%s" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="1"
|
||||||
|
android:entries="@array/zetime_time_format"
|
||||||
|
android:entryValues="@array/zetime_time_format_values"
|
||||||
|
android:key="zetime_time_format"
|
||||||
|
android:title="@string/zetime_time_format"
|
||||||
|
android:summary="%s" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="2"
|
||||||
|
android:entries="@array/zetime_date_format"
|
||||||
|
android:entryValues="@array/zetime_date_format_values"
|
||||||
|
android:key="zetime_date_format"
|
||||||
|
android:title="@string/zetime_date_format"
|
||||||
|
android:summary="%s" />
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="zetime_dont_del_actdata"
|
||||||
|
android:title="@string/pref_title_keep_data_on_device"
|
||||||
|
android:summary="@string/pref_summary_keep_data_on_device"
|
||||||
|
android:defaultValue="true" />
|
||||||
|
|
||||||
|
<PreferenceScreen
|
||||||
|
android:key="zetime_do_not_disturb_key"
|
||||||
|
android:title="@string/mi2_prefs_do_not_disturb"
|
||||||
|
android:persistent="false"
|
||||||
|
android:summary="@string/mi2_prefs_do_not_disturb_summary">
|
||||||
|
|
||||||
|
<!-- workaround for missing toolbar -->
|
||||||
|
<PreferenceCategory
|
||||||
|
android:title="@string/mi2_prefs_do_not_disturb"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="@string/p_off"
|
||||||
|
android:entries="@array/zetime_do_not_disturb"
|
||||||
|
android:entryValues="@array/zetime_do_not_disturb_values"
|
||||||
|
android:key="zetime_do_not_disturb"
|
||||||
|
android:title="@string/mi2_prefs_do_not_disturb"
|
||||||
|
android:summary="%s" />
|
||||||
|
|
||||||
|
<nodomain.freeyourgadget.gadgetbridge.util.TimePreference
|
||||||
|
android:defaultValue="22:00"
|
||||||
|
android:key="zetime_do_not_disturb_start"
|
||||||
|
android:title="@string/mi2_prefs_do_not_disturb_start" />
|
||||||
|
|
||||||
|
<nodomain.freeyourgadget.gadgetbridge.util.TimePreference
|
||||||
|
android:defaultValue="07:00"
|
||||||
|
android:key="zetime_do_not_disturb_end"
|
||||||
|
android:title="@string/mi2_prefs_do_not_disturb_end" />
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
||||||
|
</PreferenceCategory>
|
||||||
|
<PreferenceCategory
|
||||||
|
android:key="pref_category_zetime_heartrate"
|
||||||
|
android:title="@string/zetime_title_heartrate">
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/prefs_zetime_heartrate_measurement_interval"
|
||||||
|
android:entryValues="@array/prefs_zetime_heartrate_measurement_interval_values"
|
||||||
|
android:key="heartrate_measurement_interval"
|
||||||
|
android:summary="%s"
|
||||||
|
android:title="@string/prefs_title_heartrate_measurement_interval" />
|
||||||
|
<EditTextPreference
|
||||||
|
android:inputType="number"
|
||||||
|
android:key="alarm_max_heart_rate"
|
||||||
|
android:maxLength="3"
|
||||||
|
android:defaultValue="180"
|
||||||
|
android:title="@string/activity_prefs_alarm_max_heart_rate" />
|
||||||
|
|
||||||
|
<EditTextPreference
|
||||||
|
android:inputType="number"
|
||||||
|
android:key="alarm_min_heart_rate"
|
||||||
|
android:maxLength="3"
|
||||||
|
android:defaultValue="60"
|
||||||
|
android:title="@string/activity_prefs_alarm_min_heart_rate" />
|
||||||
|
</PreferenceCategory>
|
||||||
|
</PreferenceScreen>
|
Loading…
Reference in New Issue
Block a user