mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-25 16:50:44 +02:00
Use old Sleep Monitor Activity for Pebble/Morpheuz
The new one does not look good with Morpheuz data yet (samples every 10 minutes)
This commit is contained in:
parent
d2f7169de4
commit
73187431b2
@ -56,7 +56,7 @@
|
||||
android:value=".ControlCenter" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".SleepMonitorActivity"
|
||||
android:name=".activities.SleepChartActivityOld"
|
||||
android:label="@string/title_activity_sleepmonitor" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
|
@ -8,6 +8,7 @@ import android.support.v4.content.LocalBroadcastManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.SleepChartActivityOld;
|
||||
import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommand;
|
||||
import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandAppInfo;
|
||||
import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandCallControl;
|
||||
@ -126,7 +127,7 @@ public abstract class AbstractDeviceSupport implements DeviceSupport {
|
||||
public void handleGBDeviceCommand(GBDeviceCommandSleepMonitorResult sleepMonitorResult) {
|
||||
Context context = getContext();
|
||||
LOG.info("Got command for SLEEP_MONIOR_RES");
|
||||
Intent sleepMontiorIntent = new Intent(SleepMonitorActivity.ACTION_REFRESH);
|
||||
Intent sleepMontiorIntent = new Intent(SleepChartActivityOld.ACTION_REFRESH);
|
||||
sleepMontiorIntent.putExtra("smartalarm_from", sleepMonitorResult.smartalarm_from);
|
||||
sleepMontiorIntent.putExtra("smartalarm_to", sleepMonitorResult.smartalarm_to);
|
||||
sleepMontiorIntent.putExtra("recording_base_timestamp", sleepMonitorResult.recording_base_timestamp);
|
||||
|
@ -28,6 +28,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.SleepChartActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.SleepChartActivityOld;
|
||||
import nodomain.freeyourgadget.gadgetbridge.adapter.GBDeviceAdapter;
|
||||
import nodomain.freeyourgadget.gadgetbridge.discovery.DiscoveryActivity;
|
||||
import nodomain.freeyourgadget.gadgetbridge.miband.MiBandConst;
|
||||
@ -177,8 +178,13 @@ public class ControlCenter extends Activity {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.controlcenter_start_sleepmonitor:
|
||||
if (selectedDevice != null) {
|
||||
// Intent startIntent = new Intent(ControlCenter.this, SleepMonitorActivity.class);
|
||||
Intent startIntent = new Intent(ControlCenter.this, SleepChartActivity.class);
|
||||
Intent startIntent;
|
||||
if (selectedDevice.getType() == DeviceType.MIBAND) {
|
||||
startIntent = new Intent(ControlCenter.this, SleepChartActivity.class);
|
||||
}
|
||||
else {
|
||||
startIntent =new Intent(ControlCenter.this, SleepChartActivityOld.class);
|
||||
}
|
||||
startIntent.putExtra("device", selectedDevice);
|
||||
startActivity(startIntent);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge;
|
||||
package nodomain.freeyourgadget.gadgetbridge.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.BroadcastReceiver;
|
||||
@ -25,11 +25,17 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.ControlCenter;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
|
||||
public class SleepMonitorActivity extends Activity implements SurfaceHolder.Callback {
|
||||
|
||||
public class SleepChartActivityOld extends Activity implements SurfaceHolder.Callback {
|
||||
public static final String ACTION_REFRESH
|
||||
= "nodomain.freeyourgadget.gadgetbride.sleepmonitor.action.refresh";
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SleepMonitorActivity.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SleepChartActivityOld.class);
|
||||
|
||||
private SurfaceView surfaceView;
|
||||
private TextView textView;
|
Loading…
Reference in New Issue
Block a user