]> git.ktnx.net Git - mobile-ledger.git/commitdiff
better shadow under main header in dark mode
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 17 Sep 2020 08:17:17 +0000 (08:17 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 17 Sep 2020 13:26:14 +0000 (13:26 +0000)
with greater height and darker at the top edge. still black

tried with white and it looks very unnatural and like a mistake

app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
app/src/main/res/drawable-anydpi/drop_shadow.xml
app/src/main/res/layout/main_app_layout.xml
app/src/main/res/values-night/styles.xml
app/src/main/res/values/attr.xml
app/src/main/res/values/styles.xml

index bce01de75c9ffc29ee61bc21b5ee04c04e8f30fa..1674c029a45dfda2b525cad2402cca1c235903c3 100644 (file)
@@ -29,6 +29,7 @@ import android.os.Build;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.View;
+import android.view.ViewGroup;
 import android.view.animation.AnimationUtils;
 import android.widget.LinearLayout;
 import android.widget.ProgressBar;
@@ -460,7 +461,7 @@ public class MainActivity extends ProfileThemedActivity {
         updateLastUpdateTextFromDB();
     }
     private void updateLastUpdateDisplay(Date newValue) {
-        LinearLayout l = findViewById(R.id.transactions_last_update_layout);
+        ViewGroup l = findViewById(R.id.transactions_last_update_layout);
         TextView v = findViewById(R.id.transactions_last_update);
         if (newValue == null) {
             l.setVisibility(View.INVISIBLE);
index 1a37f95caf59ddfc2ccfffa16970555df3e44505..4eae334ed6979aad5e8db2f9b855323a5d744e1a 100644 (file)
@@ -17,8 +17,8 @@
 
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
     <gradient
-        android:startColor="#80000000"
-        android:endColor="#00000000"
+        android:startColor="?attr/shadowStartColor"
+        android:endColor="?attr/shadowEndColor"
         android:angle="270"
         />
 </shape>
\ No newline at end of file
index 784e0b6a01405fc027ff5518ff766836f87abbc8..d9f4b42687224d2cdd19e545ea875ad3141212c3 100644 (file)
                 app:layout_constraintStart_toStartOf="parent"
                 app:layout_constraintTop_toBottomOf="@id/toolbar">
 
-                <LinearLayout
+                <androidx.constraintlayout.widget.ConstraintLayout
                     android:id="@+id/transactions_last_update_layout"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:elevation="24dp"
-                    android:orientation="horizontal">
+                    android:orientation="horizontal"
+                    >
 
                     <TextView
                         android:id="@+id/transaction_last_update_label"
-                        android:textAppearance="@android:style/TextAppearance.Material.Small"
-                        android:layout_width="wrap_content"
+                        android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:paddingStart="8dp"
                         android:paddingEnd="8dp"
                         android:text="@string/transactions_last_update_label"
+                        android:textAppearance="@android:style/TextAppearance.Material.Small"
+                        app:layout_constraintEnd_toStartOf="@id/transactions_last_update"
+                        app:layout_constraintTop_toTopOf="parent"
                         />
 
                     <TextView
                         android:id="@+id/transactions_last_update"
-                        android:textAppearance="@android:style/TextAppearance.Material.Small"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_weight="1"
                         android:text="\?"
-                        tools:ignore="HardcodedText" />
-                </LinearLayout>
+                        android:textAppearance="@android:style/TextAppearance.Material.Small"
+                        tools:ignore="HardcodedText"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintTop_toTopOf="parent"
+                        />
+                </androidx.constraintlayout.widget.ConstraintLayout>
 
                 <LinearLayout
                     android:id="@+id/transaction_progress_layout"
 
             <View
                 android:layout_width="0dp"
-                android:layout_height="4dp"
+                android:layout_height="?attr/main_header_shadow_height"
                 android:background="@drawable/drop_shadow"
                 app:layout_constraintEnd_toEndOf="parent"
                 app:layout_constraintStart_toStartOf="parent"
index 1b39c9e236cdf3abee0725ed9771b1c7308f41d7..1b832d3e3bff609ee0d38a65851ff3031d8dcf83 100644 (file)
@@ -35,6 +35,9 @@
         </item>
         <item name="colorError">#FFE1E2</item>
         <item name="colorOnError">#CD1609</item>
+        <item name="main_header_shadow_height">12dp</item>
+        <item name="shadowStartColor">#C0000000</item>
+        <item name="shadowEndColor">#00000000</item>
     </style>
 
     <!-- theme list start -->
index 2773205098773ecbe2df5bcf50aaf8c8b938496c..b34995970479dd7e7e4d98116631483b5d5d4d88 100644 (file)
@@ -23,5 +23,7 @@
     <attr name="textColor" format="reference|color"/>
     <attr name="commentColor" format="reference|color" />
     <attr name="colorPrimaryTransparent" format="reference|color" />
-
+    <attr name="main_header_shadow_height" format="reference|dimension" />
+    <attr name="shadowStartColor" format="reference|color" />
+    <attr name="shadowEndColor" format="reference|color" />
 </resources>
\ No newline at end of file
index c51c46a2eddb29680a2dc518db63b5a4541da2c3..d56120ef5920ce6642738e36316c326d41ff0cf8 100644 (file)
@@ -39,6 +39,9 @@
         <item name="table_row_dark_bg">#efe7fd</item>
         <item name="table_row_light_bg">#f9f6fe</item>
         <item name="background">@null</item>
+        <item name="main_header_shadow_height">4dp</item>
+        <item name="shadowStartColor">#80000000</item>
+        <item name="shadowEndColor">#00000000</item>
     </style>
 
     <!-- theme list start -->