Merge pull request #1082 from Andries-Smit/wear-charge-mode
Wear: add feature: simplified watch face during charging
This commit is contained in:
commit
a3b8c12c27
|
@ -79,6 +79,9 @@
|
|||
<intent-filter>
|
||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
|
||||
|
||||
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
|
||||
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
@ -100,6 +103,9 @@
|
|||
<intent-filter>
|
||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
|
||||
|
||||
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
|
||||
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
@ -121,6 +127,9 @@
|
|||
<intent-filter>
|
||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
|
||||
|
||||
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
|
||||
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
@ -142,6 +151,9 @@
|
|||
<intent-filter>
|
||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
|
||||
|
||||
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
|
||||
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
@ -163,6 +175,9 @@
|
|||
<intent-filter>
|
||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
|
||||
|
||||
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
|
||||
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
|
@ -204,6 +219,9 @@
|
|||
<intent-filter>
|
||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
|
||||
|
||||
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
|
||||
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
@ -544,6 +562,7 @@
|
|||
<action android:name="watch_face_configuration_largehome" />
|
||||
<action android:name="watch_face_configuration_nochart" />
|
||||
<action android:name="watch_face_configuration_steampunk" />
|
||||
|
||||
<category android:name="com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
|
|
|
@ -34,7 +34,7 @@ public class SgvComplication extends BaseComplicationProviderService {
|
|||
switch (dataType) {
|
||||
case ComplicationData.TYPE_SHORT_TEXT:
|
||||
final ComplicationData.Builder builder = new ComplicationData.Builder(ComplicationData.TYPE_SHORT_TEXT)
|
||||
.setShortText(ComplicationText.plainText(raw.sSgv + raw.sDirection))
|
||||
.setShortText(ComplicationText.plainText(raw.sSgv + raw.sDirection + "\uFE0E"))
|
||||
.setShortTitle(ComplicationText.plainText(displayFormat.shortTrend(raw)))
|
||||
.setTapAction(complicationPendingIntent);
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import android.graphics.Color;
|
|||
import android.graphics.Paint;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.PowerManager;
|
||||
import android.os.Vibrator;
|
||||
import android.preference.PreferenceManager;
|
||||
|
@ -25,6 +26,7 @@ import android.widget.LinearLayout;
|
|||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.google.android.gms.wearable.DataMap;
|
||||
|
@ -40,7 +42,6 @@ import javax.inject.Inject;
|
|||
|
||||
import dagger.android.AndroidInjection;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.complications.BaseComplicationProviderService;
|
||||
import info.nightscout.androidaps.data.ListenerService;
|
||||
import info.nightscout.androidaps.data.RawDisplayData;
|
||||
import info.nightscout.androidaps.interaction.utils.Persistence;
|
||||
|
@ -59,7 +60,6 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferenc
|
|||
@Inject Persistence persistence;
|
||||
|
||||
public final static IntentFilter INTENT_FILTER;
|
||||
public static final long[] vibratePattern = {0, 400, 300, 400, 300, 400};
|
||||
|
||||
static {
|
||||
INTENT_FILTER = new IntentFilter();
|
||||
|
@ -70,7 +70,9 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferenc
|
|||
|
||||
public final Point displaySize = new Point();
|
||||
public TextView mTime, mHour, mMinute, mSgv, mDirection, mTimestamp, mUploaderBattery, mRigBattery, mDelta, mAvgDelta, mStatus, mBasalRate, mIOB1, mIOB2, mCOB1, mCOB2, mBgi, mLoop, mDay, mDayName, mMonth, isAAPSv2, mHighLight, mLowLight;
|
||||
public TextView mSimpleSvg, mSimpleDirection, mSimpleTime;
|
||||
public ImageView mGlucoseDial, mDeltaGauge, mHourHand, mMinuteHand;
|
||||
public View mSimpleUi;
|
||||
public RelativeLayout mRelativeLayout;
|
||||
public LinearLayout mLinearLayout, mLinearLayout2, mDate, mChartTap, mMainMenuTap;
|
||||
public int ageLevel = 1;
|
||||
|
@ -100,6 +102,8 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferenc
|
|||
protected SharedPreferences sharedPrefs;
|
||||
private LocalBroadcastManager localBroadcastManager;
|
||||
private MessageReceiver messageReceiver;
|
||||
private BroadcastReceiver batteryReceiver;
|
||||
protected boolean isCharging = false;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
|
@ -121,6 +125,26 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferenc
|
|||
sharedPrefs.registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
persistence.turnOff();
|
||||
|
||||
setupBatteryReceiver();
|
||||
}
|
||||
|
||||
private void setupBatteryReceiver() {
|
||||
if (sharedPrefs.getBoolean("simplify_ui_charging", false)) {
|
||||
IntentFilter intentBatteryFilter = new IntentFilter();
|
||||
intentBatteryFilter.addAction(BatteryManager.ACTION_CHARGING);
|
||||
intentBatteryFilter.addAction(BatteryManager.ACTION_DISCHARGING);
|
||||
isCharging = checkIsCharging();
|
||||
batteryReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
isCharging = checkIsCharging();
|
||||
setDataFields();
|
||||
invalidate();
|
||||
}
|
||||
};
|
||||
registerReceiver(batteryReceiver, intentBatteryFilter);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -176,8 +200,11 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferenc
|
|||
mChartTap = stub.findViewById(R.id.chart_zoom_tap);
|
||||
mMainMenuTap = stub.findViewById(R.id.main_menu_tap);
|
||||
chart = stub.findViewById(R.id.chart);
|
||||
mSimpleUi = stub.findViewById(R.id.simple_ui);
|
||||
mSimpleSvg = stub.findViewById(R.id.simple_sgv);
|
||||
mSimpleDirection = stub.findViewById(R.id.simple_direction);
|
||||
mSimpleTime = stub.findViewById(R.id.simple_watch_time);
|
||||
layoutSet = true;
|
||||
|
||||
setDataFields();
|
||||
setColor();
|
||||
}
|
||||
|
@ -217,6 +244,9 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferenc
|
|||
if (sharedPrefs != null) {
|
||||
sharedPrefs.unregisterOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
if (batteryReceiver != null) {
|
||||
unregisterReceiver(batteryReceiver);
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
@ -256,8 +286,16 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferenc
|
|||
}
|
||||
}
|
||||
|
||||
private boolean checkIsCharging() {
|
||||
IntentFilter iFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
|
||||
Intent batteryStatus = this.registerReceiver(null, iFilter);
|
||||
int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
|
||||
return status == BatteryManager.BATTERY_STATUS_CHARGING ||
|
||||
status == BatteryManager.BATTERY_STATUS_FULL;
|
||||
}
|
||||
|
||||
private void checkVibrateHourly(WatchFaceTime oldTime, WatchFaceTime newTime) {
|
||||
Boolean hourlyVibratePref = sharedPrefs.getBoolean("vibrate_Hourly", false);
|
||||
boolean hourlyVibratePref = sharedPrefs.getBoolean("vibrate_Hourly", false);
|
||||
if (hourlyVibratePref && layoutSet && newTime.hasHourChanged(oldTime)) {
|
||||
Log.i("hourlyVibratePref", "true --> " + newTime.toString());
|
||||
Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
|
||||
|
@ -285,7 +323,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferenc
|
|||
|
||||
if (mDirection != null) {
|
||||
if (sharedPrefs.getBoolean("show_direction", true)) {
|
||||
mDirection.setText(rawData.sDirection);
|
||||
mDirection.setText(rawData.sDirection+"\uFE0E");
|
||||
mDirection.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mDirection.setVisibility(View.GONE);
|
||||
|
@ -448,6 +486,37 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferenc
|
|||
mLoop.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
setDataFieldsSimpleUi();
|
||||
}
|
||||
|
||||
void setDataFieldsSimpleUi() {
|
||||
if (sharedPrefs.getBoolean("simplify_ui_charging", false) && isCharging) {
|
||||
mSimpleUi.setVisibility(View.VISIBLE);
|
||||
|
||||
mSimpleSvg.setText(rawData.sSgv);
|
||||
if (ageLevel() <= 0) {
|
||||
mSimpleSvg.setPaintFlags(mSimpleSvg.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
|
||||
} else {
|
||||
mSimpleSvg.setPaintFlags(mSimpleSvg.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
|
||||
}
|
||||
if (rawData.sgvLevel == 1) {
|
||||
mSimpleSvg.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_highColor));
|
||||
mSimpleDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_highColor));
|
||||
} else if (rawData.sgvLevel == 0) {
|
||||
mSimpleSvg.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor));
|
||||
mSimpleDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor));
|
||||
} else if (rawData.sgvLevel == -1) {
|
||||
mSimpleSvg.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_lowColor));
|
||||
mSimpleDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_lowColor));
|
||||
}
|
||||
|
||||
mSimpleDirection.setText(rawData.sDirection+"\uFE0E");
|
||||
|
||||
final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(BaseWatchFace.this);
|
||||
mSimpleTime.setText(timeFormat.format(System.currentTimeMillis()));
|
||||
} else {
|
||||
mSimpleUi.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDateAndTime() {
|
||||
|
@ -526,7 +595,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferenc
|
|||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
|
||||
setupBatteryReceiver();
|
||||
if ("delta_granularity".equals(key)) {
|
||||
ListenerService.requestData(this);
|
||||
}
|
||||
|
|
|
@ -2,8 +2,10 @@ package info.nightscout.androidaps.watchfaces;
|
|||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.support.wearable.watchface.WatchFaceStyle;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
|
@ -22,29 +24,30 @@ public class Home2 extends BaseWatchFace {
|
|||
super.onCreate();
|
||||
LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
|
||||
layoutView = inflater.inflate(R.layout.activity_home_2, null);
|
||||
|
||||
performViewSetup();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTapCommand(int tapType, int x, int y, long eventTime) {
|
||||
|
||||
int extra = mSgv!=null?(mSgv.getRight() - mSgv.getLeft())/2:0;
|
||||
int extra = mSgv != null ? (mSgv.getRight() - mSgv.getLeft()) / 2 : 0;
|
||||
|
||||
if (tapType == TAP_TYPE_TAP&&
|
||||
x >=chart.getLeft() &&
|
||||
x <= chart.getRight()&&
|
||||
if (tapType == TAP_TYPE_TAP &&
|
||||
x >= chart.getLeft() &&
|
||||
x <= chart.getRight() &&
|
||||
y >= chart.getTop() &&
|
||||
y <= chart.getBottom()){
|
||||
if (eventTime - chartTapTime < 800){
|
||||
y <= chart.getBottom()) {
|
||||
if (eventTime - chartTapTime < 800) {
|
||||
changeChartTimeframe();
|
||||
}
|
||||
chartTapTime = eventTime;
|
||||
} else if (tapType == TAP_TYPE_TAP&&
|
||||
x + extra >=mSgv.getLeft() &&
|
||||
x - extra <= mSgv.getRight()&&
|
||||
} else if (tapType == TAP_TYPE_TAP &&
|
||||
x + extra >= mSgv.getLeft() &&
|
||||
x - extra <= mSgv.getRight() &&
|
||||
y >= mSgv.getTop() &&
|
||||
y <= mSgv.getBottom()){
|
||||
if (eventTime - sgvTapTime < 800){
|
||||
y <= mSgv.getBottom()) {
|
||||
if (eventTime - sgvTapTime < 800) {
|
||||
Intent intent = new Intent(this, MainMenuActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
|
@ -55,12 +58,12 @@ public class Home2 extends BaseWatchFace {
|
|||
|
||||
private void changeChartTimeframe() {
|
||||
int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3"));
|
||||
timeframe = (timeframe%5) + 1;
|
||||
timeframe = (timeframe % 5) + 1;
|
||||
sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WatchFaceStyle getWatchFaceStyle(){
|
||||
protected WatchFaceStyle getWatchFaceStyle() {
|
||||
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
||||
}
|
||||
|
||||
|
@ -176,7 +179,7 @@ public class Home2 extends BaseWatchFace {
|
|||
|
||||
if (getCurrentWatchMode() == WatchMode.INTERACTIVE) {
|
||||
|
||||
@ColorInt final int dividerTxtColor = dividerMatchesBg ? Color.BLACK :
|
||||
@ColorInt final int dividerTxtColor = dividerMatchesBg ? Color.BLACK :
|
||||
ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor);
|
||||
@ColorInt final int dividerBgColor = ContextCompat.getColor(getApplicationContext(),
|
||||
dividerMatchesBg ? R.color.light_background : R.color.light_stripe_background);
|
||||
|
@ -257,4 +260,5 @@ public class Home2 extends BaseWatchFace {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -317,19 +317,21 @@
|
|||
android:textColor="@color/white"
|
||||
android:textFontWeight="400"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/weeknumber"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4"
|
||||
android:fontFamily="@font/roboto_condensed_light"
|
||||
android:letterSpacing="-0.1"
|
||||
android:text="ww"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/light_grey"
|
||||
android:textFontWeight="400"
|
||||
android:textSize="18sp"
|
||||
android:letterSpacing="-0.1"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -529,6 +531,7 @@
|
|||
android:layout_gravity="bottom"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal|top" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- right side bottom - spacer 2/10 -->
|
||||
|
@ -540,6 +543,10 @@
|
|||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- FLAGs -->
|
||||
|
||||
|
|
|
@ -154,4 +154,9 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" tools:context=".watchfaces.Home2" tools:deviceIds="wear_square"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:id="@+id/main_layout">
|
||||
tools:context=".watchfaces.Home2"
|
||||
tools:deviceIds="wear_square">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -13,6 +16,7 @@
|
|||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/primary_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
|
@ -42,8 +46,8 @@
|
|||
android:layout_marginBottom="-2dp"
|
||||
android:gravity="bottom|right"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="-2dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="---"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="38sp" />
|
||||
|
@ -101,8 +105,8 @@
|
|||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:textAlignment="center">
|
||||
|
||||
<TextView
|
||||
|
@ -271,7 +275,7 @@
|
|||
android:text="12:00"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="26sp" />
|
||||
android:textSize="30sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/date_time"
|
||||
|
@ -366,4 +370,9 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -136,4 +136,9 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -488,4 +488,9 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -378,4 +378,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</RelativeLayout>
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -121,6 +121,7 @@
|
|||
|
||||
<!-- 1st line with direction and timestamp-->
|
||||
<LinearLayout
|
||||
android:id="@+id/directionLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
|
@ -317,19 +318,21 @@
|
|||
android:textColor="@color/white"
|
||||
android:textFontWeight="400"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/weeknumber"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4"
|
||||
android:fontFamily="@font/roboto_condensed_light"
|
||||
android:letterSpacing="-0.1"
|
||||
android:text="ww"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/light_grey"
|
||||
android:textFontWeight="400"
|
||||
android:textSize="18sp"
|
||||
android:letterSpacing="-0.1"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -426,12 +429,12 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:layout_weight="1"
|
||||
android:baselineAligned="false"
|
||||
android:gravity="left|top"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:weightSum="10">
|
||||
|
||||
<!-- right side bottom - statusbar 2/10 -->
|
||||
|
@ -529,6 +532,7 @@
|
|||
android:layout_gravity="bottom"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal|top" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- right side bottom - spacer 2/10 -->
|
||||
|
@ -541,7 +545,10 @@
|
|||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
<!-- FLAGs -->
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -152,4 +152,9 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" tools:context=".watchfaces.Home2" tools:deviceIds="wear_round"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:id="@+id/main_layout">
|
||||
tools:context=".watchfaces.Home2"
|
||||
tools:deviceIds="wear_round">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -15,11 +18,11 @@
|
|||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0px"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="0.05">
|
||||
</LinearLayout>
|
||||
android:layout_weight="0.05"
|
||||
android:orientation="vertical" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/primary_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_gravity="center_horizontal"
|
||||
|
@ -49,8 +52,8 @@
|
|||
android:layout_marginBottom="-2dp"
|
||||
android:gravity="bottom|right"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="-2dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="---"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="38sp" />
|
||||
|
@ -109,8 +112,8 @@
|
|||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="5dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textAlignment="center">
|
||||
|
||||
<TextView
|
||||
|
@ -375,10 +378,14 @@
|
|||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0px"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="0.05">
|
||||
</LinearLayout>
|
||||
android:layout_weight="0.05"
|
||||
android:orientation="vertical" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -135,4 +135,9 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -488,4 +488,9 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -378,4 +378,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</RelativeLayout>
|
||||
<include
|
||||
android:id="@+id/simple_ui"
|
||||
layout="@layout/simple_ui"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
81
wear/src/main/res/layout/simple_ui.xml
Normal file
81
wear/src/main/res/layout/simple_ui.xml
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/black"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="100">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="50"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:textAlignment="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/simple_sgv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="-2dp"
|
||||
android:gravity="bottom|end"
|
||||
android:text="---"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="50sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:baselineAligned="false"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:textAlignment="center"
|
||||
android:weightSum="1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/simple_direction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginTop="-2dp"
|
||||
android:layout_marginBottom="-5dp"
|
||||
android:gravity="center_horizontal|bottom"
|
||||
android:text="--"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="35sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="50"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/simple_watch_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|top"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="12:00"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="35sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -136,6 +136,8 @@
|
|||
<string name="color_name_white">white</string>
|
||||
<string name="color_name_black">black</string>
|
||||
<string name="color_name_multicolor">multicolor</string>
|
||||
<string name="pref_simplify_ui_charging">Simplify Charging UI</string>
|
||||
<string name="pref_simplify_ui_charging_sum">Only show time and BG when charging</string>
|
||||
|
||||
|
||||
<string name="pref_vibrate_hourly">Vibrate hourly</string>
|
||||
|
|
|
@ -2,13 +2,19 @@
|
|||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
|
||||
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="vibrate_Hourly"
|
||||
android:title="@string/pref_vibrate_hourly"
|
||||
android:defaultValue="false"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="simplify_ui_charging"
|
||||
android:summary="@string/pref_simplify_ui_charging_sum"
|
||||
android:title="@string/pref_simplify_ui_charging"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -50,4 +50,13 @@
|
|||
android:defaultValue="false"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="simplify_ui_charging"
|
||||
android:summary="@string/pref_simplify_ui_charging_sum"
|
||||
android:title="@string/pref_simplify_ui_charging"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -24,4 +24,13 @@
|
|||
android:defaultValue="false"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="simplify_ui_charging"
|
||||
android:summary="@string/pref_simplify_ui_charging_sum"
|
||||
android:title="@string/pref_simplify_ui_charging"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:summary="Dark theme"
|
||||
android:title="@string/pref_dark"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on"/>
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
|
@ -16,7 +16,7 @@
|
|||
android:summary="Status bar divider background matches watchface background"
|
||||
android:title="@string/pref_matching_divider"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on"/>
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
|
@ -26,9 +26,18 @@
|
|||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="vibrate_Hourly"
|
||||
android:title="@string/pref_vibrate_hourly"
|
||||
android:defaultValue="false"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="simplify_ui_charging"
|
||||
android:summary="@string/pref_simplify_ui_charging_sum"
|
||||
android:title="@string/pref_simplify_ui_charging"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -24,4 +24,13 @@
|
|||
android:defaultValue="false"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="simplify_ui_charging"
|
||||
android:summary="@string/pref_simplify_ui_charging_sum"
|
||||
android:title="@string/pref_simplify_ui_charging"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -16,4 +16,13 @@
|
|||
android:defaultValue="false"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="simplify_ui_charging"
|
||||
android:summary="@string/pref_simplify_ui_charging_sum"
|
||||
android:title="@string/pref_simplify_ui_charging"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
Loading…
Reference in a new issue