1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-12 13:09:24 +01:00

Merge branch 'master' into new_GUI

This commit is contained in:
Daniele Gobbetti 2016-10-29 16:40:33 +02:00
commit a4b7b87b24
21 changed files with 108 additions and 40 deletions

View File

@ -2,8 +2,12 @@
####Version 0.13.7
* Pebble: Fix configuration of certain pebble apps (eg. QR Generator, Squared 4.0)
* Pebble: Add context menu option in app manager to search a watchapp in the pebble appstore
* Mi Band: allow to delete Mi Band address from development settings
* Mi Band 2: Some initial hacky support for hr readings (Debug activity only)
* Mi Band 2: Initial support for heart rate readings (Debug activity only)
* Mi Band 2: Support disabled alarms
* Attempt to fix spurious device discovery problems
* Update MPAndroidChart to release 3.0
####Version 0.13.6
* Mi Band 2: Support for multiple alarms (3 at the moment)

View File

@ -37,7 +37,7 @@ need to create an account and transmit any of your data to the vendor's servers.
* Music control: play/pause, next track, previous track, volume up, volume down
* List and remove installed apps/watchfaces
* Install watchfaces and watchapps (.pbw)
* Install firwmare files (.pbz) [READ THE WIKI](https://github.com/Freeyourgadget/Gadgetbridge/wiki/Pebble-Firmware-updates)
* Install firmware files (.pbz) [READ THE WIKI](https://github.com/Freeyourgadget/Gadgetbridge/wiki/Pebble-Firmware-updates)
* Install language files (.pbl)
* Take and share screenshots from the Pebble's screen
* PebbleKit support for 3rd Party Android Apps (experimental)

View File

@ -72,7 +72,7 @@ dependencies {
compile 'com.android.support:design:23.4.0'
compile 'com.github.tony19:logback-android-classic:1.1.1-4'
compile 'org.slf4j:slf4j-api:1.7.7'
compile 'com.github.PhilJay:MPAndroidChart:3398cf4462bc7f49bb1156ef22040e8a0d63369f'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.0'
compile 'com.github.pfichtner:durationformatter:0.1.1'
compile 'de.cketti.library.changelog:ckchangelog:1.2.2'
compile 'net.e175.klaus:solarpositioning:0.0.9'

View File

@ -182,6 +182,15 @@
<data android:mimeType="application/octet-stream" />
</intent-filter>
<!-- to receive firmwares from the donwload content provider if recognized as zip-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/zip" />
<data android:mimeType="application/x-zip-compressed" />
</intent-filter>
</activity>
<service

View File

@ -63,6 +63,9 @@ public class DiscoveryActivity extends GBActivity implements AdapterView.OnItemC
}
break;
case BluetoothAdapter.ACTION_DISCOVERY_FINISHED:
handler.post(new Runnable() {
@Override
public void run() {
// continue with LE scan, if available
if (isScanning == Scanning.SCANNING_BT) {
checkAndRequestLocationPermission();
@ -74,6 +77,8 @@ public class DiscoveryActivity extends GBActivity implements AdapterView.OnItemC
} else {
discoveryFinished();
}
}
});
break;
case BluetoothAdapter.ACTION_STATE_CHANGED:
int oldState = intent.getIntExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, BluetoothAdapter.STATE_OFF);

View File

@ -287,6 +287,14 @@ public abstract class AbstractAppManagerFragment extends Fragment {
if (!selectedApp.isConfigurable()) {
menu.removeItem(R.id.appmanager_app_configure);
}
switch (selectedApp.getType()) {
case WATCHFACE:
case APP_GENERIC:
case APP_ACTIVITYTRACKER:
break;
default:
menu.removeItem(R.id.appmanager_app_openinstore);
}
//menu.setHeaderTitle(selectedApp.getName());
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
@ -354,6 +362,12 @@ public abstract class AbstractAppManagerFragment extends Fragment {
startIntent.putExtra(GBDevice.EXTRA_DEVICE, mGBDevice);
startActivity(startIntent);
return true;
case R.id.appmanager_app_openinstore:
String url = "https://apps.getpebble.com/en_US/search/" + ((selectedApp.getType() == GBDeviceApp.Type.WATCHFACE) ? "watchfaces" : "watchapps") + "/1?query=" + selectedApp.getName() + "&dev_settings=true";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
return true;
default:
return super.onContextItemSelected(item);
}

View File

@ -209,20 +209,20 @@ public class MiBandPairingActivity extends GBActivity {
protected void performBluetoothPair(BluetoothDevice device) {
int bondState = device.getBondState();
if (bondState == BluetoothDevice.BOND_BONDED) {
GB.toast("Already bonded with " + device.getName() + " (" + device.getAddress() + "), connecting...", Toast.LENGTH_SHORT, GB.INFO);
GB.toast(getString(R.string.miband_pairing_already_bonded, device.getName(), device.getAddress()), Toast.LENGTH_SHORT, GB.INFO);
performPair();
return;
}
bondingMacAddress = device.getAddress();
if (bondState == BluetoothDevice.BOND_BONDING) {
GB.toast(this, "Bonding in progress: " + bondingMacAddress, Toast.LENGTH_LONG, GB.INFO);
GB.toast(this, getString(R.string.miband_pairing_in_progress, device.getName(), bondingMacAddress), Toast.LENGTH_LONG, GB.INFO);
return;
}
GB.toast(this, "Creating bond with" + bondingMacAddress, Toast.LENGTH_LONG, GB.INFO);
GB.toast(this, getString(R.string.miband_pairing_creating_bond_with, device.getName(), bondingMacAddress), Toast.LENGTH_LONG, GB.INFO);
if (!device.createBond()) {
GB.toast(this, "Unable to pair with " + bondingMacAddress, Toast.LENGTH_LONG, GB.ERROR);
GB.toast(this, getString(R.string.miband_pairing_unable_to_pair_with, device.getName(), bondingMacAddress), Toast.LENGTH_LONG, GB.ERROR);
}
}

View File

@ -278,6 +278,9 @@ public class NotificationListener extends NotificationListenerService {
case "org.telegram.messenger":
notificationSpec.type = NotificationType.TELEGRAM;
break;
case "me.zeeroooo.materialfb":
case "it.rignanese.leo.slimfacebook":
case "me.jakelane.wrapperforfacebook":
case "com.facebook.katana":
case "org.indywidualni.fblite":
notificationSpec.type = NotificationType.FACEBOOK;

View File

@ -153,6 +153,11 @@ public class GBAlarm implements Alarm {
return this.repetition;
}
@Override
public boolean isRepetitive() {
return getRepetitionMask() != ALARM_ONCE;
}
public String toPreferences() {
return String.valueOf(this.index) + ',' +
String.valueOf(this.enabled) + ',' +
@ -209,10 +214,12 @@ public class GBAlarm implements Alarm {
}
public static final Creator CREATOR = new Creator() {
@Override
public GBAlarm createFromParcel(Parcel in) {
return readFromParcel(in);
}
@Override
public GBAlarm[] newArray(int size) {
return new GBAlarm[size];
}

View File

@ -26,5 +26,7 @@ public interface Alarm extends Parcelable, Comparable<Alarm> {
int getRepetitionMask();
boolean isRepetitive();
boolean getRepetition(int dow);
}

View File

@ -853,9 +853,6 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
} else if (MiBandService.UUID_CHARACTERISTIC_REALTIME_STEPS.equals(characteristicUUID)) {
handleRealtimeSteps(characteristic.getValue());
return true;
} else if (MiBandService.UUID_CHARACTERISTIC_REALTIME_STEPS.equals(characteristicUUID)) {
handleRealtimeSteps(characteristic.getValue());
return true;
} else if (MiBandService.UUID_CHARACTERISTIC_HEART_RATE_MEASUREMENT.equals(characteristicUUID)) {
handleHeartrate(characteristic.getValue());
return true;
@ -1061,7 +1058,6 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
*/
private void queueAlarm(Alarm alarm, TransactionBuilder builder, BluetoothGattCharacteristic characteristic) {
Calendar calendar = alarm.getAlarmCal();
int daysMask = 0;
int maxAlarms = 5; // arbitrary at the moment...
if (alarm.getIndex() >= maxAlarms) {
@ -1071,13 +1067,17 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
return;
}
int base = 0;
if (alarm.isEnabled()) {
daysMask = alarm.getRepetitionMask();
base = 128;
}
int daysMask = alarm.getRepetitionMask();
if (!alarm.isRepetitive()) {
daysMask = 128;
}
byte[] alarmMessage = new byte[] {
(byte) 0x2, // TODO what is this?
(byte) (128 + alarm.getIndex()), // 128 is the base, alarm slot is added
(byte) (base + alarm.getIndex()), // 128 is the base, alarm slot is added
(byte) calendar.get(Calendar.HOUR_OF_DAY),
(byte) calendar.get(Calendar.MINUTE),
(byte) daysMask,

View File

@ -815,9 +815,6 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
} else if (MiBandService.UUID_CHARACTERISTIC_REALTIME_STEPS.equals(characteristicUUID)) {
handleRealtimeSteps(characteristic.getValue());
return true;
} else if (MiBandService.UUID_CHARACTERISTIC_REALTIME_STEPS.equals(characteristicUUID)) {
handleRealtimeSteps(characteristic.getValue());
return true;
} else if (MiBandService.UUID_CHARACTERISTIC_HEART_RATE_MEASUREMENT.equals(characteristicUUID)) {
handleHeartrate(characteristic.getValue());
return true;

View File

@ -28,7 +28,7 @@
android:scrollHorizontally="false"
style="@style/Base.TextAppearance.AppCompat.SearchResult.Title"
android:text="Item Name"
android:singleLine="true" />
android:maxLines="1"/>
<TextView
android:id="@+id/item_details"

View File

@ -26,9 +26,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollHorizontally="false"
style="@style/Base.TextAppearance.AppCompat.Body1"
android:text="Item Name"
android:singleLine="true" />
android:text="Item Name"/>
<TextView
android:id="@+id/item_details"

View File

@ -18,4 +18,7 @@
<item
android:id="@+id/appmanager_app_configure"
android:title="@string/app_configure"/>
<item
android:id="@+id/appmanager_app_openinstore"
android:title="@string/appmanager_app_openinstore"/>
</menu>

View File

@ -10,6 +10,9 @@
<string name="controlcenter_find_device">Suche verlegtes Gerät…</string>
<string name="controlcenter_take_screenshot">Bildschirmfoto</string>
<string name="controlcenter_disconnect">Trennen</string>
<string name="controlcenter_delete_device">Gerät Löschen</string>
<string name="controlcenter_delete_device_name">%1$s Löschen</string>
<string name="controlcenter_delete_device_dialogmessage">Das wird das Gerät und die dazugehörigen Daten löschen!</string>
<string name="title_activity_debug">Debug</string>
<!--Strings related to AppManager-->
<string name="title_activity_appmanager">App Manager</string>
@ -52,6 +55,7 @@
<string name="pref_title_notifications_sms">SMS</string>
<string name="pref_title_notifications_k9mail">K9-Mail</string>
<string name="pref_title_notifications_pebblemsg">Pebble Nachrichten</string>
<string name="pref_summary_notifications_pebblemsg">Unterstützung für Anwendungen die Benachrichtigungen an die Pebble via PebbleKit senden.</string>
<string name="pref_title_notifications_generic">Andere Benachrichtigungen</string>
<string name="pref_title_whenscreenon">… auch wenn der Bildschirm an ist</string>
<string name="pref_title_notification_filter">Bitte nicht stören</string>
@ -102,6 +106,7 @@
<string name="bluetooth_is_disabled_">Bluetooth ist abgeschaltet.</string>
<string name="tap_connected_device_for_app_mananger">berühre das verbundene Gerät, um den App Manager zu starten</string>
<string name="tap_connected_device_for_activity">Tippe auf das verbundene Gerät um die Aktivitätsdaten anzuzeigen</string>
<string name="tap_connected_device_for_vibration">Tippe auf das verbundene Gerät um zu vibrieren</string>
<string name="tap_a_device_to_connect">berühre ein Gerät zum Verbinden</string>
<string name="cannot_connect_bt_address_invalid_">Verbindung kann nicht aufgebaut werden. BT Adresse ungültig?</string>
<string name="gadgetbridge_running">Gadgetbridge läuft</string>
@ -133,7 +138,8 @@
<string name="miband_pairing_using_dummy_userdata">Keine gültigen Benutzerinformationen angegeben, verwende Dummy-Daten für\'s Erste.</string>
<string name="miband_pairing_tap_hint">Wenn Dein Mi Band vibriert und blinkt, tippe ein paar Mal schnell hintereinander darauf.</string>
<string name="appinstaller_install">Installieren</string>
<string name="discovery_connected_devices_hint">Mach Dein Gerät auffindbar. Derzeit verbundene Geräte sind in der Regel nicht auffindbar. Wenn Dein Gerät nach zwei Minuten nicht angezeigt wird, versuche es nach einem Neustart Deines Telefons noch einmal. </string>
<string name="discovery_connected_devices_hint">Mach Dein Gerät auffindbar. Derzeit verbundene Geräte sind in der Regel nicht auffindbar. Android 6 oder neuer braucht dafür Standortbestimmung (z.B. GPS). Wenn Dein Gerät nach zwei Minuten nicht
angezeigt wird, versuche es nach einem Neustart Deines Telefons noch einmal.</string>
<string name="discovery_note">Tipp:</string>
<string name="candidate_item_device_image">Bild des Geräts</string>
<string name="miband_prefs_alias">Name/Alias</string>
@ -153,12 +159,15 @@
<string name="vibration_profile_ring">Ring</string>
<string name="vibration_profile_alarm_clock">Wecker</string>
<string name="miband_prefs_vibration">Vibration</string>
<string name="vibration_try">Test</string>
<string name="pref_screen_notification_profile_sms">SMS Benachrichtigung</string>
<string name="pref_header_vibration_settings">Vibrationseinstellungen</string>
<string name="pref_screen_notification_profile_generic">Sonstige Benachrichtigung</string>
<string name="pref_screen_notification_profile_pebblemsg">Pebble Benachrichtigung</string>
<string name="pref_screen_notification_profile_email">E-Mail Benachrichtigung</string>
<string name="pref_screen_notification_profile_incoming_call">Benachrichtigung für eingehende Anrufe</string>
<string name="pref_screen_notification_profile_email">E-Mail</string>
<string name="pref_screen_notification_profile_incoming_call">Eingehende Anrufe</string>
<string name="pref_screen_notification_profile_generic_chat">Chat</string>
<string name="pref_screen_notification_profile_generic_navigation">Navigation</string>
<string name="pref_screen_notification_profile_generic_social">Soziales Netzwerk</string>
<string name="control_center_find_lost_device">Verlegtes Gerät suchen</string>
<string name="control_center_cancel_to_stop_vibration">Abbrechen um die Vibration zu stoppen.</string>
<string name="title_activity_charts">Deine Aktivität</string>
@ -274,6 +283,7 @@ Wenn Du schon deine Daten importiert hast und mit dem Ergebnis zufrieden bist, k
<string name="dbmanagementactivity_import_data_title">Daten importieren?</string>
<string name="dbmanagementactivity_import_successful">Import erfolgreich.</string>
<string name="dbmanagementactivity_error_importing_db">Fehler beim Importieren der DB: %1$s</string>
<string name="dbmanagementactivity_merging_activity_data_title">Führe Aktivitätsdaten zusammen</string>
<string name="dbmanagementactivity_delete_activity_data_title">Alte Daten löschen?</string>
<string name="dbmanagementactivity_database_successfully_deleted">Daten erfolgreich gelöscht.</string>
<string name="dbmanagementactivity_db_deletion_failed">Löschen der Datenbank fehlgeschlagen.</string>
@ -283,4 +293,6 @@ Wenn Du schon deine Daten importiert hast und mit dem Ergebnis zufrieden bist, k
<string name="dbmanagementactivity_overwrite">Überschreiben</string>
<string name="Cancel">Abbrechen</string>
<string name="Delete">Löschen</string>
<!--Strings related to Vibration Activity-->
<string name="title_activity_vibration">Vibration</string>
</resources>

View File

@ -138,7 +138,7 @@
<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">お使いのデバイスを検出可能にしてください。現在、接続されたデバイスは、おそらく検出されません。お使いのデバイスが 2 分しても表示されない場合は、モバイルデバイスを再起動した後にもう一度試してください。</string>
<string name="discovery_connected_devices_hint">お使いのデバイスを検出可能にしてください。現在、接続されたデバイスは、おそらく検出されません。Android 6 以降では位置情報を有効にする必要があります (例 GPS)。お使いのデバイスが 2 分しても表示されない場合は、モバイルデバイスを再起動した後にもう一度試してください。</string>
<string name="discovery_note">注:</string>
<string name="candidate_item_device_image">デバイスイメージ</string>
<string name="miband_prefs_alias">名前/別名</string>
@ -302,4 +302,7 @@ Mi Band、Pebble Health、Morpheuz からデータをインポートすること
<string name="Delete">削除</string>
<!--Strings related to Vibration Activity-->
<string name="title_activity_vibration">バイブレーション</string>
<string name="miband_pairing_creating_bond_with">%1$s (%2$s) と結合を作成中</string>
<string name="miband_pairing_in_progress">結合の進行中: %1$s (%2$s)</string>
<string name="miband_pairing_already_bonded">既に %1$s (%2$s) と結合しています。接続中…</string>
</resources>

View File

@ -27,6 +27,7 @@
<string name="appmananger_app_delete">Delete</string>
<string name="appmananger_app_delete_cache">Delete and remove from cache</string>
<string name="appmananger_app_reinstall">Reinstall</string>
<string name="appmanager_app_openinstore">Open in Pebble Appstore</string>
<string name="appmanager_health_activate">Activate</string>
<string name="appmanager_health_deactivate">Deactivate</string>
<string name="app_configure">Configure</string>
@ -153,6 +154,10 @@
<string name="android_pairing_hint">Use the Android Bluetooth Pairing dialog to pair the device.</string>
<string name="title_activity_mi_band_pairing">Pair your Mi Band</string>
<string name="miband_pairing">Pairing with %s…</string>
<string name="miband_pairing_creating_bond_with">"Creating bond with %1$s (%2$s)"</string>
<string name="miband_pairing_unable_to_pair_with">"Unable to pair with %1$s (%2$s)"</string>
<string name="miband_pairing_in_progress">Bonding in progress: %1$s (%2$s)</string>
<string name="miband_pairing_already_bonded">"Already bonded with %1$s (%2$s), connecting…"</string>
<string name="message_cannot_pair_no_mac">No mac address passed, cannot pair.</string>
<string name="preferences_category_device_specific_settings">Device Specific Settings</string>
<string name="preferences_miband_settings">Mi Band Settings</string>
@ -164,7 +169,7 @@
<string name="miband_pairing_using_dummy_userdata">No valid user data given, using dummy user data for now.</string>
<string name="miband_pairing_tap_hint">When your Mi Band vibrates and blinks, tap it a few times in a row.</string>
<string name="appinstaller_install">Install</string>
<string name="discovery_connected_devices_hint">Make your device discoverable. Currently connected devices will likely not be discovered. If your device does not show up after two minutes, try again after rebooting your mobile device.</string>
<string name="discovery_connected_devices_hint">Make your device discoverable. Currently connected devices will likely not be discovered. On Android 6 or later, you need to activate location (e.g. GPS). If your device does not show up after two minutes, try again after rebooting your mobile device.</string>
<string name="discovery_note">Note:</string>
<string name="candidate_item_device_image">Device Image</string>
<string name="miband_prefs_alias">Name/Alias</string>

View File

@ -2,8 +2,12 @@
<changelog>
<release version="0.13.7" versioncode="69">
<change>Pebble: Fix configuration of certain pebble apps (eg. QR Generator, Squared 4.0)</change>
<change>Pebble: Add context menu option in app manager to search a watchapp in the pebble appstore</change>
<change>Mi Band: allow to delete Mi Band address from development settings</change>
<change>Mi Band 2: Some initial hacky support for hr readings (Debug activity only)</change>
<change>Mi Band 2: Initial support for heart rate readings (Debug activity only)</change>
<change>Mi Band 2: Support disabled alarms</change>
<change>Attempt to fix spurious device discovery problems</change>
<change>Update MPAndroidChart to release 3.0</change>
</release>
<release version="0.13.6" versioncode="68">
<change>Mi Band 2: Support multiple alarms (3 at the moment)</change>

View File

@ -10,7 +10,6 @@ import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowLog;
import java.io.File;
@ -41,7 +40,8 @@ public abstract class TestBase {
@BeforeClass
public static void setupSuite() throws Exception {
// print everything going to android.util.Log to System.out
ShadowLog.stream = System.out;
System.setProperty("robolectric.logging", "stdout");
// ShadowLog.stream = System.out;
// properties might be preconfigured in build.gradle because of test ordering problems
String logDir = System.getProperty(Logging.PROP_LOGFILES_DIR);

View File

@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files