style the simulation watermark to stretch
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 30 Nov 2019 14:11:56 +0000 (16:11 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 30 Nov 2019 14:11:56 +0000 (16:11 +0200)
requires API 26, so also set a larger default textSize for those not
lucky to have modern Android

app/src/main/res/layout/activity_new_transaction.xml
app/src/main/res/values-v26/styles.xml [new file with mode: 0644]
app/src/main/res/values/styles.xml

index bb5eb3a..3ff1415 100644 (file)
         android:layout_height="match_parent"
         android:animateLayoutChanges="true">
 
+        <TextView
+            android:id="@+id/simulationLabel"
+            style="@style/StretchedTextView"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:layout_margin="@dimen/activity_horizontal_margin"
+            android:clickable="false"
+            android:gravity="center"
+            android:maxLines="1"
+            android:rotation="-45"
+            android:text="@string/simulation_label"
+            android:textAlignment="center"
+            android:textColor="@color/table_row_dark_bg"
+            android:textIsSelectable="false"
+            android:textSize="36sp"
+            android:textStyle="bold"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/toolbar_layout" />
+
         <com.google.android.material.appbar.AppBarLayout
             android:id="@+id/toolbar_layout"
             android:layout_width="match_parent"
             app:layout_constraintTop_toBottomOf="@id/toolbar_layout"
             app:navGraph="@navigation/new_transaction_navigation" />
 
-        <TextView
-            android:id="@+id/simulationLabel"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:layout_margin="@dimen/activity_horizontal_margin"
-            android:clickable="false"
-            android:gravity="center"
-            android:rotation="-45"
-            android:text="@string/simulation_label"
-            android:textAlignment="center"
-            android:textColor="@color/table_row_dark_bg"
-            android:textIsSelectable="false"
-            android:textSize="54sp"
-            android:textStyle="bold"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/toolbar_layout" />
-
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
diff --git a/app/src/main/res/values-v26/styles.xml b/app/src/main/res/values-v26/styles.xml
new file mode 100644 (file)
index 0000000..25f15fb
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+  ~ Copyright © 2019 Damyan Ivanov.
+  ~ This file is part of MoLe.
+  ~ MoLe is free software: you can distribute it and/or modify it
+  ~ under the term of the GNU General Public License as published by
+  ~ the Free Software Foundation, either version 3 of the License, or
+  ~ (at your opinion), any later version.
+  ~
+  ~ MoLe is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  ~ GNU General Public License terms for details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with MoLe. If not, see <https://www.gnu.org/licenses/>.
+  -->
+
+<resources>
+
+    <style name="StretchedTextView" parent="Widget.AppCompat.TextView">
+        <item name="android:autoSizeTextType">uniform</item>
+    </style>
+</resources>
\ No newline at end of file
index e0df401..f9be6d3 100644 (file)
@@ -28,6 +28,7 @@
         <item name="textColor">@android:color/tab_indicator_text</item>
     </style>
 
+    <style name="StretchedTextView" parent="Widget.AppCompat.TextView"></style>
     <!-- base hue: 261.2245° -->
     <!-- target primary color: #935FF2 -->
     <!-- theme list start -->