Merge branch 'master' into background-javascript
@ -1,4 +1,11 @@
|
||||
### Changelog
|
||||
#### Version 0.19.4
|
||||
* Replace or relicense CC-NC licensed icons to satisfy F-Droid
|
||||
* Mi Band 2: Make infos to display on the Band configurable
|
||||
* Mi Band 2: Support wrist rotation to switch info setting
|
||||
* Mi Band 2: Support goal notification setting
|
||||
* Mi Band 2: Support do not disturb setting
|
||||
* Mi Band 2: Support inactivity warning setting
|
||||
|
||||
#### Version 0.19.3
|
||||
* Pebble: Fix crash when calendar access permission has been denied
|
||||
|
@ -1,19 +1,22 @@
|
||||
The following artwork is licensed under the following licenses
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0):
|
||||
ic_launcher.png
|
||||
ic_device_pebble.png
|
||||
ic_device_miband.png
|
||||
ic_device_lovetoy.png
|
||||
ic_device_hplus.png
|
||||
ic_device_default.png
|
||||
ic_activitytracker.png
|
||||
ic_watchface.png
|
||||
ic_languagepack.png
|
||||
ic_firmware.png
|
||||
ic_watchapp.png
|
||||
ic_systemapp.png
|
||||
icon.png (fastlane metadata directories)
|
||||
featureGraphic.png (fastlane metadata directories)
|
||||
(All of the above by xphnx)
|
||||
|
||||
Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA):
|
||||
ic_launcher.png (by Joseph Kim)
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0):
|
||||
"GET IT ON F-Droid" button by Laura Kalbag. Source: https://ind.ie/about/blog/f-droid-button/
|
||||
|
||||
|
@ -26,8 +26,8 @@ android {
|
||||
targetSdkVersion 25
|
||||
|
||||
// note: always bump BOTH versionCode and versionName!
|
||||
versionName "0.19.3"
|
||||
versionCode 96
|
||||
versionName "0.19.4"
|
||||
versionCode 97
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
}
|
||||
buildTypes {
|
||||
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 28 KiB |
@ -487,7 +487,7 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
|
||||
}
|
||||
activityEntries.add(createBarEntry(value, ts));
|
||||
if (hr && isValidHeartRateValue(sample.getHeartRate())) {
|
||||
if (lastHrSampleIndex > -1 && ts - lastHrSampleIndex > 60*HeartRateUtils.MAX_HR_MEASUREMENTS_GAP_MINUTES) {
|
||||
if (lastHrSampleIndex > -1 && ts - lastHrSampleIndex > 1800*HeartRateUtils.MAX_HR_MEASUREMENTS_GAP_MINUTES) {
|
||||
heartrateEntries.add(createLineEntry(0, lastHrSampleIndex + 1));
|
||||
heartrateEntries.add(createLineEntry(0, ts - 1));
|
||||
}
|
||||
@ -530,7 +530,7 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
|
||||
List<IBarDataSet> list = new ArrayList<>();
|
||||
list.add(activitySet);
|
||||
BarData barData = new BarData(list);
|
||||
barData.setBarWidth(100f);
|
||||
barData.setBarWidth(200f);
|
||||
// barData.setGroupSpace(0);
|
||||
combinedData.setData(barData);
|
||||
|
||||
@ -595,10 +595,10 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
|
||||
|
||||
protected LineDataSet createHeartrateSet(List<Entry> values, String label) {
|
||||
LineDataSet set1 = new LineDataSet(values, label);
|
||||
set1.setLineWidth(0.8f);
|
||||
set1.setLineWidth(2.2f);
|
||||
set1.setColor(HEARTRATE_COLOR);
|
||||
// set1.setDrawCubic(true);
|
||||
set1.setMode(LineDataSet.Mode.CUBIC_BEZIER);
|
||||
set1.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);
|
||||
set1.setCubicIntensity(0.1f);
|
||||
set1.setDrawCircles(false);
|
||||
// set1.setCircleRadius(2f);
|
||||
|
@ -245,4 +245,5 @@ public interface DeviceCoordinator {
|
||||
* This can be live HR, steps etc.
|
||||
*/
|
||||
boolean supportsRealtimeData();
|
||||
|
||||
}
|
||||
|
@ -47,9 +47,6 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
|
||||
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_DO_NOT_DISTURB_END;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_DO_NOT_DISTURB_START;
|
||||
|
||||
public class MiBand2Coordinator extends MiBandCoordinator {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MiBand2Coordinator.class);
|
||||
|
||||
@ -139,27 +136,54 @@ public class MiBand2Coordinator extends MiBandCoordinator {
|
||||
return prefs.getBoolean(MiBandConst.PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO, false);
|
||||
}
|
||||
|
||||
public static Date getDoNotDisturbStart() {
|
||||
public static boolean getInactivityWarnings() {
|
||||
Prefs prefs = GBApplication.getPrefs();
|
||||
String time = prefs.getString(PREF_MI2_DO_NOT_DISTURB_START, "01:00");
|
||||
return prefs.getBoolean(MiBandConst.PREF_MI2_INACTIVITY_WARNINGS, false);
|
||||
}
|
||||
|
||||
DateFormat df = new SimpleDateFormat("HH:mm");
|
||||
try {
|
||||
return df.parse(time);
|
||||
} catch(Exception e) {
|
||||
}
|
||||
public static int getInactivityWarningsThreshold() {
|
||||
Prefs prefs = GBApplication.getPrefs();
|
||||
return prefs.getInt(MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_THRESHOLD, 60);
|
||||
}
|
||||
|
||||
return new Date();
|
||||
public static boolean getInactivityWarningsDnd() {
|
||||
Prefs prefs = GBApplication.getPrefs();
|
||||
return prefs.getBoolean(MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_DND, false);
|
||||
}
|
||||
|
||||
public static Date getInactivityWarningsStart() {
|
||||
return getTimePreference(MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_START, "06:00");
|
||||
}
|
||||
|
||||
public static Date getInactivityWarningsEnd() {
|
||||
return getTimePreference(MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_END, "22:00");
|
||||
}
|
||||
|
||||
public static Date getInactivityWarningsDndStart() {
|
||||
return getTimePreference(MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_DND_START, "12:00");
|
||||
}
|
||||
|
||||
public static Date getInactivityWarningsDndEnd() {
|
||||
return getTimePreference(MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_DND_END, "14:00");
|
||||
}
|
||||
|
||||
public static Date getDoNotDisturbStart() {
|
||||
return getTimePreference(MiBandConst.PREF_MI2_DO_NOT_DISTURB_START, "01:00");
|
||||
}
|
||||
|
||||
public static Date getDoNotDisturbEnd() {
|
||||
return getTimePreference(MiBandConst.PREF_MI2_DO_NOT_DISTURB_END, "06:00");
|
||||
}
|
||||
|
||||
public static Date getTimePreference(String key, String defaultValue) {
|
||||
Prefs prefs = GBApplication.getPrefs();
|
||||
String time = prefs.getString(PREF_MI2_DO_NOT_DISTURB_END, "06:00");
|
||||
String time = prefs.getString(key, defaultValue);
|
||||
|
||||
DateFormat df = new SimpleDateFormat("HH:mm");
|
||||
try {
|
||||
return df.parse(time);
|
||||
} catch(Exception e) {
|
||||
LOG.error("Unexpected exception in MiBand2Coordinator.getTime: " + e.getMessage());
|
||||
}
|
||||
|
||||
return new Date();
|
||||
|
@ -174,6 +174,22 @@ public class MiBand2Service {
|
||||
public static final byte[] DISPLAY_XXX = new byte[] {ENDPOINT_DISPLAY, 0x03, 0x0, 0x0 };
|
||||
public static final byte[] DISPLAY_YYY = new byte[] {ENDPOINT_DISPLAY, 0x10, 0x0, 0x1, 0x1 };
|
||||
|
||||
// The third byte controls the threshold, in minutes
|
||||
// The last 8 bytes represent 2 separate time intervals for the inactivity warnings
|
||||
// If there is no do not disturb interval, the last 4 bytes (the second interval) are 0
|
||||
// and only the first interval of the command is used
|
||||
public static int INACTIVITY_WARNINGS_THRESHOLD = 2;
|
||||
public static int INACTIVITY_WARNINGS_INTERVAL_1_START_HOURS = 4;
|
||||
public static int INACTIVITY_WARNINGS_INTERVAL_1_START_MINUTES = 5;
|
||||
public static int INACTIVITY_WARNINGS_INTERVAL_1_END_HOURS = 6;
|
||||
public static int INACTIVITY_WARNINGS_INTERVAL_1_END_MINUTES = 7;
|
||||
public static int INACTIVITY_WARNINGS_INTERVAL_2_START_HOURS = 8;
|
||||
public static int INACTIVITY_WARNINGS_INTERVAL_2_START_MINUTES = 9;
|
||||
public static int INACTIVITY_WARNINGS_INTERVAL_2_END_HOURS = 10;
|
||||
public static int INACTIVITY_WARNINGS_INTERVAL_2_END_MINUTES = 11;
|
||||
public static final byte[] COMMAND_ENABLE_INACTIVITY_WARNINGS = new byte[] { 0x08, 0x01, 0x3c, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
public static final byte[] COMMAND_DISABLE_INACTIVITY_WARNINGS = new byte[] { 0x08, 0x00, 0x3c, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
public static byte ENDPOINT_DND = 0x09;
|
||||
|
||||
public static final byte[] COMMAND_DO_NOT_DISTURB_AUTOMATIC = new byte[] { ENDPOINT_DND, (byte) 0x83 };
|
||||
|
@ -52,6 +52,13 @@ public final class MiBandConst {
|
||||
public static final String PREF_MI2_DO_NOT_DISTURB_SCHEDULED = "scheduled";
|
||||
public static final String PREF_MI2_DO_NOT_DISTURB_START = "mi2_do_not_disturb_start";
|
||||
public static final String PREF_MI2_DO_NOT_DISTURB_END = "mi2_do_not_disturb_end";
|
||||
public static final String PREF_MI2_INACTIVITY_WARNINGS = "mi2_inactivity_warnings";
|
||||
public static final String PREF_MI2_INACTIVITY_WARNINGS_THRESHOLD = "mi2_inactivity_warnings_threshold";
|
||||
public static final String PREF_MI2_INACTIVITY_WARNINGS_START = "mi2_inactivity_warnings_start";
|
||||
public static final String PREF_MI2_INACTIVITY_WARNINGS_END = "mi2_inactivity_warnings_end";
|
||||
public static final String PREF_MI2_INACTIVITY_WARNINGS_DND = "mi2_inactivity_warnings_dnd";
|
||||
public static final String PREF_MI2_INACTIVITY_WARNINGS_DND_START = "mi2_inactivity_warnings_dnd_start";
|
||||
public static final String PREF_MI2_INACTIVITY_WARNINGS_DND_END = "mi2_inactivity_warnings_dnd_end";
|
||||
public static final String PREF_MIBAND_SETUP_BT_PAIRING = "mi_setup_bt_pairing";
|
||||
|
||||
|
||||
|
@ -48,6 +48,13 @@ import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PR
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_DO_NOT_DISTURB_START;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_ENABLE_TEXT_NOTIFICATIONS;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_GOAL_NOTIFICATION;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_INACTIVITY_WARNINGS;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_DND;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_DND_END;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_DND_START;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_END;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_START;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_THRESHOLD;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MIBAND_ADDRESS;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MIBAND_DEVICE_TIME_OFFSET_HOURS;
|
||||
@ -147,6 +154,104 @@ public class MiBandPreferencesActivity extends AbstractSettingsActivity {
|
||||
}
|
||||
});
|
||||
|
||||
final Preference inactivityWarnings = findPreference(PREF_MI2_INACTIVITY_WARNINGS);
|
||||
inactivityWarnings.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||
invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GBApplication.deviceService().onSendConfiguration(PREF_MI2_INACTIVITY_WARNINGS);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
final Preference inactivityWarningsThreshold = findPreference(PREF_MI2_INACTIVITY_WARNINGS_THRESHOLD);
|
||||
inactivityWarningsThreshold.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||
invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GBApplication.deviceService().onSendConfiguration(PREF_MI2_INACTIVITY_WARNINGS_THRESHOLD);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
final Preference inactivityWarningsStart = findPreference(PREF_MI2_INACTIVITY_WARNINGS_START);
|
||||
inactivityWarningsStart.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||
invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GBApplication.deviceService().onSendConfiguration(PREF_MI2_INACTIVITY_WARNINGS_START);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
final Preference inactivityWarningsEnd = findPreference(PREF_MI2_INACTIVITY_WARNINGS_END);
|
||||
inactivityWarningsEnd.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||
invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GBApplication.deviceService().onSendConfiguration(PREF_MI2_INACTIVITY_WARNINGS_END);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
final Preference inactivityWarningsDnd = findPreference(PREF_MI2_INACTIVITY_WARNINGS_DND);
|
||||
inactivityWarningsDnd.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||
invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GBApplication.deviceService().onSendConfiguration(PREF_MI2_INACTIVITY_WARNINGS_DND);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
final Preference inactivityWarningsDndStart = findPreference(PREF_MI2_INACTIVITY_WARNINGS_DND_START);
|
||||
inactivityWarningsDndStart.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||
invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GBApplication.deviceService().onSendConfiguration(PREF_MI2_INACTIVITY_WARNINGS_DND_START);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
final Preference inactivityWarningsDndEnd = findPreference(PREF_MI2_INACTIVITY_WARNINGS_DND_END);
|
||||
inactivityWarningsDndEnd.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||
invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GBApplication.deviceService().onSendConfiguration(PREF_MI2_INACTIVITY_WARNINGS_DND_END);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
String doNotDisturbState = prefs.getString(MiBandConst.PREF_MI2_DO_NOT_DISTURB, PREF_MI2_DO_NOT_DISTURB_OFF);
|
||||
boolean doNotDisturbScheduled = doNotDisturbState.equals(PREF_MI2_DO_NOT_DISTURB_SCHEDULED);
|
||||
|
||||
@ -270,6 +375,7 @@ public class MiBandPreferencesActivity extends AbstractSettingsActivity {
|
||||
prefKeys.add(PREF_MIBAND_RESERVE_ALARM_FOR_CALENDAR);
|
||||
prefKeys.add(PREF_MIBAND_DEVICE_TIME_OFFSET_HOURS);
|
||||
prefKeys.add(PREF_MI2_ENABLE_TEXT_NOTIFICATIONS);
|
||||
prefKeys.add(PREF_MI2_INACTIVITY_WARNINGS_THRESHOLD);
|
||||
prefKeys.add(getNotificationPrefKey(VIBRATION_COUNT, ORIGIN_ALARM_CLOCK));
|
||||
prefKeys.add(getNotificationPrefKey(VIBRATION_COUNT, ORIGIN_INCOMING_CALL));
|
||||
|
||||
|
@ -1097,6 +1097,16 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
case MiBandConst.PREF_MI2_DO_NOT_DISTURB_START:
|
||||
case MiBandConst.PREF_MI2_DO_NOT_DISTURB_END:
|
||||
setDoNotDisturb(builder);
|
||||
break;
|
||||
case MiBandConst.PREF_MI2_INACTIVITY_WARNINGS:
|
||||
case MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_THRESHOLD:
|
||||
case MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_START:
|
||||
case MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_END:
|
||||
case MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_DND:
|
||||
case MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_DND_START:
|
||||
case MiBandConst.PREF_MI2_INACTIVITY_WARNINGS_DND_END:
|
||||
setInactivityWarnings(builder);
|
||||
break;
|
||||
}
|
||||
builder.queue(getQueue());
|
||||
} catch (IOException e) {
|
||||
@ -1238,6 +1248,60 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
return this;
|
||||
}
|
||||
|
||||
private MiBand2Support setInactivityWarnings(TransactionBuilder builder) {
|
||||
boolean enable = MiBand2Coordinator.getInactivityWarnings();
|
||||
LOG.info("Setting inactivity warnings to " + enable);
|
||||
|
||||
if (enable) {
|
||||
byte[] data = MiBand2Service.COMMAND_ENABLE_INACTIVITY_WARNINGS.clone();
|
||||
|
||||
int threshold = MiBand2Coordinator.getInactivityWarningsThreshold();
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_THRESHOLD] = (byte) threshold;
|
||||
|
||||
Calendar calendar = GregorianCalendar.getInstance();
|
||||
|
||||
boolean enableDnd = MiBand2Coordinator.getInactivityWarningsDnd();
|
||||
|
||||
Date intervalStart = MiBand2Coordinator.getInactivityWarningsStart();
|
||||
Date intervalEnd = MiBand2Coordinator.getInactivityWarningsEnd();
|
||||
Date dndStart = MiBand2Coordinator.getInactivityWarningsDndStart();
|
||||
Date dndEnd = MiBand2Coordinator.getInactivityWarningsDndEnd();
|
||||
|
||||
// The first interval always starts when the warnings interval starts
|
||||
calendar.setTime(intervalStart);
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_INTERVAL_1_START_HOURS] = (byte) calendar.get(Calendar.HOUR_OF_DAY);
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_INTERVAL_1_START_MINUTES] = (byte) calendar.get(Calendar.MINUTE);
|
||||
|
||||
if(enableDnd) {
|
||||
// The first interval ends when the dnd interval starts
|
||||
calendar.setTime(dndStart);
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_INTERVAL_1_END_HOURS] = (byte) calendar.get(Calendar.HOUR_OF_DAY);
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_INTERVAL_1_END_MINUTES] = (byte) calendar.get(Calendar.MINUTE);
|
||||
|
||||
// The second interval starts when the dnd interval ends
|
||||
calendar.setTime(dndEnd);
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_INTERVAL_2_START_HOURS] = (byte) calendar.get(Calendar.HOUR_OF_DAY);
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_INTERVAL_2_START_MINUTES] = (byte) calendar.get(Calendar.MINUTE);
|
||||
|
||||
// ... and it ends when the warnings interval ends
|
||||
calendar.setTime(intervalEnd);
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_INTERVAL_2_END_HOURS] = (byte) calendar.get(Calendar.HOUR_OF_DAY);
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_INTERVAL_2_END_MINUTES] = (byte) calendar.get(Calendar.MINUTE);
|
||||
} else {
|
||||
// No Dnd, use the first interval
|
||||
calendar.setTime(intervalEnd);
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_INTERVAL_1_END_HOURS] = (byte) calendar.get(Calendar.HOUR_OF_DAY);
|
||||
data[MiBand2Service.INACTIVITY_WARNINGS_INTERVAL_1_END_MINUTES] = (byte) calendar.get(Calendar.MINUTE);
|
||||
}
|
||||
|
||||
builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), data);
|
||||
} else {
|
||||
builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), MiBand2Service.COMMAND_DISABLE_INACTIVITY_WARNINGS);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public void phase2Initialize(TransactionBuilder builder) {
|
||||
LOG.info("phase2Initialize...");
|
||||
enableFurtherNotifications(builder, true);
|
||||
@ -1251,6 +1315,7 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
setRotateWristToSwitchInfo(builder);
|
||||
setActivateDisplayOnLiftWrist(builder);
|
||||
setGoalNotification(builder);
|
||||
setInactivityWarnings(builder);
|
||||
setHeartrateSleepSupport(builder);
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 829 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 7.7 KiB |
@ -310,6 +310,10 @@
|
||||
<string name="mi2_prefs_do_not_disturb_summary">A pulseira não recebe notificações enquanto activo</string>
|
||||
<string name="mi2_prefs_do_not_disturb_start">Hora de início</string>
|
||||
<string name="mi2_prefs_do_not_disturb_end">Hora de fim</string>
|
||||
<string name="mi2_prefs_inactivity_warnings">Avisos de inactividade</string>
|
||||
<string name="mi2_prefs_inactivity_warnings_summary">A pulseira irá vibrar quando estiver inactivo durante algum tempo</string>
|
||||
<string name="mi2_prefs_inactivity_warnings_threshold">Limite de inactividade (em minutos)</string>
|
||||
<string name="mi2_prefs_inactivity_warnings_dnd_summary">Desactivar os avisos de inactividade durante um intervalo de tempo</string>
|
||||
<string name="FetchActivityOperation_about_to_transfer_since">Prestes a transferir dados desde %1$s</string>
|
||||
<string name="waiting_for_reconnect">aguarde para tornar a ligar</string>
|
||||
<string name="activity_prefs_about_you">Sobre você</string>
|
||||
|
@ -354,6 +354,10 @@
|
||||
<string name="mi2_prefs_rotate_wrist_to_switch_info">Rotate wrist to switch info</string>
|
||||
<string name="mi2_prefs_do_not_disturb">Do Not Disturb</string>
|
||||
<string name="mi2_prefs_do_not_disturb_summary">The band won\'t receive notifications while active</string>
|
||||
<string name="mi2_prefs_inactivity_warnings">Inactivity warnings</string>
|
||||
<string name="mi2_prefs_inactivity_warnings_summary">The band will vibrate when you have been inactive for a while</string>
|
||||
<string name="mi2_prefs_inactivity_warnings_threshold">Inactivity threshold (in minutes)</string>
|
||||
<string name="mi2_prefs_inactivity_warnings_dnd_summary">Disable the inactivity warnings for a time interval</string>
|
||||
<string name="mi2_prefs_do_not_disturb_start">Start time</string>
|
||||
<string name="mi2_prefs_do_not_disturb_end">End time</string>
|
||||
<string name="FetchActivityOperation_about_to_transfer_since">About to transfer data since %1$s</string>
|
||||
|
@ -1,5 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<changelog>
|
||||
<release version="0.19.4" versioncode="97">
|
||||
<change>Replace or relicense CC-NC licensed icons to satisfy F-Droid</change>
|
||||
<change>Mi Band 2: Make infos to display on the Band configurable</change>
|
||||
<change>Mi Band 2: Support wrist rotation to switch info setting</change>
|
||||
<change>Mi Band 2: Support goal notification setting</change>
|
||||
<change>Mi Band 2: Support do not disturb setting</change>
|
||||
<change>Mi Band 2: Support inactivity warning setting </change>
|
||||
</release>
|
||||
<release version="0.19.3" versioncode="96">
|
||||
<change>Pebble: Fix crash when calendar access permission has been denied</change>
|
||||
<change>Pebble: Fix wrong timestamps with Morpheuz running on Firmware >=3</change>
|
||||
|
@ -84,6 +84,63 @@
|
||||
android:title="@string/miband2_prefs_dateformat"
|
||||
android:summary="%s" />
|
||||
|
||||
<PreferenceScreen
|
||||
android:key="mi2_inactivity_warning_key"
|
||||
android:summary="@string/mi2_prefs_inactivity_warnings_summary"
|
||||
android:title="@string/mi2_prefs_inactivity_warnings"
|
||||
android:persistent="false">
|
||||
|
||||
<!-- workaround for missing toolbar -->
|
||||
<PreferenceCategory
|
||||
android:title="@string/mi2_prefs_inactivity_warnings"
|
||||
/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="mi2_inactivity_warnings"
|
||||
android:summary="@string/mi2_prefs_inactivity_warnings_summary"
|
||||
android:title="@string/mi2_prefs_inactivity_warnings" />
|
||||
|
||||
<EditTextPreference
|
||||
android:defaultValue="60"
|
||||
android:dependency="mi2_inactivity_warnings"
|
||||
android:inputType="numberSigned"
|
||||
android:key="mi2_inactivity_warnings_threshold"
|
||||
android:maxLength="2"
|
||||
android:title="@string/mi2_prefs_inactivity_warnings_threshold" />
|
||||
|
||||
<nodomain.freeyourgadget.gadgetbridge.util.TimePreference
|
||||
android:defaultValue="06:00"
|
||||
android:dependency="mi2_inactivity_warnings"
|
||||
android:key="mi2_inactivity_warnings_start"
|
||||
android:title="@string/mi2_prefs_do_not_disturb_start" />
|
||||
|
||||
<nodomain.freeyourgadget.gadgetbridge.util.TimePreference
|
||||
android:defaultValue="22:00"
|
||||
android:dependency="mi2_inactivity_warnings"
|
||||
android:key="mi2_inactivity_warnings_end"
|
||||
android:title="@string/mi2_prefs_do_not_disturb_end" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:dependency="mi2_inactivity_warnings"
|
||||
android:key="mi2_inactivity_warnings_dnd"
|
||||
android:summary="@string/mi2_prefs_inactivity_warnings_dnd_summary"
|
||||
android:title="@string/mi2_prefs_do_not_disturb" />
|
||||
|
||||
<nodomain.freeyourgadget.gadgetbridge.util.TimePreference
|
||||
android:defaultValue="12:00"
|
||||
android:dependency="mi2_inactivity_warnings_dnd"
|
||||
android:key="mi2_inactivity_warnings_dnd_start"
|
||||
android:title="@string/mi2_prefs_do_not_disturb_start" />
|
||||
|
||||
<nodomain.freeyourgadget.gadgetbridge.util.TimePreference
|
||||
android:defaultValue="14:00"
|
||||
android:dependency="mi2_inactivity_warnings_dnd"
|
||||
android:key="mi2_inactivity_warnings_dnd_end"
|
||||
android:title="@string/mi2_prefs_do_not_disturb_end" />
|
||||
</PreferenceScreen>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceScreen
|
||||
|
8
fastlane/metadata/android/de-DE/full_description.txt
Normal file
@ -0,0 +1,8 @@
|
||||
Nutze deine Pebble/Mi Band/Hplus, ohne die proprietäre App des Herstellers, ohne ein Benutzerkonto zu erstellen, und ohne irgendwelche Daten an die Server des Herstellers zu senden.
|
||||
|
||||
Du kannst Benachrichtigungen an deinem Handgelenk erhalten, sowie (je nach Gerät):
|
||||
- Daten der Gerätesensoren sammeln
|
||||
- Die Musikwiedergabe auf deinem Android Gerät steuern
|
||||
- Wettervorhersagen angezeigt bekommen
|
||||
- Navigiert werden
|
||||
|
BIN
fastlane/metadata/android/de-DE/images/featureGraphic.jpg
Normal file
After Width: | Height: | Size: 709 KiB |
BIN
fastlane/metadata/android/de-DE/images/icon.png
Normal file
After Width: | Height: | Size: 22 KiB |
1
fastlane/metadata/android/de-DE/title.txt
Normal file
@ -0,0 +1 @@
|
||||
Gadgetbridge
|
8
fastlane/metadata/android/en-US/changelogs/96.txt
Normal file
@ -0,0 +1,8 @@
|
||||
* Pebble: Fix crash when calendar access permission has been denied
|
||||
* Pebble: Fix wrong timestamps with Morpheuz running on Firmware >=3
|
||||
* Mi Band 2: Improve reliability when fetching activity data
|
||||
* HPlus: Fix intensity calculation without continuous connectivity
|
||||
* HPlus: Fix Unicode handling
|
||||
* HPlus: Initial not work detection
|
||||
* Fix memory leak
|
||||
* Only show Realtime Chart on devices supporting it
|
6
fastlane/metadata/android/en-US/changelogs/97.txt
Normal file
@ -0,0 +1,6 @@
|
||||
* Replace or relicense CC-NC licensed icons to satisfy F-Droid
|
||||
* Mi Band 2: Make infos to display on the Band configurable
|
||||
* Mi Band 2: Support wrist rotation to switch info setting
|
||||
* Mi Band 2: Support goal notification setting
|
||||
* Mi Band 2: Support do not disturb setting
|
||||
* Mi Band 2: Support inactivity warning setting
|
7
fastlane/metadata/android/en-US/full_description.txt
Normal file
@ -0,0 +1,7 @@
|
||||
Use your Pebble/Mi Band/Hplus device without the vendor's closed source application and without the need to create an account and transmit any of your data to the vendor's servers.
|
||||
|
||||
You can get notifications on your wrist and (depending on the device):
|
||||
- collect data from the device sensors
|
||||
- control music playing on your android device
|
||||
- see the weather
|
||||
- get directions
|
BIN
fastlane/metadata/android/en-US/images/featureGraphic.jpg
Normal file
After Width: | Height: | Size: 709 KiB |
BIN
fastlane/metadata/android/en-US/images/icon.png
Normal file
After Width: | Height: | Size: 22 KiB |
1
fastlane/metadata/android/en-US/short_description.txt
Normal file
@ -0,0 +1 @@
|
||||
Use your Pebble/Mi Band/Hplus device without the vendor's closed source application and without the need to create an account and transmit any of your data to the vendor's servers.
|
1
fastlane/metadata/android/en-US/title.txt
Normal file
@ -0,0 +1 @@
|
||||
Gadgetbridge
|
8
fastlane/metadata/android/it-IT/full_description.txt
Normal file
@ -0,0 +1,8 @@
|
||||
Utilizza il tuo dispositivo Pebble/Mi Band/Hplus senza dipendere dall'applicazione proprietaria del vendor e senza bisogno di creare accounts e trasferire i tuoi dati altrove.
|
||||
|
||||
Vedi le notifiche direttamente sul tuo polso, e inoltre (a seconda del dispositivo):
|
||||
|
||||
- memorizza i dati della tua attività fisica dai sensori
|
||||
- controlla le app per riprodurre musica sul tuo dispositivo android
|
||||
- vedi le condizioni meteorologiche
|
||||
- vedi le indicazioni stradali
|
BIN
fastlane/metadata/android/it-IT/images/featureGraphic.jpg
Normal file
After Width: | Height: | Size: 709 KiB |
BIN
fastlane/metadata/android/it-IT/images/icon.png
Normal file
After Width: | Height: | Size: 22 KiB |
1
fastlane/metadata/android/it-IT/short_description.txt
Normal file
@ -0,0 +1 @@
|
||||
Utilizza il tuo dispositivo Pebble/Mi Band/Hplus senza dipendere dall'applicazione proprietaria del vendor e senza bisogno di creare accounts e trasferire i tuoi dati altrove.
|
1
fastlane/metadata/android/it-IT/title.txt
Normal file
@ -0,0 +1 @@
|
||||
Gadgetbridge
|