mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Replace disabled device icons with color filter
This commit is contained in:
Generated
+1
@@ -30,6 +30,7 @@
|
||||
<w>carsten</w>
|
||||
<w>chamorro</w>
|
||||
<w>codeberg</w>
|
||||
<w>colmi</w>
|
||||
<w>criogenic</w>
|
||||
<w>croisez</w>
|
||||
<w>dakhno</w>
|
||||
|
||||
+3
-3
@@ -386,14 +386,14 @@ public class ActivitySummariesFilter extends AbstractGBActivity {
|
||||
GBApplication gbApp = (GBApplication) appContext;
|
||||
LinkedHashMap<String, Pair<Long, Integer>> newMap = new LinkedHashMap<>(1);
|
||||
List<? extends GBDevice> devices = gbApp.getDeviceManager().getDevices();
|
||||
newMap.put(getString(R.string.activity_summaries_all_devices), new Pair<>(ALL_DEVICES, R.drawable.ic_device_default_disabled));
|
||||
newMap.put(getString(R.string.activity_summaries_all_devices), new Pair<>(ALL_DEVICES, R.drawable.ic_device_default));
|
||||
|
||||
try (DBHandler handler = GBApplication.acquireDB()) {
|
||||
daoSession = handler.getDaoSession();
|
||||
for (GBDevice device : devices) {
|
||||
DeviceCoordinator coordinator = device.getType().getDeviceCoordinator();
|
||||
Device dbDevice = DBHelper.findDevice(device, daoSession);
|
||||
int icon = device.getEnabledDisabledIconResource();
|
||||
int icon = device.getDeviceCoordinator().getDefaultIconResource();
|
||||
if (dbDevice != null && coordinator != null
|
||||
&& coordinator.supportsActivityTracks()
|
||||
&& !newMap.containsKey(device.getAliasOrName())) {
|
||||
@@ -402,7 +402,7 @@ public class ActivitySummariesFilter extends AbstractGBActivity {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
LOG.debug("Error getting list of all devices: " + e);
|
||||
LOG.error("Error getting list of all devices", e);
|
||||
}
|
||||
return newMap;
|
||||
}
|
||||
|
||||
+23
-14
@@ -21,6 +21,8 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.ColorMatrix;
|
||||
import android.graphics.ColorMatrixColorFilter;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.DatePicker;
|
||||
@@ -43,7 +45,6 @@ import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
||||
|
||||
public class BatteryInfoActivity extends AbstractGBActivity {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(BatteryInfoActivity.class);
|
||||
@@ -90,15 +91,15 @@ public class BatteryInfoActivity extends AbstractGBActivity {
|
||||
|
||||
batteryInfoChartFragment.setDateAndGetData(gbDevice, batteryIndex, timeFrom, timeTo);
|
||||
|
||||
TextView battery_status_device_name_text = (TextView) findViewById(R.id.battery_status_device_name);
|
||||
battery_status_battery_voltage = (TextView) findViewById(R.id.battery_status_battery_voltage);
|
||||
TextView battery_status_extra_name = (TextView) findViewById(R.id.battery_status_extra_name);
|
||||
final TextView battery_status_date_from_text = (TextView) findViewById(R.id.battery_status_date_from_text);
|
||||
final TextView battery_status_date_to_text = (TextView) findViewById(R.id.battery_status_date_to_text);
|
||||
final SeekBar battery_status_time_span_seekbar = (SeekBar) findViewById(R.id.battery_status_time_span_seekbar);
|
||||
final TextView battery_status_time_span_text = (TextView) findViewById(R.id.battery_status_time_span_text);
|
||||
TextView battery_status_device_name_text = findViewById(R.id.battery_status_device_name);
|
||||
battery_status_battery_voltage = findViewById(R.id.battery_status_battery_voltage);
|
||||
TextView battery_status_extra_name = findViewById(R.id.battery_status_extra_name);
|
||||
final TextView battery_status_date_from_text = findViewById(R.id.battery_status_date_from_text);
|
||||
final TextView battery_status_date_to_text = findViewById(R.id.battery_status_date_to_text);
|
||||
final SeekBar battery_status_time_span_seekbar = findViewById(R.id.battery_status_time_span_seekbar);
|
||||
final TextView battery_status_time_span_text = findViewById(R.id.battery_status_time_span_text);
|
||||
|
||||
LinearLayout battery_status_date_to_layout = (LinearLayout) findViewById(R.id.battery_status_date_to_layout);
|
||||
LinearLayout battery_status_date_to_layout = findViewById(R.id.battery_status_date_to_layout);
|
||||
|
||||
battery_status_time_span_seekbar.setMax(5);
|
||||
battery_status_time_span_seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@@ -188,8 +189,16 @@ public class BatteryInfoActivity extends AbstractGBActivity {
|
||||
DeviceCoordinator coordinator = gbDevice.getDeviceCoordinator();
|
||||
|
||||
ImageView battery_status_device_icon = findViewById(R.id.battery_status_device_icon);
|
||||
battery_status_device_icon.setImageResource(gbDevice.getEnabledDisabledIconResource());
|
||||
battery_status_battery_level_text = (TextView) findViewById(R.id.battery_status_battery_level);
|
||||
battery_status_device_icon.setImageResource(gbDevice.getDeviceCoordinator().getDefaultIconResource());
|
||||
if (gbDevice.isInitialized()) {
|
||||
battery_status_device_icon.setColorFilter(null);
|
||||
} else {
|
||||
final ColorMatrix colorMatrix = new ColorMatrix();
|
||||
colorMatrix.setSaturation(0);
|
||||
|
||||
battery_status_device_icon.setColorFilter(new ColorMatrixColorFilter(colorMatrix));
|
||||
}
|
||||
battery_status_battery_level_text = findViewById(R.id.battery_status_battery_level);
|
||||
battery_status_device_name_text.setText(gbDevice.getAliasOrName());
|
||||
|
||||
setBatteryLabels();
|
||||
@@ -218,10 +227,10 @@ public class BatteryInfoActivity extends AbstractGBActivity {
|
||||
BroadcastReceiver commandReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
LOG.debug("device receiver received " + intent.getAction());
|
||||
if (intent.getAction().equals(GBDevice.ACTION_DEVICE_CHANGED)) {
|
||||
LOG.debug("device receiver received {}", intent.getAction());
|
||||
if (GBDevice.ACTION_DEVICE_CHANGED.equals(intent.getAction())) {
|
||||
GBDevice newDevice = intent.getParcelableExtra(GBDevice.EXTRA_DEVICE);
|
||||
if (newDevice.equals(gbDevice)) {
|
||||
if (gbDevice.equals(newDevice)) {
|
||||
gbDevice = newDevice;
|
||||
setBatteryLabels();
|
||||
}
|
||||
|
||||
+23
-61
@@ -19,36 +19,24 @@ package nodomain.freeyourgadget.gadgetbridge.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Pair;
|
||||
import android.widget.ListView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.AndroidUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.WidgetPreferenceStorage;
|
||||
|
||||
public class SleepAlarmWidgetConfigurationActivity extends Activity implements GBActivity {
|
||||
@@ -57,10 +45,9 @@ public class SleepAlarmWidgetConfigurationActivity extends Activity implements G
|
||||
// if we knew which widget is calling this config activity, we could only use a single configuration
|
||||
// activity and customize the filter in getAllDevices based on the caller.
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SleepAlarmWidgetConfigurationActivity.class);
|
||||
int mAppWidgetId;
|
||||
|
||||
LinkedHashMap<String, Pair<String, Integer>> allDevices;
|
||||
List<GBDevice> allDevices;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -79,10 +66,9 @@ public class SleepAlarmWidgetConfigurationActivity extends Activity implements G
|
||||
AppWidgetManager.INVALID_APPWIDGET_ID);
|
||||
}
|
||||
// make the result intent and set the result to canceled
|
||||
Intent resultValue;
|
||||
resultValue = new Intent();
|
||||
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
|
||||
setResult(RESULT_CANCELED, resultValue);
|
||||
Intent resultValueCanceled = new Intent();
|
||||
resultValueCanceled.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
|
||||
setResult(RESULT_CANCELED, resultValueCanceled);
|
||||
|
||||
if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
|
||||
finish();
|
||||
@@ -91,31 +77,31 @@ public class SleepAlarmWidgetConfigurationActivity extends Activity implements G
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(SleepAlarmWidgetConfigurationActivity.this);
|
||||
builder.setTitle(R.string.widget_settings_select_device_title);
|
||||
|
||||
allDevices = getAllDevices(getApplicationContext());
|
||||
allDevices = GBApplication.app().getDeviceManager().getDevices().stream()
|
||||
.filter(device -> {
|
||||
final DeviceCoordinator coordinator = device.getDeviceCoordinator();
|
||||
return coordinator.getAlarmSlotCount(device) > 0;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<String> list = new ArrayList<>();
|
||||
for (Map.Entry<String, Pair<String, Integer>> item : allDevices.entrySet()) {
|
||||
list.add(item.getKey());
|
||||
for (GBDevice dev : allDevices) {
|
||||
list.add(dev.getAliasOrName());
|
||||
}
|
||||
String[] allDevicesString = list.toArray(new String[0]);
|
||||
|
||||
builder.setSingleChoiceItems(allDevicesString, 0, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
ListView lw = ((AlertDialog) dialog).getListView();
|
||||
int selectedItemPosition = lw.getCheckedItemPosition();
|
||||
builder.setSingleChoiceItems(allDevicesString, 0, (dialog, which) -> {
|
||||
ListView lw = ((AlertDialog) dialog).getListView();
|
||||
int selectedItemPosition = lw.getCheckedItemPosition();
|
||||
|
||||
if (selectedItemPosition > -1) {
|
||||
Map.Entry<String, Pair<String, Integer>> selectedItem =
|
||||
(Map.Entry<String, Pair<String, Integer>>) allDevices.entrySet().toArray()[selectedItemPosition];
|
||||
WidgetPreferenceStorage widgetPreferenceStorage = new WidgetPreferenceStorage();
|
||||
widgetPreferenceStorage.saveWidgetPrefs(getApplicationContext(), String.valueOf(mAppWidgetId), selectedItem.getValue().first);
|
||||
}
|
||||
Intent resultValue = new Intent();
|
||||
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
|
||||
setResult(RESULT_OK, resultValue);
|
||||
finish();
|
||||
if (selectedItemPosition > -1) {
|
||||
final GBDevice selectedItem = allDevices.get(selectedItemPosition);
|
||||
WidgetPreferenceStorage widgetPreferenceStorage = new WidgetPreferenceStorage();
|
||||
widgetPreferenceStorage.saveWidgetPrefs(getApplicationContext(), String.valueOf(mAppWidgetId), selectedItem.getAddress());
|
||||
}
|
||||
Intent resultValueOk = new Intent();
|
||||
resultValueOk.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
|
||||
setResult(RESULT_OK, resultValueOk);
|
||||
finish();
|
||||
});
|
||||
builder.setCancelable(false);
|
||||
|
||||
@@ -123,30 +109,6 @@ public class SleepAlarmWidgetConfigurationActivity extends Activity implements G
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public LinkedHashMap getAllDevices(Context appContext) {
|
||||
DaoSession daoSession;
|
||||
GBApplication gbApp = (GBApplication) appContext;
|
||||
LinkedHashMap<String, Pair<String, Integer>> newMap = new LinkedHashMap<>(1);
|
||||
List<? extends GBDevice> devices = gbApp.getDeviceManager().getDevices();
|
||||
|
||||
try (DBHandler handler = GBApplication.acquireDB()) {
|
||||
daoSession = handler.getDaoSession();
|
||||
for (GBDevice device : devices) {
|
||||
DeviceCoordinator coordinator = device.getDeviceCoordinator();
|
||||
Device dbDevice = DBHelper.findDevice(device, daoSession);
|
||||
int icon = device.getEnabledDisabledIconResource();
|
||||
if (dbDevice != null && coordinator != null
|
||||
&& (coordinator.getAlarmSlotCount(device) > 0)
|
||||
&& !newMap.containsKey(device.getAliasOrName())) {
|
||||
newMap.put(device.getAliasOrName(), new Pair(device.getAddress(), icon));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error getting list of all devices: " + e);
|
||||
}
|
||||
return newMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLanguage(Locale language, boolean invalidateLanguage) {
|
||||
AndroidUtils.setLanguage(this, language);
|
||||
|
||||
+23
-60
@@ -18,43 +18,30 @@ package nodomain.freeyourgadget.gadgetbridge.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Pair;
|
||||
import android.widget.ListView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.AndroidUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.WidgetPreferenceStorage;
|
||||
|
||||
public class WidgetConfigurationActivity extends Activity implements GBActivity {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(WidgetConfigurationActivity.class);
|
||||
int mAppWidgetId;
|
||||
|
||||
LinkedHashMap<String, Pair<String, Integer>> allDevices;
|
||||
List<GBDevice> allDevices;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -73,9 +60,9 @@ public class WidgetConfigurationActivity extends Activity implements GBActivity
|
||||
AppWidgetManager.INVALID_APPWIDGET_ID);
|
||||
}
|
||||
// make the result intent and set the result to canceled
|
||||
Intent resultValue; resultValue = new Intent();
|
||||
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
|
||||
setResult(RESULT_CANCELED, resultValue);
|
||||
Intent resultValueCanceled = new Intent();
|
||||
resultValueCanceled.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
|
||||
setResult(RESULT_CANCELED, resultValueCanceled);
|
||||
|
||||
if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
|
||||
finish();
|
||||
@@ -84,31 +71,31 @@ public class WidgetConfigurationActivity extends Activity implements GBActivity
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(WidgetConfigurationActivity.this);
|
||||
builder.setTitle(R.string.widget_settings_select_device_title);
|
||||
|
||||
allDevices = getAllDevices(getApplicationContext());
|
||||
allDevices = GBApplication.app().getDeviceManager().getDevices().stream()
|
||||
.filter(device -> {
|
||||
final DeviceCoordinator coordinator = device.getDeviceCoordinator();
|
||||
return coordinator.supportsActivityDataFetching() || coordinator.supportsActivityTracking();
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<String> list = new ArrayList<>();
|
||||
for (Map.Entry<String, Pair<String, Integer>> item : allDevices.entrySet()) {
|
||||
list.add(item.getKey());
|
||||
for (GBDevice dev : allDevices) {
|
||||
list.add(dev.getAliasOrName());
|
||||
}
|
||||
String[] allDevicesString = list.toArray(new String[0]);
|
||||
|
||||
builder.setSingleChoiceItems(allDevicesString, 0, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
ListView lw = ((AlertDialog) dialog).getListView();
|
||||
int selectedItemPosition = lw.getCheckedItemPosition();
|
||||
builder.setSingleChoiceItems(allDevicesString, 0, (dialog, which) -> {
|
||||
ListView lw = ((AlertDialog) dialog).getListView();
|
||||
int selectedItemPosition = lw.getCheckedItemPosition();
|
||||
|
||||
if (selectedItemPosition > -1) {
|
||||
Map.Entry<String, Pair<String, Integer>> selectedItem =
|
||||
(Map.Entry<String, Pair<String, Integer>>) allDevices.entrySet().toArray()[selectedItemPosition];
|
||||
WidgetPreferenceStorage widgetPreferenceStorage = new WidgetPreferenceStorage();
|
||||
widgetPreferenceStorage.saveWidgetPrefs(getApplicationContext(), String.valueOf(mAppWidgetId), selectedItem.getValue().first);
|
||||
}
|
||||
Intent resultValue = new Intent();
|
||||
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
|
||||
setResult(RESULT_OK, resultValue);
|
||||
finish();
|
||||
if (selectedItemPosition > -1) {
|
||||
final GBDevice selectedItem = allDevices.get(selectedItemPosition);
|
||||
WidgetPreferenceStorage widgetPreferenceStorage = new WidgetPreferenceStorage();
|
||||
widgetPreferenceStorage.saveWidgetPrefs(getApplicationContext(), String.valueOf(mAppWidgetId), selectedItem.getAddress());
|
||||
}
|
||||
Intent resultValueOk = new Intent();
|
||||
resultValueOk.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
|
||||
setResult(RESULT_OK, resultValueOk);
|
||||
finish();
|
||||
});
|
||||
builder.setCancelable(false);
|
||||
|
||||
@@ -116,30 +103,6 @@ public class WidgetConfigurationActivity extends Activity implements GBActivity
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public LinkedHashMap getAllDevices(Context appContext) {
|
||||
DaoSession daoSession;
|
||||
GBApplication gbApp = (GBApplication) appContext;
|
||||
LinkedHashMap<String, Pair<String, Integer>> newMap = new LinkedHashMap<>(1);
|
||||
List<? extends GBDevice> devices = gbApp.getDeviceManager().getDevices();
|
||||
|
||||
try (DBHandler handler = GBApplication.acquireDB()) {
|
||||
daoSession = handler.getDaoSession();
|
||||
for (GBDevice device : devices) {
|
||||
DeviceCoordinator coordinator = device.getDeviceCoordinator();
|
||||
Device dbDevice = DBHelper.findDevice(device, daoSession);
|
||||
int icon = device.getEnabledDisabledIconResource();
|
||||
if (dbDevice != null && coordinator != null
|
||||
&& (coordinator.supportsActivityDataFetching() || coordinator.supportsActivityTracking())
|
||||
&& !newMap.containsKey(device.getAliasOrName())) {
|
||||
newMap.put(device.getAliasOrName(), new Pair(device.getAddress(), icon));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error getting list of all devices: " + e);
|
||||
}
|
||||
return newMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLanguage(Locale language, boolean invalidateLanguage) {
|
||||
AndroidUtils.setLanguage(this, language);
|
||||
|
||||
+18
-6
@@ -31,6 +31,8 @@ import android.content.pm.ShortcutInfo;
|
||||
import android.content.pm.ShortcutManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorMatrix;
|
||||
import android.graphics.ColorMatrixColorFilter;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.os.Build;
|
||||
@@ -128,7 +130,6 @@ import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.RecordedDataTypes;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.BondingUtil;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.FormatUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.GBPrefs;
|
||||
@@ -223,11 +224,14 @@ public class GBDeviceAdapterv2 extends ListAdapter<GBDevice, GBDeviceAdapterv2.V
|
||||
holder.infoIcons.setVisibility(View.GONE);
|
||||
holder.deviceInfoBox.setVisibility(View.GONE);
|
||||
holder.cardViewActivityCardLayout.setVisibility(View.GONE);
|
||||
if(countDevicesInFolder(folder.getName(), true) == 0){
|
||||
holder.deviceImageView.setImageResource(R.drawable.ic_device_folder_disabled);
|
||||
}else{
|
||||
holder.deviceImageView.setImageResource(R.drawable.ic_device_folder);
|
||||
|
||||
holder.deviceImageView.setImageResource(R.drawable.ic_device_folder);
|
||||
if (countDevicesInFolder(folder.getName(), true) == 0) {
|
||||
final ColorMatrix colorMatrix = new ColorMatrix();
|
||||
colorMatrix.setSaturation(0);
|
||||
holder.deviceImageView.setColorFilter(new ColorMatrixColorFilter(colorMatrix));
|
||||
} else {
|
||||
holder.deviceImageView.setColorFilter(null);
|
||||
}
|
||||
holder.deviceInfoView.setVisibility(View.GONE);
|
||||
int countInFolder = countDevicesInFolder(folder.getName(), false);
|
||||
@@ -338,7 +342,15 @@ public class GBDeviceAdapterv2 extends ListAdapter<GBDevice, GBDeviceAdapterv2.V
|
||||
}
|
||||
});
|
||||
|
||||
holder.deviceImageView.setImageResource(device.getEnabledDisabledIconResource());
|
||||
holder.deviceImageView.setImageResource(device.getDeviceCoordinator().getDefaultIconResource());
|
||||
if (device.isInitialized()) {
|
||||
holder.deviceImageView.setColorFilter(null);
|
||||
} else {
|
||||
final ColorMatrix colorMatrix = new ColorMatrix();
|
||||
colorMatrix.setSaturation(0);
|
||||
|
||||
holder.deviceImageView.setColorFilter(new ColorMatrixColorFilter(colorMatrix));
|
||||
}
|
||||
|
||||
holder.deviceNameLabel.setText(getUniqueDeviceName(device));
|
||||
|
||||
|
||||
+13
-13
@@ -25,40 +25,40 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
|
||||
public class SpinnerWithIconAdapter extends ArrayAdapter<SpinnerWithIconItem> {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SpinnerWithIconAdapter.class);
|
||||
int groupid;
|
||||
int groupId;
|
||||
Activity context;
|
||||
ArrayList<SpinnerWithIconItem> list;
|
||||
LayoutInflater inflater;
|
||||
|
||||
public SpinnerWithIconAdapter(Activity context, int groupid, int id, ArrayList<SpinnerWithIconItem>
|
||||
public SpinnerWithIconAdapter(Activity context, int groupId, int id, ArrayList<SpinnerWithIconItem>
|
||||
list) {
|
||||
super(context, id, list);
|
||||
this.list = list;
|
||||
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
this.groupid = groupid;
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View itemView = inflater.inflate(groupid, parent, false);
|
||||
ImageView imageView = (ImageView) itemView.findViewById(R.id.spinner_item_icon);
|
||||
@NonNull
|
||||
public View getView(int position, View convertView, @NonNull ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = inflater.inflate(groupId, parent, false);
|
||||
}
|
||||
ImageView imageView = convertView.findViewById(R.id.spinner_item_icon);
|
||||
imageView.setImageResource(list.get(position).getImageId());
|
||||
TextView textView = (TextView) itemView.findViewById(R.id.spinner_item_text);
|
||||
TextView textView = convertView.findViewById(R.id.spinner_item_text);
|
||||
textView.setText(list.get(position).getText());
|
||||
|
||||
return itemView;
|
||||
return convertView;
|
||||
}
|
||||
|
||||
public View getDropDownView(int position, View convertView, ViewGroup
|
||||
parent) {
|
||||
public View getDropDownView(int position, View convertView, @NonNull ViewGroup parent) {
|
||||
return getView(position, convertView, parent);
|
||||
|
||||
}
|
||||
|
||||
-6
@@ -947,12 +947,6 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||
return R.drawable.ic_device_default;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_default_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsNotificationVibrationPatterns() {
|
||||
return false;
|
||||
|
||||
@@ -831,9 +831,6 @@ public interface DeviceCoordinator {
|
||||
@DrawableRes
|
||||
int getDefaultIconResource();
|
||||
|
||||
@DrawableRes
|
||||
int getDisabledIconResource();
|
||||
|
||||
/**
|
||||
* Whether the device supports a variety of vibration patterns for notifications.
|
||||
*/
|
||||
|
||||
+1
-17
@@ -132,12 +132,7 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
|
||||
@Override
|
||||
public SampleProvider<?> getSampleProvider(GBDevice device, DaoSession session) {
|
||||
return new UnknownSampleProvider();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
return sampleProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -145,11 +140,6 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
return "Generic";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Class<? extends DeviceSupport> getDeviceSupportClass(final GBDevice device) {
|
||||
@@ -167,10 +157,4 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_unknown;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_unknown_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -78,11 +78,6 @@ public class AAWirelessCoordinator extends AbstractBLClassicDeviceCoordinator {
|
||||
return R.drawable.ic_device_car;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_car_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBatteryCount(final GBDevice device) {
|
||||
return 0;
|
||||
|
||||
-7
@@ -274,20 +274,13 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return BangleJSDeviceSupport.class;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_banglejs;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_banglejs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_banglejs_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-80
@@ -19,12 +19,9 @@ package nodomain.freeyourgadget.gadgetbridge.devices.binary_sensor.coordinator;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.le.ScanFilter;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelUuid;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -32,14 +29,11 @@ import java.util.Collections;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.binary_sensor.activity.DataActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.binary_sensor.BinarySensorSupport;
|
||||
|
||||
@@ -59,7 +53,6 @@ public class BinarySensorCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public boolean supports(GBDeviceCandidate candidate) {
|
||||
for(ParcelUuid service : candidate.getServiceUuids()){
|
||||
@@ -70,57 +63,6 @@ public class BinarySensorCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Generic";
|
||||
@@ -136,21 +78,6 @@ public class BinarySensorCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return DataActivity.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBatteryCount(final GBDevice device) {
|
||||
return 0;
|
||||
@@ -167,20 +94,13 @@ public class BinarySensorCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return BONDING_STYLE_NONE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_binary_sensor;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_unknown;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_unknown_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -36,11 +36,6 @@ public class CmfWatchPro2Coordinator extends CmfWatchProCoordinator {
|
||||
return R.drawable.ic_device_watchxplus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_watchxplus_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBondingStyle() {
|
||||
// We can negotiate auth key - #3982
|
||||
|
||||
-5
@@ -138,11 +138,6 @@ public class CmfWatchProCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Class<? extends DeviceSupport> getDeviceSupportClass(final GBDevice device) {
|
||||
|
||||
-5
@@ -103,11 +103,6 @@ public abstract class AbstractColmiR0xCoordinator extends AbstractBLEDeviceCoord
|
||||
return R.drawable.ic_device_smartring;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_smartring_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBondingStyle() {
|
||||
return BONDING_STYLE_NONE;
|
||||
|
||||
-5
@@ -86,11 +86,6 @@ public class PixooCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return R.drawable.ic_device_lovetoy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_lovetoy_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
||||
return new int[]{
|
||||
|
||||
-79
@@ -16,10 +16,6 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.domyos;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.EnumSet;
|
||||
@@ -27,12 +23,9 @@ import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.ServiceDeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.domyos.DomyosT540Support;
|
||||
@@ -43,76 +36,11 @@ public class DomyosT540Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return Pattern.compile("Domyos-TC-9610.*");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Domyos";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return true;
|
||||
@@ -134,20 +62,13 @@ public class DomyosT540Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
// nothing to delete, yet
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_domyos_t540;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_lovetoy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_lovetoy_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -41,9 +41,4 @@ public abstract class AbstractEarFunCoordinator extends AbstractDeviceCoordinato
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_nothingear;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_nothingear_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-12
@@ -8,9 +8,6 @@ import android.content.SharedPreferences;
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -34,7 +31,6 @@ import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.evenrealities.G1Constants;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.evenrealities.G1DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.BondingUtil;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
||||
|
||||
/**
|
||||
* Coordinator for the Even Realities G1 smart glasses. Describes the supported capabilities of the
|
||||
@@ -44,8 +40,6 @@ import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
||||
*/
|
||||
public class G1DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(G1DeviceCoordinator.class);
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Class<? extends DeviceSupport> getDeviceSupportClass(final GBDevice device) {
|
||||
@@ -81,12 +75,6 @@ public class G1DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return R.drawable.ic_device_even_realities_g1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_even_realities_g1_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBondingStyle() {
|
||||
return BONDING_STYLE_LAZY;
|
||||
|
||||
-16
@@ -16,10 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.femometer;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -70,12 +67,6 @@ public class FemometerVinca2DeviceCoordinator extends AbstractDeviceCoordinator
|
||||
return R.drawable.ic_device_thermometer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_thermometer_disabled;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
|
||||
Long deviceId = device.getId();
|
||||
@@ -83,18 +74,11 @@ public class FemometerVinca2DeviceCoordinator extends AbstractDeviceCoordinator
|
||||
qb.where(FemometerVinca2TemperatureSampleDao.Properties.DeviceId.eq(deviceId)).buildDelete().executeDeleteWithoutDetachingEntities();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getBondingStyle(){
|
||||
return BONDING_STYLE_NONE;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(final GBDevice device) {
|
||||
return 1;
|
||||
|
||||
-6
@@ -43,12 +43,6 @@ public class ColaCao21Coordinator extends FitProDeviceCoordinator {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_colacao21;
|
||||
|
||||
-6
@@ -43,12 +43,6 @@ public class ColaCao23Coordinator extends FitProDeviceCoordinator {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_colacao23;
|
||||
|
||||
+2
-79
@@ -16,25 +16,17 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.flipper.zero;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.flipper.zero.support.FlipperZeroSupport;
|
||||
|
||||
@@ -44,81 +36,19 @@ public class FlipperZeroCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public boolean supports(GBDeviceCandidate candidate) {
|
||||
if(candidate.supportsService(UUID.fromString("00003082-0000-1000-8000-00805f9b34fb"))){
|
||||
return true; // need to filter for flipper here
|
||||
if (candidate.supportsService(UUID.fromString("00003082-0000-1000-8000-00805f9b34fb"))){
|
||||
return true; // TODO need to filter for flipper here
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Flipper Devices";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Class<? extends DeviceSupport> getDeviceSupportClass(final GBDevice device) {
|
||||
@@ -130,20 +60,13 @@ public class FlipperZeroCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return BONDING_STYLE_NONE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_flipper_zero;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_flipper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_flipper_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-7
@@ -16,8 +16,6 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -68,9 +66,4 @@ public class GalaxyBuds2DeviceCoordinator extends GalaxyBudsGenericCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_galaxy_buds_pro;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_galaxy_buds_pro_disabled;
|
||||
}
|
||||
}
|
||||
-9
@@ -16,16 +16,12 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||
|
||||
public class GalaxyBuds2ProDeviceCoordinator extends GalaxyBudsGenericCoordinator {
|
||||
@Override
|
||||
@@ -69,9 +65,4 @@ public class GalaxyBuds2ProDeviceCoordinator extends GalaxyBudsGenericCoordinato
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_galaxy_buds_pro;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_galaxy_buds_pro_disabled;
|
||||
}
|
||||
}
|
||||
-82
@@ -17,104 +17,28 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLClassicDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.galaxy_buds.GalaxyBudsDeviceSupport;
|
||||
|
||||
public abstract class GalaxyBudsGenericCoordinator extends AbstractBLClassicDeviceCoordinator {
|
||||
|
||||
@Override
|
||||
public int getBondingStyle() {
|
||||
return BONDING_STYLE_BOND;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice
|
||||
device, DaoSession session) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Samsung";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return true;
|
||||
@@ -123,7 +47,6 @@ public abstract class GalaxyBudsGenericCoordinator extends AbstractBLClassicDevi
|
||||
@Override
|
||||
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device
|
||||
device, @NonNull DaoSession session) throws GBException {
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -136,9 +59,4 @@ public abstract class GalaxyBudsGenericCoordinator extends AbstractBLClassicDevi
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_galaxy_buds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_galaxy_buds_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -64,9 +64,4 @@ public class GalaxyBudsLiveDeviceCoordinator extends GalaxyBudsGenericCoordinato
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_galaxy_buds_live;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_galaxy_buds_live_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-9
@@ -16,16 +16,12 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||
|
||||
public class GalaxyBudsProDeviceCoordinator extends GalaxyBudsGenericCoordinator {
|
||||
@Override
|
||||
@@ -69,9 +65,4 @@ public class GalaxyBudsProDeviceCoordinator extends GalaxyBudsGenericCoordinator
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_galaxy_buds_pro;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_galaxy_buds_pro_disabled;
|
||||
}
|
||||
}
|
||||
-5
@@ -10,11 +10,6 @@ public abstract class GarminWatchCoordinator extends GarminCoordinator {
|
||||
return R.drawable.ic_device_zetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_zetime_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return true;
|
||||
|
||||
-5
@@ -80,11 +80,6 @@ public class GenericHeadphonesCoordinator extends AbstractDeviceCoordinator {
|
||||
return R.drawable.ic_device_headphones;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_headphones_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceSpecificSettings getDeviceSpecificSettings(final GBDevice device) {
|
||||
final DeviceSpecificSettings deviceSpecificSettings = new DeviceSpecificSettings();
|
||||
|
||||
-5
@@ -53,11 +53,6 @@ public class GreeAcCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return R.drawable.ic_device_air_conditioning;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_air_conditioning_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean suggestUnbindBeforePair() {
|
||||
// shouldn't matter
|
||||
|
||||
-5
@@ -263,9 +263,4 @@ public class HPlusCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_hplus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_hplus_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -638,9 +638,4 @@ public abstract class HuamiCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_zetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_zetime_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -180,9 +180,4 @@ public class AmazfitBand5Coordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_miband2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miband2_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -134,9 +134,4 @@ public class AmazfitBipCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -186,9 +186,4 @@ public class AmazfitBip3Coordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -183,9 +183,4 @@ public class AmazfitBip3ProCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -155,9 +155,4 @@ public class AmazfitBipSCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -184,9 +184,4 @@ public class AmazfitBipUCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -175,9 +175,4 @@ public class AmazfitBipUProCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -144,9 +144,4 @@ public class AmazfitCorCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_default;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_default_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -144,9 +144,4 @@ public class AmazfitCor2Coordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_default;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_default_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -145,9 +145,4 @@ public class AmazfitGTSCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -150,9 +150,4 @@ public class AmazfitGTS2Coordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -150,9 +150,4 @@ public class AmazfitGTS2eCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -145,9 +145,4 @@ public class AmazfitNeoCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-10
@@ -47,16 +47,6 @@ public class AmazfitPopCoordinator extends AmazfitBipUCoordinator {
|
||||
return R.string.devicetype_amazfit_pop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Class<? extends DeviceSupport> getDeviceSupportClass(final GBDevice device) {
|
||||
|
||||
-5
@@ -126,9 +126,4 @@ public class AmazfitVergeLCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -143,9 +143,4 @@ public class AmazfitXCoordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_miband2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miband2_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -133,9 +133,4 @@ public class MiBand2Coordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_miband2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miband2_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -119,11 +119,6 @@ public class MiBand2HRXCoordinator extends HuamiCoordinator {
|
||||
return R.drawable.ic_device_miband2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miband2_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_miband2_hrx;
|
||||
|
||||
-5
@@ -167,9 +167,4 @@ public class MiBand3Coordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_miband2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miband2_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -177,9 +177,4 @@ public class MiBand4Coordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_miband2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miband2_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -196,9 +196,4 @@ public class MiBand5Coordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_miband2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miband2_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -218,9 +218,4 @@ public class MiBand6Coordinator extends HuamiCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_miband6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miband6_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -60,9 +60,4 @@ public class AmazfitBand7Coordinator extends ZeppOsCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_default;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_default_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -68,9 +68,4 @@ public class AmazfitBip5Coordinator extends ZeppOsCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -64,9 +64,4 @@ public class AmazfitBip5UnityCoordinator extends ZeppOsCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -69,9 +69,4 @@ public class AmazfitBip6Coordinator extends ZeppOsCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -82,9 +82,4 @@ public class AmazfitCheetahSquareCoordinator extends ZeppOsCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -58,9 +58,4 @@ public class AmazfitGTS3Coordinator extends ZeppOsCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -78,9 +78,4 @@ public class AmazfitGTS4Coordinator extends ZeppOsCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -58,9 +58,4 @@ public class AmazfitGTS4MiniCoordinator extends ZeppOsCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_amazfit_bip_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -79,9 +79,4 @@ public class MiBand7Coordinator extends ZeppOsCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_miband6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miband6_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -60,11 +60,6 @@ public abstract class HuaweiFreebudsCoordinator extends AbstractBLClassicDeviceC
|
||||
return R.drawable.ic_device_nothingear;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_nothingear_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HuaweiCoordinator getHuaweiCoordinator() {
|
||||
return huaweiCoordinator;
|
||||
|
||||
+2
-71
@@ -17,21 +17,17 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.id115;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.le.ScanFilter;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelUuid;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
@@ -54,13 +50,9 @@ public class ID115Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public boolean supports(GBDeviceCandidate candidate) {
|
||||
if (candidate.supportsService(ID115Constants.UUID_SERVICE_ID115)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return candidate.supportsService(ID115Constants.UUID_SERVICE_ID115);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,12 +60,6 @@ public class ID115Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return BONDING_STYLE_NONE;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return true;
|
||||
@@ -89,61 +75,11 @@ public class ID115Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return new ID115SampleProvider(device, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "VeryFit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
||||
return new int[]{
|
||||
@@ -170,9 +106,4 @@ public class ID115Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_h30_h10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_h30_h10_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-73
@@ -17,10 +17,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.itag;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.le.ScanFilter;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -30,12 +27,9 @@ import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.itag.ITagSupport;
|
||||
|
||||
@@ -65,76 +59,16 @@ public class ITagCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return Collections.singletonList(filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Unspecified"; //TODO: Show chip manufacturer?
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return false; //TODO: RRSI
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return true;
|
||||
@@ -151,20 +85,13 @@ public class ITagCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
// nothing to delete, yet
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_itag;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_itag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_itag_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
+7
-103
@@ -18,36 +18,25 @@
|
||||
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.jyou;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.le.ScanFilter;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelUuid;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.jyou.BFH16DeviceSupport;
|
||||
|
||||
public class BFH16DeviceCoordinator extends AbstractBLEDeviceCoordinator
|
||||
{
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(BFH16DeviceCoordinator.class);
|
||||
|
||||
public class BFH16DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Denver";
|
||||
@@ -56,7 +45,6 @@ public class BFH16DeviceCoordinator extends AbstractBLEDeviceCoordinator
|
||||
@NonNull
|
||||
@Override
|
||||
public Collection<? extends ScanFilter> createBLEScanFilters() {
|
||||
|
||||
ParcelUuid bfhService1 = new ParcelUuid(BFH16Constants.BFH16_IDENTIFICATION_SERVICE1);
|
||||
ParcelUuid bfhService2 = new ParcelUuid(BFH16Constants.BFH16_IDENTIFICATION_SERVICE2);
|
||||
|
||||
@@ -74,125 +62,41 @@ public class BFH16DeviceCoordinator extends AbstractBLEDeviceCoordinator
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBondingStyle(){
|
||||
public int getBondingStyle() {
|
||||
return BONDING_STYLE_NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity(){
|
||||
return null;
|
||||
}
|
||||
|
||||
//Additional required functions ______________________________________
|
||||
|
||||
@Override
|
||||
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//Supported ________________________________________________________
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device)
|
||||
{
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice()
|
||||
{
|
||||
public boolean supportsFindDevice() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsHeartRateMeasurement(GBDevice device)
|
||||
{
|
||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData()
|
||||
{
|
||||
public boolean supportsRealtimeData() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//NOT Supported ________________________________________________________
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsLedColor()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsMusicInfo()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRgbLedColor()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Class<? extends DeviceSupport> getDeviceSupportClass(final GBDevice device) {
|
||||
return BFH16DeviceSupport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_bfh16;
|
||||
|
||||
-70
@@ -17,15 +17,9 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.jyou.TeclastH30;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.le.ScanFilter;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelUuid;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -34,21 +28,15 @@ import androidx.annotation.NonNull;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.jyou.JYouConstants;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.jyou.TeclastH30.TeclastH30Support;
|
||||
|
||||
public class TeclastH30Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(TeclastH30Coordinator.class);
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Collection<? extends ScanFilter> createBLEScanFilters() {
|
||||
@@ -57,7 +45,6 @@ public class TeclastH30Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return Collections.singletonList(filter);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public boolean supports(GBDeviceCandidate candidate) {
|
||||
if (candidate.supportsService(JYouConstants.UUID_SERVICE_JYOU)) {
|
||||
@@ -77,21 +64,11 @@ public class TeclastH30Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return BONDING_STYLE_NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return true;
|
||||
@@ -103,36 +80,6 @@ public class TeclastH30Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return TeclastH30Support.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 3;
|
||||
@@ -148,35 +95,18 @@ public class TeclastH30Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return "Teclast";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_teclast_h30;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_h30_h10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_h30_h10_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-48
@@ -17,11 +17,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.jyou.y5;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -29,7 +25,6 @@ import de.greenrobot.dao.query.QueryBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.jyou.JYouSampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
@@ -53,12 +48,6 @@ public class Y5Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return Pattern.compile(".*Y5.*");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return true;
|
||||
@@ -74,16 +63,6 @@ public class Y5Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return new JYouSampleProvider(device, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 3;
|
||||
@@ -104,31 +83,11 @@ public class Y5Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return "Y5";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return true;
|
||||
@@ -140,20 +99,13 @@ public class Y5Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return Y5Support.class;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_y5;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_h30_h10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_h30_h10_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-11
@@ -50,15 +50,4 @@ public class BohemicSmartBraceletDeviceCoordinator extends LefunDeviceCoordinato
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_bohemic_smart_bracelet;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_h30_h10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_h30_h10_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -157,9 +157,4 @@ public class LefunDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_h30_h10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_h30_h10_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-10
@@ -49,14 +49,4 @@ public class VivitarHrBpMonitorActivityTrackerCoordinator extends LefunDeviceCoo
|
||||
public int getDeviceNameResource() {
|
||||
return R.string.devicetype_vivitar_hr_bp_monitor_activity_tracker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_h30_h10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_h30_h10_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
+10
-9
@@ -17,6 +17,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.lenovo.watchxplus;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.le.ScanFilter;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -79,6 +80,7 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return BONDING_STYLE_NONE;
|
||||
}
|
||||
|
||||
/** @noinspection RedundantIfStatement*/
|
||||
@Override
|
||||
public boolean supports(GBDeviceCandidate candidate) {
|
||||
String macAddress = candidate.getMacAddress().toUpperCase();
|
||||
@@ -190,23 +192,24 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
int iDuration;
|
||||
|
||||
try {
|
||||
iDuration = Integer.valueOf(duration);
|
||||
iDuration = Integer.parseInt(duration);
|
||||
} catch (Exception ex) {
|
||||
iDuration = 60;
|
||||
}
|
||||
|
||||
return iDuration;
|
||||
} catch (Exception e) {
|
||||
LOG.error("Failed to parse find phone time", e);
|
||||
return FindPhone_ON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param startOut out Only hour/minute are used.
|
||||
* @param endOut out Only hour/minute are used.
|
||||
* @return True if DND hours are enabled.
|
||||
* @noinspection DataFlowIssue
|
||||
*/
|
||||
public static boolean getDNDHours(String deviceAddress, Calendar startOut, Calendar endOut) {
|
||||
SharedPreferences prefs = GBApplication.getDeviceSpecificSharedPrefs(deviceAddress);
|
||||
@@ -220,7 +223,7 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
String start = prefs.getString(DeviceSettingsPreferenceConst.PREF_DO_NOT_DISTURB_NOAUTO_START, "01:00");
|
||||
String end = prefs.getString(DeviceSettingsPreferenceConst.PREF_DO_NOT_DISTURB_NOAUTO_END, "06:00");
|
||||
|
||||
DateFormat df = new SimpleDateFormat("HH:mm");
|
||||
@SuppressLint("SimpleDateFormat") DateFormat df = new SimpleDateFormat("HH:mm");
|
||||
|
||||
try {
|
||||
startOut.setTime(df.parse(start));
|
||||
@@ -228,6 +231,7 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
LOG.error("Failed to parse dnd hours", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -237,6 +241,7 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
* @param startOut out Only hour/minute are used.
|
||||
* @param endOut out Only hour/minute are used.
|
||||
* @return True if DND hours are enabled.
|
||||
* @noinspection DataFlowIssue
|
||||
*/
|
||||
public static boolean getLongSitHours(String deviceAddress, Calendar startOut, Calendar endOut) {
|
||||
SharedPreferences prefs = GBApplication.getDeviceSpecificSharedPrefs(deviceAddress);
|
||||
@@ -249,7 +254,7 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
String start = prefs.getString(DeviceSettingsPreferenceConst.PREF_INACTIVITY_START, "06:00");
|
||||
String end = prefs.getString(DeviceSettingsPreferenceConst.PREF_INACTIVITY_END, "23:00");
|
||||
|
||||
DateFormat df = new SimpleDateFormat("HH:mm");
|
||||
@SuppressLint("SimpleDateFormat") DateFormat df = new SimpleDateFormat("HH:mm");
|
||||
|
||||
try {
|
||||
startOut.setTime(df.parse(start));
|
||||
@@ -257,6 +262,7 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
LOG.error("Failed to parse long sit hours", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -277,9 +283,4 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_watchxplus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_watchxplus_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-72
@@ -17,10 +17,6 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.liveview;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
@@ -28,12 +24,9 @@ import java.util.regex.Pattern;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLClassicDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.liveview.LiveviewSupport;
|
||||
|
||||
@@ -43,76 +36,11 @@ public class LiveviewCoordinator extends AbstractBLClassicDeviceCoordinator {
|
||||
return Pattern.compile("LiveView.*");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Sony Ericsson";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return true;
|
||||
|
||||
+3
-49
@@ -22,13 +22,9 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -38,7 +34,6 @@ import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
@@ -95,7 +90,7 @@ public class MakibesHR3Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
LOG.error("Unexpected exception in MiBand2Coordinator.getTime: " + e.getMessage());
|
||||
LOG.error("Failed to parse time", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -118,7 +113,7 @@ public class MakibesHR3Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
int iDuration;
|
||||
|
||||
try {
|
||||
iDuration = Integer.valueOf(duration);
|
||||
iDuration = Integer.parseInt(duration);
|
||||
} catch (Exception ex) {
|
||||
LOG.warn(ex.getMessage());
|
||||
iDuration = 60;
|
||||
@@ -126,7 +121,7 @@ public class MakibesHR3Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
|
||||
return iDuration;
|
||||
} catch (Exception e) {
|
||||
LOG.error("Unexpected exception in MiBand2Coordinator.getTime: " + e.getMessage());
|
||||
LOG.error("Failed to parse duration", e);
|
||||
return FindPhone_ON;
|
||||
}
|
||||
}
|
||||
@@ -149,37 +144,16 @@ public class MakibesHR3Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return BONDING_STYLE_BOND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return true;
|
||||
@@ -190,16 +164,6 @@ public class MakibesHR3Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return new MakibesHR3SampleProvider(device, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 8;
|
||||
@@ -215,16 +179,6 @@ public class MakibesHR3Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return "Makibes";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
||||
return new int[]{
|
||||
|
||||
-6
@@ -44,11 +44,6 @@ public class MarstekB2500DeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
return R.drawable.ic_device_vesc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_vesc_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Marstek";
|
||||
@@ -98,5 +93,4 @@ public class MarstekB2500DeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
public boolean isExperimental() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-12
@@ -160,10 +160,11 @@ public class MiBandCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @noinspection BooleanMethodIsAlwaysInverted*/
|
||||
public static boolean hasValidUserInfo() {
|
||||
String dummyMacAddress = MiBandService.MAC_ADDRESS_FILTER_1_1A + ":00:00:00";
|
||||
try {
|
||||
UserInfo userInfo = getConfiguredUserInfo(dummyMacAddress);
|
||||
getConfiguredUserInfo(dummyMacAddress);
|
||||
return true;
|
||||
} catch (IllegalArgumentException ex) {
|
||||
return false;
|
||||
@@ -174,13 +175,12 @@ public class MiBandCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
* Returns the configured user info, or, if that is not available or invalid,
|
||||
* a default user info.
|
||||
*
|
||||
* @param miBandAddress
|
||||
*/
|
||||
public static UserInfo getAnyUserInfo(String miBandAddress) {
|
||||
try {
|
||||
return getConfiguredUserInfo(miBandAddress);
|
||||
} catch (Exception ex) {
|
||||
LOG.error("Error creating user info from settings, using default user instead: " + ex);
|
||||
LOG.error("Error creating user info from settings, using default user instead", ex);
|
||||
return UserInfo.getDefault(miBandAddress);
|
||||
}
|
||||
}
|
||||
@@ -188,14 +188,13 @@ public class MiBandCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
/**
|
||||
* Returns the user info from the user configured data in the preferences.
|
||||
*
|
||||
* @param miBandAddress
|
||||
* @throws IllegalArgumentException when the user info can not be created
|
||||
*/
|
||||
public static UserInfo getConfiguredUserInfo(String miBandAddress) throws IllegalArgumentException {
|
||||
ActivityUser activityUser = new ActivityUser();
|
||||
Prefs prefs = GBApplication.getPrefs();
|
||||
|
||||
UserInfo info = UserInfo.create(
|
||||
return UserInfo.create(
|
||||
miBandAddress,
|
||||
prefs.getString(PREF_USER_NAME, null),
|
||||
activityUser.getGender(),
|
||||
@@ -204,7 +203,6 @@ public class MiBandCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
activityUser.getWeightKg(),
|
||||
0
|
||||
);
|
||||
return info;
|
||||
}
|
||||
|
||||
public static int getWearLocation(String deviceAddress) throws IllegalArgumentException {
|
||||
@@ -300,10 +298,4 @@ public class MiBandCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_miband;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miband_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -36,11 +36,6 @@ public class MijiaLywsd02Coordinator extends AbstractMijiaLywsdCoordinator {
|
||||
return R.drawable.ic_device_pebble;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_pebble_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSetTime() {
|
||||
return true;
|
||||
|
||||
-5
@@ -36,11 +36,6 @@ public class MijiaLywsd03Coordinator extends AbstractMijiaLywsdCoordinator {
|
||||
return R.drawable.ic_device_thermometer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_thermometer_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSetTime() {
|
||||
return false;
|
||||
|
||||
-5
@@ -36,11 +36,6 @@ public class MijiaMhoC303Coordinator extends AbstractMijiaLywsdCoordinator {
|
||||
return R.drawable.ic_device_pebble;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_pebble_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSetTime() {
|
||||
return true;
|
||||
|
||||
-5
@@ -36,11 +36,6 @@ public class MijiaXmwsdj04Coordinator extends AbstractMijiaLywsdCoordinator {
|
||||
return R.drawable.ic_device_thermometer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_thermometer_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSetTime() {
|
||||
return false;
|
||||
|
||||
+1
-6
@@ -75,7 +75,7 @@ public class MiCompositionScaleCoordinator extends AbstractBLEDeviceCoordinator
|
||||
|
||||
@Override
|
||||
public int getBondingStyle() {
|
||||
return super.BONDING_STYLE_NONE;
|
||||
return BONDING_STYLE_NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,9 +134,4 @@ public class MiCompositionScaleCoordinator extends AbstractBLEDeviceCoordinator
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_miscale;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miscale_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -58,11 +58,6 @@ public class MiSmartScaleCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
return R.drawable.ic_device_miscale;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miscale_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBatteryCount(final GBDevice device) {
|
||||
return 0;
|
||||
|
||||
-5
@@ -52,11 +52,6 @@ public class MoondropSpaceTravelCoordinator extends AbstractBLClassicDeviceCoord
|
||||
return R.drawable.ic_device_nothingear;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_nothingear_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsOSBatteryLevel() {
|
||||
return true;
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -43,12 +40,6 @@ public class AdvanWatchSE1AICoordinator extends AbstractMoyoungDeviceCoordinator
|
||||
return R.drawable.ic_device_miwatch;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miwatch_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Advan";
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -42,12 +39,6 @@ public class C20Coordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_banglejs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_banglejs_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Unspecified";
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -43,12 +40,6 @@ public class ColmiI28UltraCoordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_miwatch;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miwatch_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Colmi";
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -43,12 +40,6 @@ public class ColmiV72Coordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_miwatch;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miwatch_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Colmi";
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -43,12 +40,6 @@ public class ColmiV89Coordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_miwatch;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miwatch_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Colmi";
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -43,12 +40,6 @@ public class FireBolttTalkCoordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_miwatch;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miwatch_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Fire-Boltt";
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -42,12 +39,6 @@ public class KT80Coordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_banglejs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_banglejs_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Unspecified";
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -43,12 +40,6 @@ public class KsixVentureCoordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_miwatch;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miwatch_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "KSIX";
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -43,12 +40,6 @@ public class MisirunC17Coordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_banglejs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_banglejs_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Misirun";
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -42,12 +39,6 @@ public class R50ProCoordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_banglejs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_banglejs_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Unspecified";
|
||||
|
||||
-9
@@ -18,9 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.moyoung;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
@@ -43,12 +40,6 @@ public class RainbuvvyT97Coordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_miwatch;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miwatch_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Rainbuvvy";
|
||||
|
||||
-6
@@ -43,12 +43,6 @@ public class ViranC29Coordinator extends AbstractMoyoungDeviceCoordinator {
|
||||
return R.drawable.ic_device_miwatch;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DrawableRes
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_miwatch_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getManufacturer() {
|
||||
return "Viran";
|
||||
|
||||
+1
-51
@@ -18,10 +18,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.no1f1;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.le.ScanFilter;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelUuid;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -29,12 +26,11 @@ import java.util.Collections;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBException;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
||||
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
||||
@@ -63,12 +59,6 @@ public class No1F1Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return BONDING_STYLE_NONE;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Class<? extends Activity> getPairingActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityDataFetching() {
|
||||
return true;
|
||||
@@ -84,16 +74,6 @@ public class No1F1Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return new No1F1SampleProvider(device, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlarmSlotCount(GBDevice device) {
|
||||
return 3;
|
||||
@@ -109,31 +89,6 @@ public class No1F1Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
return "NO1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAppsManagement(final GBDevice device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Activity> getAppsManagementActivity() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCalendarEvents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsRealtimeData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsWeather() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFindDevice() {
|
||||
return true;
|
||||
@@ -163,9 +118,4 @@ public class No1F1Coordinator extends AbstractBLEDeviceCoordinator {
|
||||
public int getDefaultIconResource() {
|
||||
return R.drawable.ic_device_hplus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_hplus_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -87,11 +87,6 @@ public abstract class AbstractEarCoordinator extends AbstractBLClassicDeviceCoor
|
||||
return R.drawable.ic_device_nothingear;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisabledIconResource() {
|
||||
return R.drawable.ic_device_nothingear_disabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceSpecificSettingsCustomizer getDeviceSpecificSettingsCustomizer(final GBDevice device) {
|
||||
return new EarSettingsCustomizer();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user