]> git.ktnx.net Git - mobile-ledger-staging.git/blobdiff - app/src/main/res/layout/profile_detail.xml
UI and machinery for detecting hledger-web version
[mobile-ledger-staging.git] / app / src / main / res / layout / profile_detail.xml
index 3c192f6d74dd10bc2f587a59049112983c91f050..d2ca5601a89705eb5322bd25b5f0d4da281bc195 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?><!--
-  ~ Copyright © 2019 Damyan Ivanov.
+  ~ Copyright © 2020 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
@@ -36,7 +36,6 @@
             android:id="@+id/profile_name"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:ems="10"
             android:hint="@string/profile_name_label"
             android:inputType="textPersonName" />
     </com.google.android.material.textfield.TextInputLayout>
@@ -52,7 +51,6 @@
             android:id="@+id/url"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:ems="10"
             android:hint="@string/url_label"
             android:inputType="textUri"
             android:text="@string/pref_default_backend_url" />
                     android:id="@+id/auth_user_name"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:ems="10"
                     android:hint="@string/pref_title_backend_auth_user"
                     android:inputType="textPersonName" />
             </com.google.android.material.textfield.TextInputLayout>
                     android:id="@+id/password"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:ems="10"
                     android:hint="@string/pref_title_backend_auth_password"
                     android:inputType="textWebPassword" />
 
 
         </LinearLayout>
 
-        <LinearLayout
+        <androidx.constraintlayout.widget.ConstraintLayout
             android:id="@+id/api_version_layout"
-            android:orientation="vertical"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginBottom="16dp">
 
             <TextView
+                android:id="@+id/api_version_label"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:text="@string/profile_api_version_title"
-                android:textAppearance="?android:textAppearanceListItem" />
+                android:textAppearance="?android:textAppearanceListItem"
+                app:layout_constraintTop_toTopOf="parent"
+                />
 
             <TextView
                 android:id="@+id/api_version_text"
-                android:layout_width="match_parent"
+                android:layout_width="0dp"
                 android:layout_height="wrap_content"
                 android:textAppearance="?android:textAppearanceListItemSecondary"
-                android:textColor="?attr/textColor" />
-        </LinearLayout>
+                android:textColor="?attr/textColor"
+                app:layout_constraintEnd_toStartOf="@id/detected_version_text"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/api_version_label"
+                />
+            <TextView
+                android:id="@+id/detected_version_label"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="8dp"
+                android:gravity="end"
+                android:text="@string/detected_version_label"
+                android:textAppearance="?android:textAppearanceListItemSecondary"
+                app:layout_constraintEnd_toStartOf="@id/detected_version_text"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/api_version_text"
+                />
+            <TextView
+                android:id="@+id/detected_version_text"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="8dp"
+                android:text="@string/api_version_unknown_label"
+                android:textAppearance="?android:textAppearanceListItemSecondary"
+                android:textColor="?attr/textColor"
+                app:layout_constraintEnd_toStartOf="@id/api_version_detect_button"
+                app:layout_constraintTop_toBottomOf="@id/api_version_text"
+                />
+            <TextView
+                android:id="@+id/api_version_detect_button"
+                android:layout_width="24dp"
+                android:layout_height="0dp"
+                android:drawableBottom="@drawable/ic_refresh_primary_24dp"
+                android:foregroundGravity="bottom"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/api_version_label"
+                />
+        </androidx.constraintlayout.widget.ConstraintLayout>
 
         <Switch
             android:id="@+id/profile_permit_posting"
                     android:id="@+id/preferred_accounts_filter_filter"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:ems="10"
                     android:fontFamily="monospace"
                     android:hint="@string/pref_preferred_autocompletion_account_filter_hint"
                     android:inputType="text"
                 android:background="?colorPrimary"
                 android:contentDescription="@string/btn_color_picker_button"
                 app:srcCompat="@drawable/ic_palette_black_24dp"
-                android:tint="?android:attr/colorBackground" />
+                android:tint="?colorOnPrimarySurface"
+                />
 
         </LinearLayout>