Browse Source

add helper text to server address field

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 4 years ago
parent
commit
0dad4840f1

+ 3 - 0
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -529,6 +529,9 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
     private void initOverallUi() {
         accountSetupBinding.hostUrlContainer.setEndIconOnClickListener(v -> checkOcServer());
 
+        accountSetupBinding.hostUrlInputHelperText.setText(
+            String.format(getString(R.string.login_url_helper_text), getString(R.string.app_name)));
+
         if (deviceInfo.hasCamera(this)) {
             accountSetupBinding.scanQr.setOnClickListener(v -> onScan());
             ThemeUtils.tintDrawable(accountSetupBinding.scanQr.getDrawable(),

+ 14 - 5
src/main/res/layout-land/account_setup.xml

@@ -89,30 +89,39 @@
                 </com.google.android.material.textfield.TextInputLayout>
             </FrameLayout>
 
+            <TextView
+                android:id="@+id/host_url_input_helper_text"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="@dimen/standard_eight_padding"
+                android:text="@string/login_url_helper_text"
+                android:textColor="@color/white_helper_text" />
+
             <TextView
                 android:id="@+id/server_status_text"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginBottom="@dimen/alternate_half_margin"
                 android:contentDescription="@string/auth_testing_connection"
-                app:drawableStartCompat="@android:drawable/stat_notify_sync"
                 android:drawablePadding="@dimen/alternate_half_padding"
                 android:gravity="center_vertical"
                 android:minHeight="@dimen/display_text_min_height"
+                android:padding="@dimen/standard_eight_padding"
                 android:text="@string/auth_testing_connection"
                 android:textColor="@color/login_text_color"
-                android:visibility="invisible" />
+                android:visibility="invisible"
+                app:drawableStartCompat="@android:drawable/stat_notify_sync" />
 
             <TextView
                 android:id="@+id/auth_status_text"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:contentDescription="@string/auth_unauthorized"
-                app:drawableStartCompat="@android:drawable/stat_notify_sync"
                 android:drawablePadding="@dimen/alternate_half_padding"
                 android:gravity="center_vertical"
+                android:padding="@dimen/standard_eight_padding"
                 android:text="@string/auth_unauthorized"
-                android:textColor="@color/login_text_color" />
+                android:textColor="@color/login_text_color"
+                app:drawableStartCompat="@android:drawable/stat_notify_sync" />
 
             <ImageButton
                 android:id="@+id/scan_qr"

+ 14 - 5
src/main/res/layout/account_setup.xml

@@ -88,30 +88,39 @@
                 </com.google.android.material.textfield.TextInputLayout>
             </FrameLayout>
 
+            <TextView
+                android:id="@+id/host_url_input_helper_text"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="@dimen/standard_eight_padding"
+                android:text="@string/login_url_helper_text"
+                android:textColor="@color/white_helper_text" />
+
             <TextView
                 android:id="@+id/server_status_text"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginBottom="@dimen/alternate_margin"
                 android:contentDescription="@string/auth_testing_connection"
-                app:drawableStartCompat="@android:drawable/stat_notify_sync"
                 android:drawablePadding="@dimen/alternate_half_padding"
                 android:gravity="center_vertical"
                 android:minHeight="@dimen/display_text_min_height"
+                android:padding="@dimen/standard_eight_padding"
                 android:text="@string/auth_testing_connection"
                 android:textColor="@color/login_text_color"
-                android:visibility="invisible" />
+                android:visibility="invisible"
+                app:drawableStartCompat="@android:drawable/stat_notify_sync" />
 
             <TextView
                 android:id="@+id/auth_status_text"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:contentDescription="@string/auth_unauthorized"
-                app:drawableStartCompat="@android:drawable/stat_notify_sync"
                 android:drawablePadding="@dimen/alternate_half_padding"
                 android:gravity="center_vertical"
+                android:padding="@dimen/standard_eight_padding"
                 android:text="@string/auth_unauthorized"
-                android:textColor="@color/login_text_color" />
+                android:textColor="@color/login_text_color"
+                app:drawableStartCompat="@android:drawable/stat_notify_sync" />
 
             <ImageButton
                 android:id="@+id/scan_qr"

+ 1 - 0
src/main/res/values/colors.xml

@@ -22,6 +22,7 @@
     <color name="list_item_lastmod_and_filesize_text">@color/secondary_text_color</color>
     <color name="black">#000000</color>
     <color name="white">#ffffff</color>
+    <color name="white_helper_text">#B3FFFFFF</color>
     <color name="text_color">#333333</color>
     <color name="drawer_text_color">@color/secondary_text_color</color>
     <color name="text_color_inverse">#ffffff</color>

+ 1 - 0
src/main/res/values/strings.xml

@@ -952,4 +952,5 @@
     <string name="wrong_storage_path_desc">This might be due to a backup restore on another device. Falling back to default. Please check settings to adjust data storage folder.</string>
     <string name="dialog_close">Close</string>
     <string name="direct_login_failed">Login via direct link failed!</string>
+    <string name="login_url_helper_text">The link to your %1$s web interface when you open it in the browser.</string>
 </resources>