Update NOChart.java
This commit is contained in:
parent
90ce3a524f
commit
20a005c899
1 changed files with 12 additions and 1 deletions
|
@ -13,6 +13,7 @@ import android.graphics.Paint;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.Shader;
|
import android.graphics.Shader;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
@ -22,6 +23,7 @@ import android.support.v4.content.LocalBroadcastManager;
|
||||||
import android.support.wearable.view.WatchViewStub;
|
import android.support.wearable.view.WatchViewStub;
|
||||||
import android.support.wearable.watchface.WatchFaceStyle;
|
import android.support.wearable.watchface.WatchFaceStyle;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -30,6 +32,7 @@ import android.view.WindowInsets;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.google.android.gms.wearable.DataMap;
|
import com.google.android.gms.wearable.DataMap;
|
||||||
import com.ustwo.clockwise.common.WatchFaceTime;
|
import com.ustwo.clockwise.common.WatchFaceTime;
|
||||||
|
@ -40,6 +43,7 @@ import com.ustwo.clockwise.wearable.WatchFace;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
import info.nightscout.androidaps.BuildConfig;
|
||||||
import info.nightscout.androidaps.data.BasalWatchData;
|
import info.nightscout.androidaps.data.BasalWatchData;
|
||||||
import info.nightscout.androidaps.data.BgWatchData;
|
import info.nightscout.androidaps.data.BgWatchData;
|
||||||
import info.nightscout.androidaps.data.ListenerService;
|
import info.nightscout.androidaps.data.ListenerService;
|
||||||
|
@ -52,6 +56,7 @@ import lecho.lib.hellocharts.view.LineChartView;
|
||||||
*/
|
*/
|
||||||
public class NOChart extends WatchFace implements SharedPreferences.OnSharedPreferenceChangeListener {
|
public class NOChart extends WatchFace implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
public final static IntentFilter INTENT_FILTER;
|
public final static IntentFilter INTENT_FILTER;
|
||||||
|
public static final int SCREENSIZE_SMALL = 280;
|
||||||
public TextView mTime, mSgv, mTimestamp, mDelta, mAvgDelta;
|
public TextView mTime, mSgv, mTimestamp, mDelta, mAvgDelta;
|
||||||
public RelativeLayout mRelativeLayout;
|
public RelativeLayout mRelativeLayout;
|
||||||
public long sgvLevel = 0;
|
public long sgvLevel = 0;
|
||||||
|
@ -96,6 +101,12 @@ public class NOChart extends WatchFace implements SharedPreferences.OnSharedPref
|
||||||
sharedPrefs.registerOnSharedPreferenceChangeListener(this);
|
sharedPrefs.registerOnSharedPreferenceChangeListener(this);
|
||||||
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
layoutView = inflater.inflate(R.layout.activity_nochart, null);
|
layoutView = inflater.inflate(R.layout.activity_nochart, null);
|
||||||
|
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
||||||
|
if(metrics.widthPixels < SCREENSIZE_SMALL || metrics.heightPixels < SCREENSIZE_SMALL){
|
||||||
|
layoutView = inflater.inflate(R.layout.activity_nochart_small, null);
|
||||||
|
} else {
|
||||||
|
layoutView = inflater.inflate(R.layout.activity_nochart, null);
|
||||||
|
}
|
||||||
performViewSetup();
|
performViewSetup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue