]> git.ktnx.net Git - mobile-ledger.git/commitdiff
add some explanation before the restore button on the welcome screen
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 21 Aug 2021 20:05:39 +0000 (23:05 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 21 Aug 2021 20:05:39 +0000 (23:05 +0300)
also make it scrollable and more even-aligned

app/src/main/res/layout/activity_main.xml
app/src/main/res/values-bg/strings.xml
app/src/main/res/values/strings.xml

index 5818e307dddf9a788f37d51c6ea088a3d58632f5..bd74773af3cbd3f81aad3aaac663e7e9f0980024 100644 (file)
     tools:context=".ui.activity.MainActivity"
     >
 
-    <androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
+    <ScrollView
         android:id="@+id/no_profiles_layout"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:background="?table_row_dark_bg"
-        android:visibility="gone"
+        android:visibility="visible"
         >
-
-        <FrameLayout
-            android:id="@+id/welcome_header"
+        <androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent"
-            >
-
-            <include layout="@layout/nav_header_layout" />
-        </FrameLayout>
-
-        <androidx.constraintlayout.widget.ConstraintLayout
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:padding="@dimen/activity_horizontal_margin"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toBottomOf="@id/welcome_header"
             >
 
-            <TextView
-                android:id="@+id/textView"
-                android:layout_width="wrap_content"
+            <FrameLayout
+                android:id="@+id/welcome_header"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="48dp"
-                android:text="@string/text_welcome"
-                android:textColor="?textColor"
-                android:textSize="48sp"
                 app:layout_constraintEnd_toEndOf="parent"
                 app:layout_constraintStart_toStartOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
-                />
+                >
 
-            <TextView
-                android:id="@+id/textView3"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginStart="8dp"
-                android:layout_marginTop="24dp"
-                android:layout_marginEnd="8dp"
-                android:text="@string/text_welcome_profile_needed"
-                android:textColor="?textColor"
-                android:textSize="20sp"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toBottomOf="@+id/textView"
-                />
+                <include layout="@layout/nav_header_layout" />
+            </FrameLayout>
 
-            <Button
-                android:id="@+id/btn_no_profiles_add"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginStart="8dp"
-                android:layout_marginTop="24dp"
-                android:layout_marginEnd="8dp"
-                android:layout_marginBottom="8dp"
-                android:backgroundTint="?colorSecondary"
-                android:drawablePadding="16dp"
-                android:text="@string/create_profile_label"
-                android:textColor="@color/design_default_color_on_primary"
-                app:layout_constraintBottom_toTopOf="@id/btn_restore"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toBottomOf="@+id/textView3"
-                />
-            <Button
-                android:id="@+id/btn_restore"
-                android:layout_width="wrap_content"
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:layout_width="0dp"
                 android:layout_height="wrap_content"
-                android:layout_marginHorizontal="8dp"
-                android:layout_marginVertical="24dp"
-                android:drawableStart="@drawable/ic_baseline_restore_24"
-                android:drawablePadding="@dimen/text_margin"
-                android:text="@string/restore_button_label"
+                android:padding="@dimen/activity_horizontal_margin"
                 app:layout_constraintBottom_toBottomOf="parent"
                 app:layout_constraintEnd_toEndOf="parent"
                 app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toBottomOf="@id/btn_no_profiles_add"
-                />
-        </androidx.constraintlayout.widget.ConstraintLayout>
-    </androidx.constraintlayout.widget.ConstraintLayout>
+                app:layout_constraintTop_toBottomOf="@id/welcome_header"
+                >
 
+                <TextView
+                    android:id="@+id/textView"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginVertical="48dp"
+                    android:text="@string/text_welcome"
+                    android:textColor="?textColor"
+                    android:textSize="48sp"
+                    app:layout_constraintBottom_toTopOf="@id/textView3"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    />
+
+                <TextView
+                    android:id="@+id/textView3"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginVertical="24dp"
+                    android:layout_marginStart="8dp"
+                    android:layout_marginEnd="8dp"
+                    android:text="@string/text_welcome_profile_needed"
+                    android:textColor="?textColor"
+                    android:textSize="20sp"
+                    app:layout_constraintBottom_toTopOf="@id/btn_no_profiles_add"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/textView"
+                    />
+
+                <Button
+                    android:id="@+id/btn_no_profiles_add"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginVertical="24dp"
+                    android:layout_marginStart="8dp"
+                    android:layout_marginEnd="8dp"
+                    android:backgroundTint="?colorSecondary"
+                    android:drawablePadding="16dp"
+                    android:text="@string/create_profile_label"
+                    android:textColor="@color/design_default_color_on_primary"
+                    app:layout_constraintBottom_toTopOf="@id/restore_hint"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/textView3"
+                    />
+                <TextView
+                    android:id="@+id/restore_hint"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginHorizontal="8dp"
+                    android:layout_marginVertical="24dp"
+                    android:text="@string/no_profile_restore_hint"
+                    android:textColor="?textColor"
+                    android:textSize="20sp"
+                    app:layout_constraintBottom_toTopOf="@id/btn_restore"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toBottomOf="@id/btn_no_profiles_add"
+                    />
+
+                <Button
+                    android:id="@+id/btn_restore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginHorizontal="8dp"
+                    android:layout_marginVertical="24dp"
+                    android:drawableStart="@drawable/ic_baseline_restore_24"
+                    android:drawablePadding="@dimen/text_margin"
+                    android:text="@string/restore_button_label"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toBottomOf="@id/restore_hint"
+                    />
+            </androidx.constraintlayout.widget.ConstraintLayout>
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </ScrollView>
     <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:app="http://schemas.android.com/apk/res-auto"
         android:id="@+id/main_app_layout"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:background="?android:attr/colorBackground"
         android:orientation="vertical"
-        android:visibility="visible"
+        android:visibility="gone"
         >
 
         <com.google.android.material.floatingactionbutton.FloatingActionButton
index 390513205f8f4d24e8c54a05dbb52c869b914ce5..0431916b62402fd8d193f8cc659e9cef18c60c4a 100644 (file)
     <string name="config_saved">Настройките са записани</string>
     <string name="restore_explanation">Зареждане на настройките на профилите и макетите от резервно копие, създадено по-рано. Съществуващите записи не се променят. Ако искате да върнете някой запис (профил или макет) към състоянитето от резервното копие, първо го изтрийте.</string>
     <string name="config_restored">Успешно възстановяване на настройките</string>
+    <string name="no_profile_restore_hint">… а може и да възстановите настройките от резервно копие</string>
 </resources>
index 3d7d8e691e72880ad88c7a4596ae6a5900370fc9..d7de3af8251aec77d1813f4a112a68a80fd1eb82 100644 (file)
     <string name="config_saved">Configuration saved successfully</string>
     <string name="backups_activity_label">Backup / Restore</string>
     <string name="config_restored">Configuration restored successfully</string>
+    <string name="no_profile_restore_hint">… or, you may restore from backup</string>
 </resources>