mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-04 09:17:29 +01:00
Merge branch 'master' into background-javascript
This commit is contained in:
commit
90c61cb71c
@ -19,7 +19,7 @@ android:
|
||||
- build-tools-25.0.2
|
||||
|
||||
# The SDK version used to compile your project
|
||||
- android-23
|
||||
- android-25
|
||||
|
||||
# Additional components
|
||||
- extra-android-m2repository
|
||||
@ -30,4 +30,4 @@ android:
|
||||
#- sys-img-armeabi-v7a-android-19
|
||||
#- sys-img-x86-android-17
|
||||
|
||||
script: ./gradlew build connectedCheck --info --stacktrace
|
||||
script: ./gradlew build connectedCheck --stacktrace
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
###Version 0.18.0 (next)
|
||||
* Added Portuguese pt_PT and pt_BR translations
|
||||
* Added Hebrew translation
|
||||
* Consistently display device specific icons already during discovery
|
||||
* Add sleep chart diplaying the last week of sleep
|
||||
|
||||
|
@ -17,13 +17,13 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
compileSdkVersion 23
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '25.0.2'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "nodomain.freeyourgadget.gadgetbridge"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 23
|
||||
targetSdkVersion 25
|
||||
|
||||
// note: always bump BOTH versionCode and versionName!
|
||||
versionName "0.18.0"
|
||||
@ -63,9 +63,9 @@ dependencies {
|
||||
testCompile "org.robolectric:robolectric:3.1.2"
|
||||
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile 'com.android.support:appcompat-v7:23.3.0'
|
||||
compile 'com.android.support:support-v4:23.3.0'
|
||||
compile 'com.android.support:design:23.3.0'
|
||||
compile 'com.android.support:appcompat-v7:25.1.1'
|
||||
compile 'com.android.support:support-v4:25.1.1'
|
||||
compile 'com.android.support:design:25.1.1'
|
||||
compile 'com.github.tony19:logback-android-classic:1.1.1-4'
|
||||
compile 'org.slf4j:slf4j-api:1.7.7'
|
||||
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
|
||||
|
@ -47,6 +47,8 @@ public abstract class AbstractWeekChartFragment extends AbstractChartFragment {
|
||||
private PieChart mTodayPieChart;
|
||||
private BarChart mWeekChart;
|
||||
|
||||
private int mOffsetHours = getOffsetHours();
|
||||
|
||||
@Override
|
||||
protected ChartsData refreshInBackground(ChartsHost chartsHost, DBHandler db, GBDevice device) {
|
||||
Calendar day = Calendar.getInstance();
|
||||
@ -213,7 +215,7 @@ public abstract class AbstractWeekChartFragment extends AbstractChartFragment {
|
||||
// chart.getLegend().setTextColor(LEGEND_TEXT_COLOR);
|
||||
}
|
||||
|
||||
private List<? extends ActivitySample> getSamplesOfDay(DBHandler db, Calendar day, GBDevice device) {
|
||||
private List<? extends ActivitySample> getSamplesOfDay(DBHandler db, Calendar day, int offsetHours, GBDevice device) {
|
||||
int startTs;
|
||||
int endTs;
|
||||
|
||||
@ -221,12 +223,10 @@ public abstract class AbstractWeekChartFragment extends AbstractChartFragment {
|
||||
day.set(Calendar.HOUR_OF_DAY, 0);
|
||||
day.set(Calendar.MINUTE, 0);
|
||||
day.set(Calendar.SECOND, 0);
|
||||
startTs = (int) (day.getTimeInMillis() / 1000);
|
||||
day.add(Calendar.HOUR, offsetHours);
|
||||
|
||||
day.set(Calendar.HOUR_OF_DAY, 23);
|
||||
day.set(Calendar.MINUTE, 59);
|
||||
day.set(Calendar.SECOND, 59);
|
||||
endTs = (int) (day.getTimeInMillis() / 1000);
|
||||
startTs = (int) (day.getTimeInMillis() / 1000);
|
||||
endTs = startTs + 24 * 60 * 60 - 1;
|
||||
|
||||
return getSamples(db, device, startTs, endTs);
|
||||
}
|
||||
@ -272,14 +272,14 @@ public abstract class AbstractWeekChartFragment extends AbstractChartFragment {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null) {
|
||||
activityAmountCache = ((ChartsActivity) activity).mActivityAmountCache;
|
||||
amounts = (ActivityAmounts) (activityAmountCache.lookup(day.hashCode()));
|
||||
amounts = (ActivityAmounts) (activityAmountCache.lookup(day.hashCode() ^ mOffsetHours));
|
||||
}
|
||||
|
||||
if (amounts == null) {
|
||||
ActivityAnalysis analysis = new ActivityAnalysis();
|
||||
amounts = analysis.calculateActivityAmounts(getSamplesOfDay(db, day, device));
|
||||
amounts = analysis.calculateActivityAmounts(getSamplesOfDay(db, day, mOffsetHours, device));
|
||||
if (activityAmountCache != null) {
|
||||
activityAmountCache.add(day.hashCode(), amounts);
|
||||
activityAmountCache.add(day.hashCode() ^ mOffsetHours, amounts);
|
||||
}
|
||||
}
|
||||
|
||||
@ -288,6 +288,8 @@ public abstract class AbstractWeekChartFragment extends AbstractChartFragment {
|
||||
|
||||
abstract int getGoal();
|
||||
|
||||
abstract int getOffsetHours();
|
||||
|
||||
abstract float[] getTotalsForActivityAmounts(ActivityAmounts activityAmounts);
|
||||
|
||||
abstract String formatPieValue(int value);
|
||||
|
@ -53,7 +53,7 @@ public class ChartsActivity extends AbstractGBFragmentActivity implements Charts
|
||||
private PagerTabStrip mPagerTabStrip;
|
||||
private ViewPager viewPager;
|
||||
|
||||
LimitedQueue mActivityAmountCache = new LimitedQueue(32);
|
||||
LimitedQueue mActivityAmountCache = new LimitedQueue(60);
|
||||
|
||||
private static class ShowDurationDialog extends Dialog {
|
||||
private final String mDuration;
|
||||
|
@ -30,6 +30,11 @@ public class WeekSleepChartFragment extends AbstractWeekChartFragment {
|
||||
return 8 * 60; // FIXME
|
||||
}
|
||||
|
||||
@Override
|
||||
int getOffsetHours() {
|
||||
return -12;
|
||||
}
|
||||
|
||||
@Override
|
||||
float[] getTotalsForActivityAmounts(ActivityAmounts activityAmounts) {
|
||||
long totalSecondsDeepSleep = 0;
|
||||
|
@ -29,6 +29,11 @@ public class WeekStepsChartFragment extends AbstractWeekChartFragment {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
int getOffsetHours() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
float[] getTotalsForActivityAmounts(ActivityAmounts activityAmounts) {
|
||||
int totalSteps = 0;
|
||||
|
@ -128,6 +128,8 @@ public class MiBand2Service {
|
||||
public static final byte[] COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{0x06, 0x05, 0x00, 0x01};
|
||||
public static final byte[] COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{0x06, 0x05, 0x00, 0x00};
|
||||
|
||||
public static final byte[] COMMAND_TEXT_NOTIFICATION = new byte[] {0x05, 0x01};
|
||||
public static final byte[] COMMAND_TEXT_NOTIFICATION_CONTINUATION = new byte[] {(byte) 0xfa, 0x01, 0x00};
|
||||
|
||||
static {
|
||||
MIBAND_DEBUG = new HashMap<>();
|
||||
|
@ -5,6 +5,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.pebble.PebbleIconID;
|
||||
|
||||
public enum NotificationType {
|
||||
|
||||
// TODO: this this pebbleism needs to be moved somewhere else
|
||||
UNKNOWN(PebbleIconID.NOTIFICATION_GENERIC, PebbleColor.Red),
|
||||
|
||||
CONVERSATIONS(PebbleIconID.NOTIFICATION_HIPCHAT, PebbleColor.Inchworm),
|
||||
@ -19,6 +20,7 @@ public enum NotificationType {
|
||||
TELEGRAM(PebbleIconID.NOTIFICATION_TELEGRAM, PebbleColor.PictonBlue),
|
||||
WHATSAPP(PebbleIconID.NOTIFICATION_WHATSAPP, PebbleColor.MayGreen),
|
||||
GENERIC_ALARM_CLOCK(PebbleIconID.ALARM_CLOCK, PebbleColor.Red);
|
||||
// Note: if you add any more constants, update all clients as well
|
||||
|
||||
public int icon;
|
||||
public byte color;
|
||||
|
@ -1,10 +1,13 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.btle;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.NotificationType;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.AlertCategory;
|
||||
|
||||
/**
|
||||
* Provides methods to convert standard BLE units to byte sequences and vice versa.
|
||||
@ -233,4 +236,33 @@ public class BLETypeConversions {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static byte[] toUtf8s(String message) {
|
||||
return message.getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
public static AlertCategory toAlertCategory(NotificationType type) {
|
||||
switch (type) {
|
||||
case GENERIC_ALARM_CLOCK:
|
||||
return AlertCategory.HighPriorityAlert;
|
||||
case GENERIC_SMS:
|
||||
return AlertCategory.SMS;
|
||||
case GENERIC_EMAIL:
|
||||
return AlertCategory.Email;
|
||||
case GENERIC_NAVIGATION:
|
||||
return AlertCategory.Simple;
|
||||
case RIOT:
|
||||
case SIGNAL:
|
||||
case TELEGRAM:
|
||||
case WHATSAPP:
|
||||
case CONVERSATIONS:
|
||||
case FACEBOOK:
|
||||
case FACEBOOK_MESSENGER:
|
||||
case TWITTER:
|
||||
return AlertCategory.InstantMessage;
|
||||
case UNKNOWN:
|
||||
return AlertCategory.Simple;
|
||||
}
|
||||
return AlertCategory.Simple;
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ public class GattCharacteristic {
|
||||
public static final UUID UUID_CHARACTERISTIC_ALERT_CATEGORY_ID = UUID.fromString((String.format(AbstractBTLEDeviceSupport.BASE_UUID, "2A43")));
|
||||
public static final UUID UUID_CHARACTERISTIC_ALERT_CATEGORY_ID_BIT_MASK = UUID.fromString((String.format(AbstractBTLEDeviceSupport.BASE_UUID, "2A42")));
|
||||
public static final UUID UUID_CHARACTERISTIC_ALERT_LEVEL = UUID.fromString((String.format(AbstractBTLEDeviceSupport.BASE_UUID, "2A06")));
|
||||
public static final UUID UUID_CHARACTERISTIC_CLIENT_CHARACTERISTIC_CONFIG = UUID.fromString((String.format(AbstractBTLEDeviceSupport.BASE_UUID, "2902")));
|
||||
|
||||
public static final byte NO_ALERT = 0x0;
|
||||
public static final byte MILD_ALERT = 0x1;
|
||||
|
@ -1,12 +1,66 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification;
|
||||
|
||||
import android.bluetooth.BluetoothGattCharacteristic;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.BLETypeConversions;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattCharacteristic;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.AbstractBleProfile;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.StringUtils;
|
||||
|
||||
public class AlertNotificationProfile<T extends AbstractBTLEDeviceSupport> extends AbstractBleProfile<T> {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(AlertNotificationProfile.class);
|
||||
private static final int MAX_MSG_LENGTH = 18;
|
||||
|
||||
public AlertNotificationProfile(T support) {
|
||||
super(support);
|
||||
}
|
||||
|
||||
public void newAlert(TransactionBuilder builder, NewAlert alert, OverflowStrategy strategy) {
|
||||
BluetoothGattCharacteristic characteristic = getCharacteristic(GattCharacteristic.UUID_CHARACTERISTIC_NEW_ALERT);
|
||||
if (characteristic != null) {
|
||||
String message = alert.getMessage();
|
||||
if (message.length() > MAX_MSG_LENGTH && strategy == OverflowStrategy.TRUNCATE) {
|
||||
message = StringUtils.truncate(message, MAX_MSG_LENGTH);
|
||||
}
|
||||
|
||||
int numChunks = message.length() / MAX_MSG_LENGTH;
|
||||
if (message.length() % MAX_MSG_LENGTH > 0) {
|
||||
numChunks++;
|
||||
}
|
||||
|
||||
for (int i = 0; i < numChunks; i++) {
|
||||
int offset = i * MAX_MSG_LENGTH;
|
||||
int restLength = message.length() - offset;
|
||||
message = message.substring(offset, offset + Math.min(MAX_MSG_LENGTH, restLength));
|
||||
if (message.length() == 0) {
|
||||
break;
|
||||
}
|
||||
writeAlertMessage(builder, characteristic, alert, message, i);
|
||||
}
|
||||
} else {
|
||||
LOG.warn("NEW_ALERT characteristic not available");
|
||||
}
|
||||
}
|
||||
|
||||
protected void writeAlertMessage(TransactionBuilder builder, BluetoothGattCharacteristic characteristic, NewAlert alert, String message, int chunk) {
|
||||
try {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream(100);
|
||||
stream.write(alert.getCategory().getId());
|
||||
stream.write(alert.getNumAlerts());
|
||||
stream.write(BLETypeConversions.toUtf8s(message));
|
||||
|
||||
builder.write(characteristic, stream.toByteArray());
|
||||
} catch (IOException ex) {
|
||||
// aint gonna happen
|
||||
LOG.error("Error writing alert message to ByteArrayOutputStream");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification;
|
||||
|
||||
/**
|
||||
* https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.new_alert.xml&u=org.bluetooth.characteristic.new_alert.xml
|
||||
*
|
||||
Recommended Usage for Text String Information Field in New Incoming Alert:
|
||||
|
||||
The usage of this text is up to the implementation, but the recommended text for the category is defined as following for best user experience:
|
||||
|
||||
Category: Simple Alert - The title of the alert
|
||||
|
||||
Category: Email - Sender name
|
||||
|
||||
Category: News - Title of the news feed
|
||||
|
||||
Category: Call - Caller name or caller ID
|
||||
|
||||
Category: Missed call - Caller name or caller ID
|
||||
|
||||
Category: SMS - Sender name or caller ID
|
||||
|
||||
Category: Voice mail - Sender name or caller ID
|
||||
|
||||
Category: Schedule - Title of the schedule
|
||||
|
||||
Category Hig:h Prioritized Aler - Title of the alert
|
||||
|
||||
Category: Instant Messaging - Sender name
|
||||
*/
|
||||
public class NewAlert {
|
||||
private final AlertCategory category;
|
||||
private final int numAlerts;
|
||||
private final String message;
|
||||
|
||||
public NewAlert(AlertCategory category, int /*uint8*/ numAlerts, String /*utf8s*/ message) {
|
||||
this.category = category;
|
||||
this.numAlerts = numAlerts;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public AlertCategory getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public int getNumAlerts() {
|
||||
return numAlerts;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification;
|
||||
|
||||
public enum OverflowStrategy {
|
||||
TRUNCATE,
|
||||
MAKE_MULTIPLE
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.common;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.AlertCategory;
|
||||
|
||||
public class SimpleNotification {
|
||||
private final String message;
|
||||
private final AlertCategory alertCategory;
|
||||
|
||||
public SimpleNotification(String message, AlertCategory alertCategory) {
|
||||
this.message = message;
|
||||
this.alertCategory = alertCategory;
|
||||
}
|
||||
|
||||
public AlertCategory getAlertCategory() {
|
||||
return alertCategory;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
@ -53,6 +53,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.NotificationType;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.BLETypeConversions;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattCharacteristic;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattService;
|
||||
@ -61,10 +62,13 @@ import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.AbortTransactio
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.ConditionalWriteAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.SetDeviceStateAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.WriteAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.AlertCategory;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.common.SimpleNotification;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband.operations.FetchActivityOperation;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband.operations.UpdateFirmwareOperation;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.NotificationUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
|
||||
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.DEFAULT_VALUE_FLASH_COLOUR;
|
||||
@ -205,19 +209,19 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||
return mDeviceInfo;
|
||||
}
|
||||
|
||||
private MiBandSupport sendDefaultNotification(TransactionBuilder builder, short repeat, BtLEAction extraAction) {
|
||||
private MiBandSupport sendDefaultNotification(TransactionBuilder builder, SimpleNotification simpleNotification, short repeat, BtLEAction extraAction) {
|
||||
LOG.info("Sending notification to MiBand: (" + repeat + " times)");
|
||||
NotificationStrategy strategy = getNotificationStrategy();
|
||||
for (short i = 0; i < repeat; i++) {
|
||||
strategy.sendDefaultNotification(builder, extraAction);
|
||||
strategy.sendDefaultNotification(builder, simpleNotification, extraAction);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a custom notification to the given transaction builder
|
||||
*
|
||||
* @param vibrationProfile specifies how and how often the Band shall vibrate.
|
||||
* @param vibrationProfile specifies how and how often the Band shall vibrate.
|
||||
* @param simpleNotification
|
||||
* @param flashTimes
|
||||
* @param flashColour
|
||||
* @param originalColour
|
||||
@ -225,8 +229,8 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||
* @param extraAction an extra action to be executed after every vibration and flash sequence. Allows to abort the repetition, for example.
|
||||
* @param builder
|
||||
*/
|
||||
private MiBandSupport sendCustomNotification(VibrationProfile vibrationProfile, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
getNotificationStrategy().sendCustomNotification(vibrationProfile, flashTimes, flashColour, originalColour, flashDuration, extraAction, builder);
|
||||
private MiBandSupport sendCustomNotification(VibrationProfile vibrationProfile, SimpleNotification simpleNotification, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
getNotificationStrategy().sendCustomNotification(vibrationProfile, simpleNotification, flashTimes, flashColour, originalColour, flashDuration, extraAction, builder);
|
||||
LOG.info("Sending notification to MiBand");
|
||||
return this;
|
||||
}
|
||||
@ -454,17 +458,17 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||
return this;
|
||||
}
|
||||
|
||||
private void performDefaultNotification(String task, short repeat, BtLEAction extraAction) {
|
||||
private void performDefaultNotification(String task, SimpleNotification simpleNotification, short repeat, BtLEAction extraAction) {
|
||||
try {
|
||||
TransactionBuilder builder = performInitialized(task);
|
||||
sendDefaultNotification(builder, repeat, extraAction);
|
||||
sendDefaultNotification(builder, simpleNotification, repeat, extraAction);
|
||||
builder.queue(getQueue());
|
||||
} catch (IOException ex) {
|
||||
LOG.error("Unable to send notification to MI device", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void performPreferredNotification(String task, String notificationOrigin, BtLEAction extraAction) {
|
||||
private void performPreferredNotification(String task, SimpleNotification simpleNotification, String notificationOrigin, BtLEAction extraAction) {
|
||||
try {
|
||||
TransactionBuilder builder = performInitialized(task);
|
||||
Prefs prefs = GBApplication.getPrefs();
|
||||
@ -479,7 +483,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||
int flashDuration = getPreferredFlashDuration(notificationOrigin, prefs);
|
||||
|
||||
// setLowLatency(builder);
|
||||
sendCustomNotification(profile, flashTimes, flashColour, originalColour, flashDuration, extraAction, builder);
|
||||
sendCustomNotification(profile, simpleNotification, flashTimes, flashColour, originalColour, flashDuration, extraAction, builder);
|
||||
// setHighLatency(builder);
|
||||
// sendCustomNotification(vibrateDuration, vibrateTimes, vibratePause, flashTimes, flashColour, originalColour, flashDuration, builder);
|
||||
builder.queue(getQueue());
|
||||
@ -549,8 +553,11 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||
return;
|
||||
}
|
||||
|
||||
String message = NotificationUtils.getPreferredTextFor(notificationSpec, 40, 40, getContext()).trim();
|
||||
SimpleNotification simpleNotification = new SimpleNotification(message, BLETypeConversions.toAlertCategory(notificationSpec.type));
|
||||
|
||||
String origin = notificationSpec.type.getGenericType();
|
||||
performPreferredNotification(origin + " received", origin, null);
|
||||
performPreferredNotification(origin + " received", simpleNotification, origin, null);
|
||||
}
|
||||
|
||||
private void onAlarmClock(NotificationSpec notificationSpec) {
|
||||
@ -561,7 +568,9 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||
return !isAlarmClockRinging();
|
||||
}
|
||||
};
|
||||
performPreferredNotification("alarm clock ringing", MiBandConst.ORIGIN_ALARM_CLOCK, abortAction);
|
||||
String message = NotificationUtils.getPreferredTextFor(notificationSpec, 40, 40, getContext());
|
||||
SimpleNotification simpleNotification = new SimpleNotification(message, AlertCategory.HighPriorityAlert);
|
||||
performPreferredNotification("alarm clock ringing", simpleNotification, MiBandConst.ORIGIN_ALARM_CLOCK, abortAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -625,7 +634,9 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||
return !isTelephoneRinging();
|
||||
}
|
||||
};
|
||||
performPreferredNotification("incoming call", MiBandConst.ORIGIN_INCOMING_CALL, abortAction);
|
||||
String message = NotificationUtils.getPreferredTextFor(callSpec);
|
||||
SimpleNotification simpleNotification = new SimpleNotification(message, AlertCategory.IncomingCall);
|
||||
performPreferredNotification("incoming call", simpleNotification, MiBandConst.ORIGIN_INCOMING_CALL, abortAction);
|
||||
} else if ((callSpec.command == CallSpec.CALL_START) || (callSpec.command == CallSpec.CALL_END)) {
|
||||
telephoneRinging = false;
|
||||
}
|
||||
@ -716,7 +727,8 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||
return !isLocatingDevice;
|
||||
}
|
||||
};
|
||||
performDefaultNotification("locating device", (short) 255, abortAction);
|
||||
SimpleNotification simpleNotification = new SimpleNotification(getContext().getString(R.string.find_device_you_found_it), AlertCategory.HighPriorityAlert);
|
||||
performDefaultNotification("locating device", simpleNotification, (short) 255, abortAction);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import org.slf4j.LoggerFactory;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.miband.VibrationProfile;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.common.SimpleNotification;
|
||||
|
||||
/**
|
||||
* Does not do anything.
|
||||
@ -14,12 +15,12 @@ public class NoNotificationStrategy implements NotificationStrategy {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(NoNotificationStrategy.class);
|
||||
|
||||
@Override
|
||||
public void sendDefaultNotification(TransactionBuilder builder, BtLEAction extraAction) {
|
||||
public void sendDefaultNotification(TransactionBuilder builder, SimpleNotification simpleNotification, BtLEAction extraAction) {
|
||||
LOG.info("dummy notification stragegy: default notification");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCustomNotification(VibrationProfile vibrationProfile, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
LOG.info("dummy notification stragegy: custom notification");
|
||||
public void sendCustomNotification(VibrationProfile vibrationProfile, SimpleNotification simpleNotification, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
LOG.info("dummy notification stragegy: custom notification: " + simpleNotification);
|
||||
}
|
||||
}
|
||||
|
@ -3,14 +3,15 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.miband;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.miband.VibrationProfile;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.common.SimpleNotification;
|
||||
|
||||
public interface NotificationStrategy {
|
||||
void sendDefaultNotification(TransactionBuilder builder, BtLEAction extraAction);
|
||||
void sendDefaultNotification(TransactionBuilder builder, SimpleNotification simpleNotification, BtLEAction extraAction);
|
||||
|
||||
/**
|
||||
* Adds a custom notification to the given transaction builder
|
||||
*
|
||||
* @param vibrationProfile specifies how and how often the Band shall vibrate.
|
||||
* @param simpleNotification
|
||||
* @param flashTimes
|
||||
* @param flashColour
|
||||
* @param originalColour
|
||||
@ -18,5 +19,5 @@ public interface NotificationStrategy {
|
||||
* @param extraAction an extra action to be executed after every vibration and flash sequence. Allows to abort the repetition, for example.
|
||||
* @param builder
|
||||
*/
|
||||
void sendCustomNotification(VibrationProfile vibrationProfile, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder);
|
||||
void sendCustomNotification(VibrationProfile vibrationProfile, SimpleNotification simpleNotification, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.miband.VibrationProfile;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.common.SimpleNotification;
|
||||
|
||||
public class V1NotificationStrategy implements NotificationStrategy {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(V1NotificationStrategy.class);
|
||||
@ -24,7 +25,7 @@ public class V1NotificationStrategy implements NotificationStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendDefaultNotification(TransactionBuilder builder, BtLEAction extraAction) {
|
||||
public void sendDefaultNotification(TransactionBuilder builder, SimpleNotification simpleNotification, BtLEAction extraAction) {
|
||||
BluetoothGattCharacteristic characteristic = support.getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT);
|
||||
builder.write(characteristic, getDefaultNotification());
|
||||
builder.add(extraAction);
|
||||
@ -53,8 +54,8 @@ public class V1NotificationStrategy implements NotificationStrategy {
|
||||
|
||||
/**
|
||||
* Adds a custom notification to the given transaction builder
|
||||
*
|
||||
* @param vibrationProfile specifies how and how often the Band shall vibrate.
|
||||
* @param simpleNotification
|
||||
* @param flashTimes
|
||||
* @param flashColour
|
||||
* @param originalColour
|
||||
@ -63,7 +64,7 @@ public class V1NotificationStrategy implements NotificationStrategy {
|
||||
* @param builder
|
||||
*/
|
||||
@Override
|
||||
public void sendCustomNotification(VibrationProfile vibrationProfile, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
public void sendCustomNotification(VibrationProfile vibrationProfile, SimpleNotification simpleNotification, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
BluetoothGattCharacteristic controlPoint = support.getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT);
|
||||
for (short i = 0; i < vibrationProfile.getRepeat(); i++) {
|
||||
int[] onOffSequence = vibrationProfile.getOnOffSequence();
|
||||
|
@ -7,6 +7,10 @@ import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSuppo
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattCharacteristic;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.AlertNotificationProfile;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.NewAlert;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.OverflowStrategy;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.common.SimpleNotification;
|
||||
|
||||
public class V2NotificationStrategy implements NotificationStrategy {
|
||||
private final AbstractBTLEDeviceSupport support;
|
||||
@ -20,12 +24,12 @@ public class V2NotificationStrategy implements NotificationStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendDefaultNotification(TransactionBuilder builder, BtLEAction extraAction) {
|
||||
public void sendDefaultNotification(TransactionBuilder builder, SimpleNotification simpleNotification, BtLEAction extraAction) {
|
||||
VibrationProfile profile = VibrationProfile.getProfile(VibrationProfile.ID_MEDIUM, (short) 3);
|
||||
sendCustomNotification(profile, extraAction, builder);
|
||||
sendCustomNotification(profile, simpleNotification, extraAction, builder);
|
||||
}
|
||||
|
||||
protected void sendCustomNotification(VibrationProfile vibrationProfile, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
protected void sendCustomNotification(VibrationProfile vibrationProfile, SimpleNotification simpleNotification, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
//use the new alert characteristic
|
||||
BluetoothGattCharacteristic alert = support.getCharacteristic(GattCharacteristic.UUID_CHARACTERISTIC_ALERT_LEVEL);
|
||||
for (short i = 0; i < vibrationProfile.getRepeat(); i++) {
|
||||
@ -49,11 +53,18 @@ public class V2NotificationStrategy implements NotificationStrategy {
|
||||
}
|
||||
}
|
||||
}
|
||||
sendAlert(simpleNotification, builder);
|
||||
}
|
||||
|
||||
protected void sendAlert(SimpleNotification simpleNotification, TransactionBuilder builder) {
|
||||
AlertNotificationProfile<?> profile = new AlertNotificationProfile<>(getSupport());
|
||||
NewAlert alert = new NewAlert(simpleNotification.getAlertCategory(), 1, simpleNotification.getMessage());
|
||||
profile.newAlert(builder, alert, OverflowStrategy.MAKE_MULTIPLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCustomNotification(VibrationProfile vibrationProfile, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
public void sendCustomNotification(VibrationProfile vibrationProfile, SimpleNotification simpleNotification, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
// all other parameters are unfortunately not supported anymore ;-(
|
||||
sendCustomNotification(vibrationProfile, extraAction, builder);
|
||||
sendCustomNotification(vibrationProfile, simpleNotification, extraAction, builder);
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSuppo
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.GattCharacteristic;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.AlertNotificationProfile;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.common.SimpleNotification;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband.V2NotificationStrategy;
|
||||
|
||||
public class Mi2NotificationStrategy extends V2NotificationStrategy {
|
||||
@ -16,7 +18,7 @@ public class Mi2NotificationStrategy extends V2NotificationStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendCustomNotification(VibrationProfile vibrationProfile, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
protected void sendCustomNotification(VibrationProfile vibrationProfile, SimpleNotification simpleNotification, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
//use the new alert characteristic
|
||||
BluetoothGattCharacteristic alert = getSupport().getCharacteristic(GattCharacteristic.UUID_CHARACTERISTIC_ALERT_LEVEL);
|
||||
for (short i = 0; i < vibrationProfile.getRepeat(); i++) {
|
||||
@ -38,11 +40,13 @@ public class Mi2NotificationStrategy extends V2NotificationStrategy {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCustomNotification(VibrationProfile vibrationProfile, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
public void sendCustomNotification(VibrationProfile vibrationProfile, SimpleNotification simpleNotification, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
// all other parameters are unfortunately not supported anymore ;-(
|
||||
sendCustomNotification(vibrationProfile, extraAction, builder);
|
||||
sendCustomNotification(vibrationProfile, simpleNotification, extraAction, builder);
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -67,8 +68,10 @@ import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.AbortTransactionAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.SetDeviceStateAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.WriteAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.AlertCategory;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.deviceinfo.DeviceInfoProfile;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.heartrate.HeartRateProfile;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.common.SimpleNotification;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband.CheckAuthenticationNeededAction;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband.DeviceInfo;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband.NotificationStrategy;
|
||||
@ -79,7 +82,9 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.miband2.operations.I
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.miband2.operations.UpdateFirmwareOperation;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.NotificationUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.StringUtils;
|
||||
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.DEFAULT_VALUE_FLASH_COLOUR;
|
||||
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.DEFAULT_VALUE_FLASH_COUNT;
|
||||
@ -301,19 +306,19 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
return mDeviceInfo;
|
||||
}
|
||||
|
||||
private MiBand2Support sendDefaultNotification(TransactionBuilder builder, short repeat, BtLEAction extraAction) {
|
||||
private MiBand2Support sendDefaultNotification(TransactionBuilder builder, SimpleNotification simpleNotification, short repeat, BtLEAction extraAction) {
|
||||
LOG.info("Sending notification to MiBand: (" + repeat + " times)");
|
||||
NotificationStrategy strategy = getNotificationStrategy();
|
||||
for (short i = 0; i < repeat; i++) {
|
||||
strategy.sendDefaultNotification(builder, extraAction);
|
||||
strategy.sendDefaultNotification(builder, simpleNotification, extraAction);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a custom notification to the given transaction builder
|
||||
*
|
||||
* @param vibrationProfile specifies how and how often the Band shall vibrate.
|
||||
* @param simpleNotification
|
||||
* @param flashTimes
|
||||
* @param flashColour
|
||||
* @param originalColour
|
||||
@ -321,8 +326,8 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
* @param extraAction an extra action to be executed after every vibration and flash sequence. Allows to abort the repetition, for example.
|
||||
* @param builder
|
||||
*/
|
||||
private MiBand2Support sendCustomNotification(VibrationProfile vibrationProfile, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
getNotificationStrategy().sendCustomNotification(vibrationProfile, flashTimes, flashColour, originalColour, flashDuration, extraAction, builder);
|
||||
private MiBand2Support sendCustomNotification(VibrationProfile vibrationProfile, SimpleNotification simpleNotification, int flashTimes, int flashColour, int originalColour, long flashDuration, BtLEAction extraAction, TransactionBuilder builder) {
|
||||
getNotificationStrategy().sendCustomNotification(vibrationProfile, simpleNotification, flashTimes, flashColour, originalColour, flashDuration, extraAction, builder);
|
||||
LOG.info("Sending notification to MiBand");
|
||||
return this;
|
||||
}
|
||||
@ -500,17 +505,17 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
return this;
|
||||
}
|
||||
|
||||
private void performDefaultNotification(String task, short repeat, BtLEAction extraAction) {
|
||||
private void performDefaultNotification(String task, SimpleNotification simpleNotification, short repeat, BtLEAction extraAction) {
|
||||
try {
|
||||
TransactionBuilder builder = performInitialized(task);
|
||||
sendDefaultNotification(builder, repeat, extraAction);
|
||||
sendDefaultNotification(builder, simpleNotification, repeat, extraAction);
|
||||
builder.queue(getQueue());
|
||||
} catch (IOException ex) {
|
||||
LOG.error("Unable to send notification to MI device", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void performPreferredNotification(String task, String notificationOrigin, int alertLevel, BtLEAction extraAction) {
|
||||
private void performPreferredNotification(String task, String notificationOrigin, SimpleNotification simpleNotification, int alertLevel, BtLEAction extraAction) {
|
||||
try {
|
||||
TransactionBuilder builder = performInitialized(task);
|
||||
Prefs prefs = GBApplication.getPrefs();
|
||||
@ -525,7 +530,7 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
int originalColour = getPreferredOriginalColour(notificationOrigin, prefs);
|
||||
int flashDuration = getPreferredFlashDuration(notificationOrigin, prefs);
|
||||
|
||||
sendCustomNotification(profile, flashTimes, flashColour, originalColour, flashDuration, extraAction, builder);
|
||||
sendCustomNotification(profile, simpleNotification, flashTimes, flashColour, originalColour, flashDuration, extraAction, builder);
|
||||
// sendCustomNotification(vibrateDuration, vibrateTimes, vibratePause, flashTimes, flashColour, originalColour, flashDuration, builder);
|
||||
builder.queue(getQueue());
|
||||
} catch (IOException ex) {
|
||||
@ -597,8 +602,10 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
if (notificationSpec.type == NotificationType.UNKNOWN) {
|
||||
alertLevel = MiBand2Service.ALERT_LEVEL_VIBRATE_ONLY;
|
||||
}
|
||||
String message = NotificationUtils.getPreferredTextFor(notificationSpec, 40, 40, getContext()).trim();
|
||||
String origin = notificationSpec.type.getGenericType();
|
||||
performPreferredNotification(origin + " received", origin, alertLevel, null);
|
||||
SimpleNotification simpleNotification = new SimpleNotification(message, BLETypeConversions.toAlertCategory(notificationSpec.type));
|
||||
performPreferredNotification(origin + " received", origin, simpleNotification, alertLevel, null);
|
||||
}
|
||||
|
||||
private void onAlarmClock(NotificationSpec notificationSpec) {
|
||||
@ -609,7 +616,9 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
return !isAlarmClockRinging();
|
||||
}
|
||||
};
|
||||
performPreferredNotification("alarm clock ringing", MiBandConst.ORIGIN_ALARM_CLOCK, MiBand2Service.ALERT_LEVEL_VIBRATE_ONLY, abortAction);
|
||||
String message = NotificationUtils.getPreferredTextFor(notificationSpec, 40, 40, getContext());
|
||||
SimpleNotification simpleNotification = new SimpleNotification(message, AlertCategory.HighPriorityAlert);
|
||||
performPreferredNotification("alarm clock ringing", MiBandConst.ORIGIN_ALARM_CLOCK, simpleNotification, MiBand2Service.ALERT_LEVEL_VIBRATE_ONLY, abortAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -640,7 +649,9 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
return !isTelephoneRinging();
|
||||
}
|
||||
};
|
||||
performPreferredNotification("incoming call", MiBandConst.ORIGIN_INCOMING_CALL, MiBand2Service.ALERT_LEVEL_PHONE_CALL, abortAction);
|
||||
String message = NotificationUtils.getPreferredTextFor(callSpec);
|
||||
SimpleNotification simpleNotification = new SimpleNotification(message, AlertCategory.IncomingCall);
|
||||
performPreferredNotification("incoming call", MiBandConst.ORIGIN_INCOMING_CALL, simpleNotification, MiBand2Service.ALERT_LEVEL_PHONE_CALL, abortAction);
|
||||
} else if ((callSpec.command == CallSpec.CALL_START) || (callSpec.command == CallSpec.CALL_END)) {
|
||||
telephoneRinging = false;
|
||||
}
|
||||
@ -722,7 +733,8 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
return !isLocatingDevice;
|
||||
}
|
||||
};
|
||||
performDefaultNotification("locating device", (short) 255, abortAction);
|
||||
SimpleNotification simpleNotification = new SimpleNotification(getContext().getString(R.string.find_device_you_found_it), AlertCategory.HighPriorityAlert.HighPriorityAlert);
|
||||
performDefaultNotification("locating device", simpleNotification, (short) 255, abortAction);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,46 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
||||
|
||||
public class NotificationUtils {
|
||||
@NonNull
|
||||
public static String getPreferredTextFor(NotificationSpec notificationSpec, int lengthBody, int lengthSubject, Context context) {
|
||||
switch (notificationSpec.type) {
|
||||
case GENERIC_ALARM_CLOCK:
|
||||
return StringUtils.getFirstOf(notificationSpec.title, notificationSpec.subject);
|
||||
case GENERIC_SMS:
|
||||
case GENERIC_EMAIL:
|
||||
return formatText(notificationSpec.sender, notificationSpec.subject, notificationSpec.body, lengthBody, lengthSubject, context);
|
||||
case GENERIC_NAVIGATION:
|
||||
return StringUtils.getFirstOf(notificationSpec.title, notificationSpec.body);
|
||||
case RIOT:
|
||||
case SIGNAL:
|
||||
case TELEGRAM:
|
||||
case TWITTER:
|
||||
case WHATSAPP:
|
||||
case CONVERSATIONS:
|
||||
case FACEBOOK:
|
||||
case FACEBOOK_MESSENGER:
|
||||
return notificationSpec.body;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static String formatText(String sender, String subject, String body, int lengthBody, int lengthSubject, Context context) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(StringUtils.truncate(body, lengthBody));
|
||||
builder.append(StringUtils.truncate(subject, lengthSubject));
|
||||
builder.append(StringUtils.formatSender(sender, context));
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public static String getPreferredTextFor(CallSpec callSpec) {
|
||||
return StringUtils.getFirstOf(callSpec.name, callSpec.number);
|
||||
}
|
||||
}
|
@ -1,12 +1,21 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
|
||||
public class StringUtils {
|
||||
|
||||
public static String truncate(String s, int maxLength){
|
||||
int length = Math.min(s.length(), maxLength);
|
||||
|
||||
if(length < 0)
|
||||
if (s == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
int length = Math.min(s.length(), maxLength);
|
||||
if(length < 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return s.substring(0, length);
|
||||
}
|
||||
@ -16,10 +25,28 @@ public class StringUtils {
|
||||
}
|
||||
|
||||
public static String pad(String s, int length, char padChar){
|
||||
|
||||
while(s.length() < length)
|
||||
while(s.length() < length) {
|
||||
s += padChar;
|
||||
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static String formatSender(String sender, Context context) {
|
||||
if (sender == null || sender.length() == 0) {
|
||||
return "";
|
||||
}
|
||||
return context.getString(R.string.StringUtils_sender, sender);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static String getFirstOf(String first, String second) {
|
||||
if (first != null && first.length() > 0) {
|
||||
return first;
|
||||
}
|
||||
if (second != null) {
|
||||
return second;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
349
app/src/main/res/values-he/strings.xml
Normal file
349
app/src/main/res/values-he/strings.xml
Normal file
@ -0,0 +1,349 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<resources>
|
||||
<string name="app_name">Gadgetbridge</string>
|
||||
<string name="title_activity_controlcenter">Gadgetbridge</string>
|
||||
<string name="action_settings">הגדרות</string>
|
||||
<string name="action_debug">ניפוי שגיאות</string>
|
||||
<string name="action_quit">יציאה</string>
|
||||
<string name="controlcenter_fetch_activity_data">סנכרון</string>
|
||||
<string name="controlcenter_start_sleepmonitor">מעקב שינה (בבדיקה)</string>
|
||||
<string name="controlcenter_find_device">איתור התקן שאבד…</string>
|
||||
<string name="controlcenter_take_screenshot">צילום המסך</string>
|
||||
<string name="controlcenter_disconnect">ניתוק</string>
|
||||
<string name="controlcenter_delete_device">מחיקת התקן</string>
|
||||
<string name="controlcenter_delete_device_name">מחיקת %1$s</string>
|
||||
<string name="controlcenter_delete_device_dialogmessage">פעולה זו תמחק את ההתקן ואת כל המידע המשויך אליו!</string>
|
||||
<string name="title_activity_debug">ניפוי שגיאות</string>
|
||||
<!--Strings related to AppManager-->
|
||||
<string name="title_activity_appmanager">מנהל יישומונים</string>
|
||||
<string name="appmanager_cached_watchapps_watchfaces">יישומונים במטמון</string>
|
||||
<string name="appmanager_installed_watchapps">יישומונים מותקנים</string>
|
||||
<string name="appmanager_installed_watchfaces">מסיכות שעון מותקנות</string>
|
||||
<string name="appmananger_app_delete">מחיקה</string>
|
||||
<string name="appmananger_app_delete_cache">מחיקה והסרה מהמטמון</string>
|
||||
<string name="appmananger_app_reinstall">התקנה מחדש</string>
|
||||
<string name="appmanager_app_openinstore">חיפוש בחנות היישומונים של Pebble</string>
|
||||
<string name="appmanager_health_activate">הפעלה</string>
|
||||
<string name="appmanager_health_deactivate">נטרול</string>
|
||||
<string name="appmanager_hrm_activate">הפעלת </string>
|
||||
<string name="appmanager_hrm_deactivate">נטרול </string>
|
||||
<string name="appmanager_weather_activate">הפעלת יישומון מזג האוויר של המערכת</string>
|
||||
<string name="appmanager_weather_deactivate">נטרול יישומון מזג האוויר של המערכת</string>
|
||||
<string name="appmanager_weather_install_provider">התקנת יישומון דיווח מזג האוויר</string>
|
||||
<string name="app_configure">הגדרה</string>
|
||||
<string name="app_move_to_top">העברה למעלה</string>
|
||||
<!--Strings related to AppBlacklist-->
|
||||
<string name="title_activity_appblacklist">חסימת דיווחים</string>
|
||||
<!--Strings related to FwAppInstaller-->
|
||||
<string name="title_activity_fw_app_insaller">התקנת קושחה/יישומון</string>
|
||||
<string name="fw_upgrade_notice">הקושחה המועמדת להתקנה היא %s במקום זו המותקנת על ה־Mi Band שלך נכון לעכשיו.</string>
|
||||
<string name="fw_multi_upgrade_notice">הקושחות המועמדות להתקנה הנן %1$s ו־%2$s במקום אלו המותקנת על ה־Mi Band שלך נכון לעכשיו.</string>
|
||||
<string name="miband_firmware_known">קושחה זו נבדקה וידוע כי היא נתמכת ב־Gadgetbridge.</string>
|
||||
<string name="miband_firmware_unknown_warning">קושחה זו לא נבדקה ויתכן כי אינה נתמכת ב־Gadgetbridge.\n\nלא מומלץ להתקין אותה על ה־Mi Band שלך!</string>
|
||||
<string name="miband_firmware_suggest_whitelist">אם בכל זאת בחרת להמשיך והדברים ממשיכים לעבוד כרגיל, נא לספר למפתחים של Gadgetbridge להוסיף לרשימת ההיתר את גרסת הקושחה: %s</string>
|
||||
<!--Strings related to Settings-->
|
||||
<string name="title_activity_settings">הגדרות</string>
|
||||
<string name="pref_header_general">הגדרות כלליות</string>
|
||||
<string name="pref_title_general_autoconnectonbluetooth">התחברות להתקן כאשר ה־Bluetooth פועל</string>
|
||||
<string name="pref_title_general_autostartonboot">התחלה אוטומטית</string>
|
||||
<string name="pref_title_general_autocreonnect">התחברות אוטומטית מחדש</string>
|
||||
<string name="pref_title_audo_player">נגן מדיה מועדף</string>
|
||||
<string name="pref_default">בררת מחדל</string>
|
||||
<string name="pref_header_datetime">שעה ותאריך</string>
|
||||
<string name="pref_title_datetime_syctimeonconnect">סנכרון השעה</string>
|
||||
<string name="pref_summary_datetime_syctimeonconnect">סנכרון השעה בהתקן בעת ההתחברות וכאשר השעה או אזור הזמן משתנים באנדרואיד.</string>
|
||||
<string name="pref_title_theme">ערכת עיצוב</string>
|
||||
<string name="pref_theme_light">בהירה</string>
|
||||
<string name="pref_theme_dark">כהה</string>
|
||||
<string name="pref_title_language">שפה</string>
|
||||
<string name="pref_title_minimize_priority">הסתרת ההתרעות של Gadgetbridge</string>
|
||||
<string name="pref_summary_minimize_priority_off">הסמל בשורת המצב והדיווח במסך הנעילה מופיעים</string>
|
||||
<string name="pref_summary_minimize_priority_on">הסמל בשורת המצב והדיווח במסך הנעילה מוסתרים</string>
|
||||
<string name="pref_header_notifications">דיווחים</string>
|
||||
<string name="pref_title_notifications_repetitions">חזרות</string>
|
||||
<string name="pref_title_notifications_call">שיחות טלפון</string>
|
||||
<string name="pref_title_notifications_sms">מסרונים</string>
|
||||
<string name="pref_title_notifications_pebblemsg">הודעות </string>
|
||||
<string name="pref_summary_notifications_pebblemsg">תמיכה ביישומונים ששולחים דיווחים ל־Pebble באמצעות PebbleKit.</string>
|
||||
<string name="pref_title_notifications_generic">תמיכה בדיווחים גנריים</string>
|
||||
<string name="pref_title_whenscreenon">…גם כאשר המסך פעיל</string>
|
||||
<string name="pref_title_notification_filter">לא להפריע</string>
|
||||
<string name="pref_summary_notification_filter">חסימת שליחה של דיווחים בלתי רצויים בהתבסס על המצב לא להפריע.</string>
|
||||
<string name="pref_title_transliteration">תעתיק</string>
|
||||
<string name="pref_summary_transliteration">יש להפעיל זו אם להתקן שלך אין תמיכה בגופן השפה שלך (קירילית ועברית בלבד)</string>
|
||||
<string name="always">תמיד</string>
|
||||
<string name="when_screen_off">כאשר המסך כבוי</string>
|
||||
<string name="never">לעולם לא</string>
|
||||
<string name="pref_header_privacy">פרטיות</string>
|
||||
<string name="pref_title_call_privacy_mode">מצב פרטיות שיחה</string>
|
||||
<string name="pref_call_privacy_mode_off">להציג שם ומספר</string>
|
||||
<string name="pref_call_privacy_mode_name">להסתיר את השם אך להציג את המספר</string>
|
||||
<string name="pref_call_privacy_mode_complete">להסתיר את השם והמספר</string>
|
||||
<string name="pref_blacklist">רשימת יישומונים שחורה</string>
|
||||
<string name="pref_header_cannned_messages">הודעות מוגדרות</string>
|
||||
<string name="pref_title_canned_replies">תגובות</string>
|
||||
<string name="pref_title_canned_reply_suffix">סיומת משותפת</string>
|
||||
<string name="pref_title_canned_messages_dismisscall">התעלמות משיחות</string>
|
||||
<string name="pref_title_canned_messages_set">עדכון ב־Pebble</string>
|
||||
<string name="pref_header_development">אפשרויות פיתוח</string>
|
||||
<string name="pref_title_development_miaddr">כתובת </string>
|
||||
<string name="pref_title_pebble_settings">הגדרות </string>
|
||||
<string name="pref_header_activitytrackers">עוקבי פעילות</string>
|
||||
<string name="pref_title_pebble_activitytracker">עוקב פעילות מועדף</string>
|
||||
<string name="pref_title_pebble_sync_health">סנכרון Pebble Health</string>
|
||||
<string name="pref_title_pebble_sync_misfit">סנכרון Misfit</string>
|
||||
<string name="pref_title_pebble_sync_morpheuz">סנכרון Morpheuz</string>
|
||||
<string name="pref_title_enable_outgoing_call">תמיכה בשיחות יוצאות</string>
|
||||
<string name="pref_summary_enable_outgoing_call">נטרול אפשרות זו גם תנטרל את הרטט לשיחות יוצאות ב־Pebble 2/LE</string>
|
||||
<string name="pref_title_enable_pebblekit">לאפשר גישה ליישומוני צד שלישי באנדרואיד</string>
|
||||
<string name="pref_summary_enable_pebblekit">הפעלת תמיכה ניסיונית ביישומוני אנדרואיד באמצעות PebbleKit</string>
|
||||
<string name="pref_title_sunrise_sunset">זריחה ושקיעה</string>
|
||||
<string name="pref_summary_sunrise_sunset">שליחת מועדי זריחה ושקיעה בהתבסס על המיקום לציר הזמן של pebble</string>
|
||||
<string name="pref_title_autoremove_notifications">הסרה אוטומטית של דיווחים שהתעלמת מהם</string>
|
||||
<string name="pref_summary_autoremove_notifications">דיווחים מוסרים אוטומטית מה־Pebble כשהתעלמת מהם בהתקן האנדרואיד</string>
|
||||
<string name="pref_title_pebble_privacy_mode">מצב פרטיות</string>
|
||||
<string name="pref_pebble_privacy_mode_off">דיווחים רגילים</string>
|
||||
<string name="pref_pebble_privacy_mode_content">החלקת טקסט הדיווח אל מחוץ למסך</string>
|
||||
<string name="pref_pebble_privacy_mode_complete">הצגת סמל הדיווח בלבד</string>
|
||||
<string name="pref_header_location">מיקום</string>
|
||||
<string name="pref_title_location_aquire">קבלת המיקום</string>
|
||||
<string name="pref_title_location_latitude">רוחב</string>
|
||||
<string name="pref_title_location_longitude">אורך</string>
|
||||
<string name="pref_title_location_keep_uptodate">להשאיר את המיקום מעודכן</string>
|
||||
<string name="pref_summary_location_keep_uptodate">לנסות לקבל את המיקום הנוכחי בזמן ההפעלה, יש להשתמש במיקום שנשמר רק כגיבוי</string>
|
||||
<string name="toast_enable_networklocationprovider">נא להפעיל את החיבור לרשת</string>
|
||||
<string name="toast_aqurired_networklocation">המיקום התקבל</string>
|
||||
<string name="pref_title_pebble_forceprotocol">אילוץ פרוטוקול דיווח</string>
|
||||
<string name="pref_summary_pebble_forceprotocol">אפשרות זו מאלצת את השימוש בפרוטוקול הדיווח העדכני ביותר בהתאם לגרסת החומרה. יש להפעיל רק אם ההשלכות ברורות לך לחלוטין!</string>
|
||||
<string name="pref_title_pebble_forceuntested">הפעלת תכונות שלא נבדקו</string>
|
||||
<string name="pref_summary_pebble_forceuntested">הפעלת תכונות שלא נבדקו. יש להפעיל רק אם ההשלכות ברורות לך לחלוטין!!</string>
|
||||
<string name="pref_title_pebble_forcele">תמיד להעדיף BLE</string>
|
||||
<string name="pref_summary_pebble_forcele">שימוש בתמיכה ניסיונית ב־Pebble LE עבור כל סוגי ה־Pebble במקום ה־Bluetooth הקלסי, נדרש צימוד „Pebble LE“ לאחר שנוצר חיבור שאינו LE בעבר.</string>
|
||||
<string name="pref_title_pebble_mtu_limit">מגבלת ה־MTU של GATT ל־Pebble 2/LE</string>
|
||||
<string name="pref_summary_pebble_mtu_limit">אם ה־Pebble 2/Pebble LE שלך אינו עובד כצפוי, יש לנסות אפשרות זאת כדי להגביל את כמות הנתונים המועברת - MTU (טווח תקני 20–512)</string>
|
||||
<string name="pref_title_pebble_enable_applogs">הפעלת מעקב רישום אחר יישומון השעון</string>
|
||||
<string name="pref_summary_pebble_enable_applogs">יגרום לרישומים מיישומי השעון להיות מתועדים ב־Gadgetbridge (נדרשת הפעלה מחדש)</string>
|
||||
<string name="pref_title_pebble_always_ack_pebblekit">אישור מסירה מוקדם מצד PebbleKit</string>
|
||||
<string name="pref_summary_pebble_always_ack_pebblekit">יגרום להודעות שנשלחות ליישומוני צד שלישי לקבל אישור מסירה תמיד ובאופן מיידי</string>
|
||||
<string name="pref_title_pebble_reconnect_attempts">ניסיונות חיבור מחדש</string>
|
||||
<string name="pref_title_unit_system">יחידות</string>
|
||||
<string name="pref_title_timeformat">תבנית הזמן</string>
|
||||
<string name="pref_title_screentime">משך מסך פעיל</string>
|
||||
<string name="prefs_title_all_day_heart_rate">מדידת דופק במשך כל היום</string>
|
||||
<string name="preferences_hplus_settings">הגדרות HPlus/Makibes</string>
|
||||
<string name="not_connected">לא מחובר</string>
|
||||
<string name="connecting">מחובר</string>
|
||||
<string name="connected">מתחבר</string>
|
||||
<string name="unknown_state">מצב לא ידוע</string>
|
||||
<string name="connectionstate_hw_fw">חומרה: %1$s קושחה: %2$s</string>
|
||||
<string name="connectionstate_fw">קושחה: %1$s</string>
|
||||
<string name="_unknown_">(לא ידוע)</string>
|
||||
<string name="test">בדיקה</string>
|
||||
<string name="test_notification">דיווח לבדיקה</string>
|
||||
<string name="this_is_a_test_notification_from_gadgetbridge">זהו דיווח לבדיקה מ־Gadgetbridge</string>
|
||||
<string name="bluetooth_is_not_supported_">אין תמיכה ב־Bluetooth.</string>
|
||||
<string name="bluetooth_is_disabled_">ה־Bluetooth מנוטרל.</string>
|
||||
<string name="tap_connected_device_for_app_mananger">נקישה על ההתקן המחובר למנהל היישומים</string>
|
||||
<string name="tap_connected_device_for_activity">נקישה על ההתקן המחובר לפעילות</string>
|
||||
<string name="tap_connected_device_for_vibration">נקישה על ההתקן המחובר לרטט</string>
|
||||
<string name="tap_a_device_to_connect">יש לגעת בהתקן כדי להתחבר</string>
|
||||
<string name="cannot_connect_bt_address_invalid_">לא ניתן להתחבר. כתובת ה־BT שגויה?</string>
|
||||
<string name="gadgetbridge_running">Gadgetbridge פעיל</string>
|
||||
<string name="installing_binary_d_d">התקנת הבינרי %1$d/%2$d</string>
|
||||
<string name="installation_failed_">ההתקנה נכשלה!</string>
|
||||
<string name="installation_successful">ההתקנה הצליחה</string>
|
||||
<string name="firmware_install_warning">זהו ניסיון להתקנת קושחה, ניתן להמשיך אם ברורות לך ההשלכות.\n\n\n קושחה זו מיועדת לחומרה במהדורה: %s</string>
|
||||
<string name="app_install_info">היישומון המועמד להתקנה הוא:\n\n\n%1$s גרסה %2$s מאת %3$s\n</string>
|
||||
<string name="n_a">לא זמין</string>
|
||||
<string name="initialized">מאותחל</string>
|
||||
<string name="appversion_by_creator">%1$s מאת %2$s</string>
|
||||
<string name="title_activity_discovery">גילוי התקנים</string>
|
||||
<string name="discovery_stop_scanning">להפסיק את הסריקה</string>
|
||||
<string name="discovery_start_scanning">להתחיל בסריקה</string>
|
||||
<string name="action_discover">חיבור התקן חדש</string>
|
||||
<string name="device_with_rssi">%1$s (%2$s)</string>
|
||||
<string name="title_activity_android_pairing">צימוד התקן</string>
|
||||
<string name="android_pairing_hint">יש להשתמש בדו־שיח צימוד ה־Bluetooth לאנדרואיד כדי ליצור צימוד להתקן.</string>
|
||||
<string name="title_activity_mi_band_pairing">צימוד ה־Mi Band שלך</string>
|
||||
<string name="pairing">מתבצע צימוד עם %s…</string>
|
||||
<string name="pairing_creating_bond_with">נוצר איגוד עם %1$s (%2$s)</string>
|
||||
<string name="pairing_unable_to_pair_with">לא ניתן ליצור צימוד עם %1$s (%2$s)</string>
|
||||
<string name="pairing_in_progress">מתבצע איגוד: %1$s (%2$s)</string>
|
||||
<string name="pairing_already_bonded">כבר נוצר איגוד עם %1$s (%2$s), מתבצעת התחברות…</string>
|
||||
<string name="message_cannot_pair_no_mac">לא הועברה כתובת חומרה, לא ניתן לצמד.</string>
|
||||
<string name="preferences_category_device_specific_settings">הגדרות ייעודיות להתקן</string>
|
||||
<string name="preferences_miband_settings">הגדרות Mi Band</string>
|
||||
<string name="male">זכר</string>
|
||||
<string name="female">נקבה</string>
|
||||
<string name="other">אחר</string>
|
||||
<string name="left">שמא</string>
|
||||
<string name="right">ימין</string>
|
||||
<string name="miband_pairing_using_dummy_userdata">לא ניתנו נתוני משתמש, נעשה שימוש בנתוני דמה לבינתיים.</string>
|
||||
<string name="miband_pairing_tap_hint">כאשר ה־Mi Band שלך רוטט ומהבהב, יש לגעת בו מספר פעמים ברצף.</string>
|
||||
<string name="appinstaller_install">התקנה</string>
|
||||
<string name="discovery_connected_devices_hint">נא לוודא שההתקן שלך פתוח לגילוי. התקנים שכבר חוברו לא יופיעו ברשימה. באנדרואיד 6 ומעלה, עליך להפעיל את המיקום (למשל GPS). אם ההתקן שלך לא מופיע לאחר למעלה משתי דקות, יש לנסות שוב לאחר הפעלה מחדש של הטלפון שלך.</string>
|
||||
<string name="discovery_note">לתשומת לבך:</string>
|
||||
<string name="candidate_item_device_image">תמונת ההתקן</string>
|
||||
<string name="miband_prefs_alias">שם/כינוי</string>
|
||||
<string name="pref_header_vibration_count">ספירת רטט</string>
|
||||
<string name="title_activity_sleepmonitor">מעקב שינה</string>
|
||||
<string name="pref_write_logfiles">כתיבת קובצי יומן</string>
|
||||
<string name="initializing">מתבצע אתחול</string>
|
||||
<string name="busy_task_fetch_activity_data">נתוני הפעילות מתקבלים</string>
|
||||
<string name="sleep_activity_date_range">מ־%1$s עד %2$s</string>
|
||||
<string name="miband_prefs_wearside">על יד ימין או שמאל?</string>
|
||||
<string name="pref_screen_vibration_profile">פרופיל רטט</string>
|
||||
<string name="vibration_profile_staccato">סטקטו</string>
|
||||
<string name="vibration_profile_short">קצר</string>
|
||||
<string name="vibration_profile_medium">בינוני</string>
|
||||
<string name="vibration_profile_long">ארוך</string>
|
||||
<string name="vibration_profile_waterdrop">טיפת מים</string>
|
||||
<string name="vibration_profile_ring">צלצול</string>
|
||||
<string name="vibration_profile_alarm_clock">שעון מעורר</string>
|
||||
<string name="miband_prefs_vibration">רטט</string>
|
||||
<string name="vibration_try">בדיקה</string>
|
||||
<string name="pref_screen_notification_profile_sms">דיווח על מסרון</string>
|
||||
<string name="pref_header_vibration_settings">הגדרות רטט</string>
|
||||
<string name="pref_screen_notification_profile_generic">דיווחים כלליים</string>
|
||||
<string name="pref_screen_notification_profile_email">דיווח על דוא״ל</string>
|
||||
<string name="pref_screen_notification_profile_incoming_call">דיווח על שיחה נכנסת</string>
|
||||
<string name="pref_screen_notification_profile_generic_chat">צ׳אט</string>
|
||||
<string name="pref_screen_notification_profile_generic_navigation">ניווט</string>
|
||||
<string name="pref_screen_notification_profile_generic_social">רשת חברתית</string>
|
||||
<string name="control_center_find_lost_device">איתור התקן שאבד</string>
|
||||
<string name="control_center_cancel_to_stop_vibration">יש לבטל כדי לעצור את הרטט.</string>
|
||||
<string name="title_activity_charts">הפעילות שלך</string>
|
||||
<string name="title_activity_set_alarm">הגדרת שעון מעורר</string>
|
||||
<string name="controlcenter_start_configure_alarms">הגדרת שעון מעורר</string>
|
||||
<string name="title_activity_alarm_details">פרטי ההתראה</string>
|
||||
<string name="alarm_sun_short">יום א׳</string>
|
||||
<string name="alarm_mon_short">יום ב׳</string>
|
||||
<string name="alarm_tue_short">יום ג׳</string>
|
||||
<string name="alarm_wed_short">יום ד׳</string>
|
||||
<string name="alarm_thu_short">יום ה</string>
|
||||
<string name="alarm_fri_short">יום ו׳</string>
|
||||
<string name="alarm_sat_short">שבת</string>
|
||||
<string name="alarm_smart_wakeup">השכמה חכמה</string>
|
||||
<string name="user_feedback_miband_set_alarms_failed">אירעה שגיאה בעת הגדרת ההתראות, נא לנסות שוב!</string>
|
||||
<string name="user_feedback_miband_set_alarms_ok">ההתראות נשלחו להתקן!</string>
|
||||
<string name="chart_no_data_synchronize">אין נתונים. לסנכרן מול ההתקן?</string>
|
||||
<string name="user_feedback_miband_activity_data_transfer">בהכנות להעברת %1$s של נתונים החל מ־%2$s</string>
|
||||
<string name="miband_prefs_fitness_goal">יעד צעדים בכל יום</string>
|
||||
<string name="dbaccess_error_executing">שגיאה בהפעלת ‚%1$s‘</string>
|
||||
<string name="controlcenter_start_activitymonitor">הפעילות שלך (ניסיוני)</string>
|
||||
<string name="cannot_connect">לא ניתן להתחבר: %1$s</string>
|
||||
<string name="installer_activity_unable_to_find_handler">לא ניתן למצוא מנגנון להתקנת הקובץ הזה.</string>
|
||||
<string name="pbw_install_handler_unable_to_install">לא ניתן להתקין את הקובץ הנתון: %1$s</string>
|
||||
<string name="pbw_install_handler_hw_revision_mismatch">לא ניתן להתקין את החומרה הנתונה: היא אינה תואמת את מהדורת החומרה של ה־Pebble שלך.</string>
|
||||
<string name="installer_activity_wait_while_determining_status">נא להמתין בעת איתור מצב ההתקנה…</string>
|
||||
<string name="notif_battery_low_title">הסוללה של הגאדג׳ט חלשה!</string>
|
||||
<string name="notif_battery_low_percent">נותר בסוללה של %1$s: %2$s%%</string>
|
||||
<string name="notif_battery_low_bigtext_last_charge_time">טעינה אחרונה: %s \n</string>
|
||||
<string name="notif_battery_low_bigtext_number_of_charges">מספר טעינות: %s</string>
|
||||
<string name="sleepchart_your_sleep">השינה שלך</string>
|
||||
<string name="weeksleepchart_sleep_a_week">שינה של שבוע</string>
|
||||
<string name="weekstepschart_steps_a_week">צעדים של שבוע</string>
|
||||
<string name="activity_sleepchart_activity_and_sleep">הפעילות והשינה שלך</string>
|
||||
<string name="updating_firmware">הקושחה מתעדכנת…</string>
|
||||
<string name="fwapp_install_device_not_ready">לא ניתן להתקין את הקובץ, ההתקן לא מוכן.</string>
|
||||
<string name="miband_installhandler_miband_firmware">הקושחה של ה־Mi Band %1$s</string>
|
||||
<string name="miband_fwinstaller_compatible_version">גרסה תואמת</string>
|
||||
<string name="miband_fwinstaller_untested_version">גרסה שלא נבדקה!</string>
|
||||
<string name="fwappinstaller_connection_state">חיבור להתקן: %1$s</string>
|
||||
<string name="pbw_installhandler_pebble_firmware">הקושחה של ה־Pebble %1$s</string>
|
||||
<string name="pbwinstallhandler_correct_hw_revision">מהדורת החומרה הנכונה</string>
|
||||
<string name="pbwinstallhandler_incorrect_hw_revision">מהדורת החומרה אינה תואמת!</string>
|
||||
<string name="pbwinstallhandler_app_item">%1$s (%2$s)</string>
|
||||
<string name="updatefirmwareoperation_updateproblem_do_not_reboot">אירעה תקלה עם העברת הקושחה. נא לא להפעיל מחדש את ה־Mi Band שלך!</string>
|
||||
<string name="updatefirmwareoperation_metadata_updateproblem">אירעה תקלה עם העברת נתוני העל של הקושחה</string>
|
||||
<string name="updatefirmwareoperation_update_complete">התקנת הקושחה הושלמה</string>
|
||||
<string name="updatefirmwareoperation_update_complete_rebooting">התקנת הקושחה הושלמה, ההתקן מופעל מחדש…</string>
|
||||
<string name="updatefirmwareoperation_write_failed">כתיבת הקושחה נכשלה</string>
|
||||
<string name="chart_steps">צעדים</string>
|
||||
<string name="liveactivity_live_activity">פעילות חיה</string>
|
||||
<string name="weeksteps_today_steps_description">צעדים היום, יעד: %1$s</string>
|
||||
<string name="pref_title_dont_ack_transfer">לא לשלוח אישור על העברת נתוני פעילות</string>
|
||||
<string name="pref_summary_dont_ack_transfers">אם נתוני הפעילות לא יקבלו אישור על ההעברה הם לא יימחקו. שימושי אם נעשה שימוש ביישומונים שונים למעט Gadgetbridge.</string>
|
||||
<string name="pref_summary_keep_data_on_device">תכונה זו תגרום לשמירת נתוני הפעילות על ה־Mi Band גם לאחר הסנכרון. שימושי אם נעשה שימוש ביישומונים שונים למעט Gadgetbridge.</string>
|
||||
<string name="pref_title_low_latency_fw_update">שימוש במצב חיבור מהיר לעדכוני קושחה</string>
|
||||
<string name="pref_summary_low_latency_fw_update">הפעלת אפשרות זו עשויה לסייע במקרים שבהם עדכון הקושחה נכשל</string>
|
||||
<string name="live_activity_steps_history">היסטוריית הצעדים</string>
|
||||
<string name="live_activity_current_steps_per_minute">צעדים/דקה נכון לעכשיו</string>
|
||||
<string name="live_activity_total_steps">סך כל הצעדים</string>
|
||||
<string name="live_activity_steps_per_minute_history">היסטוריית צעדים בדקה</string>
|
||||
<string name="live_activity_start_your_activity">התחלת הפעילות שלך</string>
|
||||
<string name="abstract_chart_fragment_kind_activity">פעילות</string>
|
||||
<string name="abstract_chart_fragment_kind_light_sleep">שינה קלה</string>
|
||||
<string name="abstract_chart_fragment_kind_deep_sleep">שינה עמוקה</string>
|
||||
<string name="abstract_chart_fragment_kind_not_worn">לא נענד</string>
|
||||
<string name="device_not_connected">לא מחובר.</string>
|
||||
<string name="user_feedback_all_alarms_disabled">כל ההתראות מנוטרלות</string>
|
||||
<string name="pref_title_keep_data_on_device">להשאיר את נתוני הפעילות בהתקן</string>
|
||||
<string name="miband_fwinstaller_incompatible_version">קושחה בלתי נתמכת</string>
|
||||
<string name="fwinstaller_firmware_not_compatible_to_device">קושחה זו אינה נתמכת בהתקן</string>
|
||||
<string name="miband_prefs_reserve_alarm_calendar">התראות לשמירה עבור אירועים עתידיים</string>
|
||||
<string name="miband_prefs_hr_sleep_detection">ניתן להשתמש בחיישן הדופק כדי לשפר את איתור השינה</string>
|
||||
<string name="miband_prefs_device_time_offset_hours">הפרש זמן בהתקן בשעות (לזיהוי שינה של עובדי משמרות)</string>
|
||||
<string name="miband2_prefs_dateformat">Mi2: תבנית זמן</string>
|
||||
<string name="dateformat_time">זמן</string>
|
||||
<string name="dateformat_date_time"><![CDATA[זמן ותאריך]]></string>
|
||||
<string name="mi2_prefs_activate_display_on_lift">הפעלת התצוגה עם הנפת היד</string>
|
||||
<string name="FetchActivityOperation_about_to_transfer_since">עומדת להתרחש העברה מאז %1$s</string>
|
||||
<string name="waiting_for_reconnect">בהמתנה לחיבור מחדש</string>
|
||||
<string name="activity_prefs_about_you">עליך</string>
|
||||
<string name="activity_prefs_year_birth">שנת הלידה</string>
|
||||
<string name="activity_prefs_gender">מגדר</string>
|
||||
<string name="activity_prefs_height_cm">גובה בס״מ</string>
|
||||
<string name="activity_prefs_weight_kg">משקל בק״ג</string>
|
||||
<string name="authenticating">מתבצע אימות</string>
|
||||
<string name="authentication_required">נדרש אימות</string>
|
||||
<string name="appwidget_text">חררר</string>
|
||||
<string name="add_widget">הוספת וידג׳ט</string>
|
||||
<string name="activity_prefs_sleep_duration">משך השינה המועדף בשעות</string>
|
||||
<string name="appwidget_alarms_set">הוגדרה התרעה לשעה %1$02d:%2$02d</string>
|
||||
<string name="device_hw">חומרה: %1$s</string>
|
||||
<string name="device_fw">קושחה: %1$s</string>
|
||||
<string name="error_creating_directory_for_logfiles">אירעה שגיאה ביצירת תיקייה לקובצי הרישום: %1$s</string>
|
||||
<string name="DEVINFO_HR_VER">דופק:</string>
|
||||
<string name="updatefirmwareoperation_update_in_progress">מתבצע עדכון קושחה</string>
|
||||
<string name="updatefirmwareoperation_firmware_not_sent">לא הוגדרה קושחה</string>
|
||||
<string name="charts_legend_heartrate">דופק</string>
|
||||
<string name="live_activity_heart_rate">דופק</string>
|
||||
<string name="pref_title_pebble_health_store_raw">אחסון נתונים גולמיים במסד הנתונים</string>
|
||||
<string name="pref_summary_pebble_health_store_raw">אם אפשרות זו מסומנת הנתונים מאוחסנים כמו שהם ויהיו זמינים לפרשנות עתידית. לתשומת לבך: מסד הנתונים יהיה גדול יותר במצב כזה!</string>
|
||||
<string name="action_db_management">ניהול מסד נתונים</string>
|
||||
<string name="title_activity_db_management">ניהול מסד נתונים</string>
|
||||
<string name="activity_db_management_import_export_explanation">פעולות מסד הנתונים משתמשות בנתיב הבא בהתקן שלך. \nנתיב זה נגיש ליישומונים אחרים של אנדרואיד ולמחשב שלך. \nאת הנתונים שייצאת ממסד הנתונים (ואת מסדי הנתונים שמיועדים לייבוא) ניתן למצוא שם:</string>
|
||||
<string name="activity_db_management_merge_old_title">מחיקת מסד נתונים מיושן</string>
|
||||
<string name="dbmanagementactivvity_cannot_access_export_path">לא ניתן לגשת לנתיב הייצוא. נא ליצור קשר עם המפתחים.</string>
|
||||
<string name="dbmanagementactivity_exported_to">ייוצא אל: %1$s</string>
|
||||
<string name="dbmanagementactivity_error_exporting_db">שגיאה בייצוא מסד הנתונים: %1$s</string>
|
||||
<string name="dbmanagementactivity_import_data_title">לייבא נתונים?</string>
|
||||
<string name="dbmanagementactivity_overwrite_database_confirmation">באמת לשכתב על מסד הנתונים הנוכחי? כל נתונים הפעילות הנוכחיים שלך (אם יש כאלה) ילכו לאיבוד.</string>
|
||||
<string name="dbmanagementactivity_import_successful">הייבוא הצליח.</string>
|
||||
<string name="dbmanagementactivity_error_importing_db">שגיאה בייבוא מסד הנתונים: %1$s</string>
|
||||
<string name="dbmanagementactivity_delete_activity_data_title">למחוק את נתוני הפעילות?</string>
|
||||
<string name="dbmanagementactivity_really_delete_entire_db">באמת למחוק את כל מסד הנתונים? כל נתוני הפעילות והמידע על ההתקנים שלך ילך לאיבוד.</string>
|
||||
<string name="dbmanagementactivity_database_successfully_deleted">הנתונים נמחקו בהצלחה.</string>
|
||||
<string name="dbmanagementactivity_db_deletion_failed">מחיקת מסד הנתונים נכשלה.</string>
|
||||
<string name="dbmanagementactivity_delete_old_activity_db">למחוק את מסד נתוני הפעילות המיושן?</string>
|
||||
<string name="dbmanagementactivity_delete_old_activitydb_confirmation">ללמחוק את מסד נתוני הפעילות המיושן? נתוני פעילות שלא ייובאו ילכו לאיבוד.</string>
|
||||
<string name="dbmanagementactivity_old_activity_db_successfully_deleted">נתוני פעילות ישנים נמחקו בהצלחה.</string>
|
||||
<string name="dbmanagementactivity_old_activity_db_deletion_failed">מחיקת מסד נתוני הפעילות הישן נכשל.</string>
|
||||
<string name="dbmanagementactivity_overwrite">שכתוב</string>
|
||||
<string name="Cancel">ביטול</string>
|
||||
<string name="Delete">מחיקה</string>
|
||||
<!--Strings related to Vibration Activity-->
|
||||
<string name="title_activity_vibration">רטטרטט</string>
|
||||
<!--Strings related to Pebble Pairing Activity-->
|
||||
<string name="title_activity_pebble_pairing">צימוד Pebble</string>
|
||||
<string name="pebble_pairing_hint">במסך של התקן האנדרואיד שלך אמורה לקפוץ חלונית צימוד. אם החלונית לא מופיעה, יש לחפש במגירת הדיווחים ולאשר את בקשת הצימוד. לאחר מכן יש לאשר את בקשת הצימוד ב־Pebble שלך</string>
|
||||
<string name="weather_notification_label">נא לוודא שערכת עיצוב זו מופעלת ביישומון דיווח מזג האוויר כדי לקבל נתוני מזג אוויר ל־Pebble שלך.\n\nלא נדרשות כאן הגדרות.\n\nניתן להפעיל את יישומון מזג האוויר המערכתי של ה־Pebble שלך ממנהל היישומונים.\n\nמסיכות השעון התומכות יציגו את מזג האוויר אוטומטית.</string>
|
||||
<string name="pref_title_setup_bt_pairing">הפעלת צימוד Bluetooth</string>
|
||||
<string name="pref_summary_setup_bt_pairing">יש לנטרל זאת אם עולות תקלות בחיבור</string>
|
||||
<string name="unit_metric">מטרית</string>
|
||||
<string name="unit_imperial">אימפריאלית</string>
|
||||
<string name="timeformat_24h">24ש׳</string>
|
||||
<string name="timeformat_am_pm">AM/PM</string>
|
||||
<string name="pref_screen_notification_profile_alarm_clock">שעון מעורר</string>
|
||||
</resources>
|
@ -394,5 +394,9 @@
|
||||
<string name="timeformat_24h">24H</string>
|
||||
<string name="timeformat_am_pm">AM/PM</string>
|
||||
<string name="pref_screen_notification_profile_alarm_clock">Alarm Clock</string>
|
||||
|
||||
<string name="activity_web_view">Web View Activity</string>
|
||||
|
||||
<string name="StringUtils_sender"> (%1$s)</string>
|
||||
<string name="find_device_you_found_it">You found it!</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user