From 6bd7bf65a8148560156a6cf7d47e0dd76fe9a7fd Mon Sep 17 00:00:00 2001 From: rICTx-T1D Date: Thu, 8 Oct 2020 21:33:19 +0200 Subject: [PATCH] optimize font-size of time, when date is off --- .../androidaps/watchfaces/RICTxWF01.java | 22 +++++++++++++++++++ .../res/layout/round_activity_rictxwf01.xml | 1 - 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/RICTxWF01.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/RICTxWF01.java index 517cc4996c..8d7583912b 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/RICTxWF01.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/RICTxWF01.java @@ -6,7 +6,10 @@ import android.os.Vibrator; import android.support.wearable.watchface.WatchFaceStyle; import android.util.Log; import android.view.LayoutInflater; +import android.view.View; import android.widget.LinearLayout; +import android.widget.TextView; + import androidx.core.content.ContextCompat; import com.ustwo.clockwise.common.WatchFaceTime; @@ -131,6 +134,25 @@ public class RICTxWF01 extends BaseWatchFace { } } + + /* optimize font-size --> when date is off then increase font-size of time */ + Boolean isShowDate = sharedPrefs.getBoolean("show_date", true); + if (!isShowDate) { + layoutView.findViewById(R.id.date_time).setVisibility(View.GONE); + mHour.setTextSize(62); + mMinute.setTextSize(40); + mHour.setLetterSpacing((float) -0.066); + mMinute.setLetterSpacing((float) -0.066); + } else { + layoutView.findViewById(R.id.date_time).setVisibility(View.VISIBLE); + mHour.setTextSize(40); + mMinute.setTextSize(26); + mHour.setLetterSpacing((float) 0); + mMinute.setLetterSpacing((float) 0); + } + + /* @ToDo optimize font-size --> when direction and time-ago is off, increase font-size of sgv */ + } protected void setColorLowRes() { diff --git a/wear/src/main/res/layout/round_activity_rictxwf01.xml b/wear/src/main/res/layout/round_activity_rictxwf01.xml index 95b7d89c1d..1905d71253 100644 --- a/wear/src/main/res/layout/round_activity_rictxwf01.xml +++ b/wear/src/main/res/layout/round_activity_rictxwf01.xml @@ -509,7 +509,6 @@ android:layout_width="match_parent" android:layout_height="0dp" android:layout_gravity="bottom" - android:layout_marginLeft="0dp" android:layout_weight="1" android:gravity="center_horizontal|top" />