android/source/res/layout/about.xml |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit d942b4a7d187f106dfb1f5085e7c655bf13974bf
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Dec 15 12:37:39 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Dec 15 17:28:28 2023 +0100

    android: Set sample texts for design view
    
    As cloph suggested in [1], set sample texts for the
    version and vendor information in the About dialog,
    using the `tools:text` attribute as described at [2].
    
    These are displayed when viewing the layout in
    Android Studio's layout preview. With these placeholder
    texts, this gives a better impression at design time
    what the actual result will look like at runtime.
    
    The actual texts for the view are set at runtime, s.
    `AboutDialogFragment#onCreateDialog`.
    
    [1] 
https://gerrit.libreoffice.org/c/core/+/160047/comments/52584e2e_50869bef
    [2] 
https://developer.android.com/studio/write/tool-attributes#design-time_view_attributes
    
    Change-Id: I92b1c3d9f947fd1aa68a3ef4f0eee9e5c742e0c0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160826
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/android/source/res/layout/about.xml 
b/android/source/res/layout/about.xml
index 30f1ed3d95ae..f37482b82a0c 100644
--- a/android/source/res/layout/about.xml
+++ b/android/source/res/layout/about.xml
@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <ScrollView 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">
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
+<LinearLayout
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:orientation="vertical"
@@ -14,7 +15,8 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:textIsSelectable="true"
-        android:textSize="18sp"/>
+        android:textSize="18sp"
+        tools:text="Version: x.x.x.x\nBuild ID: 000000000000" />
 
     <TextView
         android:id="@+id/about_description"
@@ -38,6 +40,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:textIsSelectable="true"
-        android:textSize="18sp"/>
+        android:textSize="18sp"
+        tools:text="@string/app_vendor" />
 </LinearLayout>
 </ScrollView>

Reply via email to