Browse Source

Merge pull request #75 from nextcloud/loginLayout

Slight design optimizations for the login screen #22
Marius Blüm 8 years ago
parent
commit
36b24a9673
48 changed files with 44 additions and 52 deletions
  1. 1 1
      AndroidManifest.xml
  2. BIN
      res/drawable-hdpi/ic_action_refresh.png
  3. BIN
      res/drawable-hdpi/ic_alert.png
  4. BIN
      res/drawable-hdpi/ic_hide.png
  5. BIN
      res/drawable-hdpi/ic_lock_open_white.png
  6. BIN
      res/drawable-hdpi/ic_lock_white.png
  7. BIN
      res/drawable-hdpi/ic_ok.png
  8. BIN
      res/drawable-hdpi/ic_refresh.png
  9. BIN
      res/drawable-hdpi/ic_view.png
  10. BIN
      res/drawable-hdpi/no_network.png
  11. BIN
      res/drawable-mdpi/ic_action_refresh.png
  12. 0 0
      res/drawable-mdpi/ic_action_refresh_grey.png
  13. BIN
      res/drawable-mdpi/ic_alert.png
  14. BIN
      res/drawable-mdpi/ic_hide.png
  15. BIN
      res/drawable-mdpi/ic_lock_open_white.png
  16. BIN
      res/drawable-mdpi/ic_lock_white.png
  17. BIN
      res/drawable-mdpi/ic_ok.png
  18. BIN
      res/drawable-mdpi/ic_view.png
  19. BIN
      res/drawable-mdpi/no_network.png
  20. BIN
      res/drawable-xhdpi/ic_action_refresh.png
  21. BIN
      res/drawable-xhdpi/ic_alert.png
  22. BIN
      res/drawable-xhdpi/ic_hide.png
  23. BIN
      res/drawable-xhdpi/ic_lock_open_white.png
  24. BIN
      res/drawable-xhdpi/ic_lock_white.png
  25. BIN
      res/drawable-xhdpi/ic_ok.png
  26. BIN
      res/drawable-xhdpi/ic_view.png
  27. BIN
      res/drawable-xhdpi/no_network.png
  28. BIN
      res/drawable-xxhdpi/ic_action_refresh.png
  29. BIN
      res/drawable-xxhdpi/ic_alert.png
  30. BIN
      res/drawable-xxhdpi/ic_hide.png
  31. BIN
      res/drawable-xxhdpi/ic_lock_open_white.png
  32. BIN
      res/drawable-xxhdpi/ic_lock_white.png
  33. BIN
      res/drawable-xxhdpi/ic_ok.png
  34. BIN
      res/drawable-xxhdpi/ic_view.png
  35. BIN
      res/drawable-xxhdpi/no_network.png
  36. BIN
      res/drawable-xxxhdpi/ic_action_refresh.png
  37. BIN
      res/drawable-xxxhdpi/ic_alert.png
  38. BIN
      res/drawable-xxxhdpi/ic_hide.png
  39. BIN
      res/drawable-xxxhdpi/ic_lock_open_white.png
  40. BIN
      res/drawable-xxxhdpi/ic_lock_white.png
  41. BIN
      res/drawable-xxxhdpi/ic_ok.png
  42. BIN
      res/drawable-xxxhdpi/ic_view.png
  43. BIN
      res/drawable-xxxhdpi/no_network.png
  44. 6 14
      res/layout-land/account_setup.xml
  45. 14 24
      res/layout/account_setup.xml
  46. 2 2
      res/values/setup.xml
  47. 11 1
      res/values/styles.xml
  48. 10 10
      src/com/owncloud/android/authentication/AuthenticatorActivity.java

+ 1 - 1
AndroidManifest.xml

@@ -158,7 +158,7 @@
             android:name=".authentication.AuthenticatorActivity"
             android:name=".authentication.AuthenticatorActivity"
             android:exported="true"
             android:exported="true"
             android:launchMode="singleTask"
             android:launchMode="singleTask"
-            android:theme="@style/Theme.ownCloud.Toolbar" >
+            android:theme="@style/Theme.ownCloud.noActionBar.Login" >
             <intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
                 <action android:name="android.intent.action.VIEW" />
 
 

BIN
res/drawable-hdpi/ic_action_refresh.png


BIN
res/drawable-hdpi/ic_alert.png


BIN
res/drawable-hdpi/ic_hide.png


BIN
res/drawable-hdpi/ic_lock_open_white.png


BIN
res/drawable-hdpi/ic_lock_white.png


BIN
res/drawable-hdpi/ic_ok.png


BIN
res/drawable-hdpi/ic_refresh.png


BIN
res/drawable-hdpi/ic_view.png


BIN
res/drawable-hdpi/no_network.png


BIN
res/drawable-mdpi/ic_action_refresh.png


+ 0 - 0
res/drawable-mdpi/ic_action_refresh_black.png → res/drawable-mdpi/ic_action_refresh_grey.png


BIN
res/drawable-mdpi/ic_alert.png


BIN
res/drawable-mdpi/ic_hide.png


BIN
res/drawable-mdpi/ic_lock_open_white.png


BIN
res/drawable-mdpi/ic_lock_white.png


BIN
res/drawable-mdpi/ic_ok.png


BIN
res/drawable-mdpi/ic_view.png


BIN
res/drawable-mdpi/no_network.png


BIN
res/drawable-xhdpi/ic_action_refresh.png


BIN
res/drawable-xhdpi/ic_alert.png


BIN
res/drawable-xhdpi/ic_hide.png


BIN
res/drawable-xhdpi/ic_lock_open_white.png


BIN
res/drawable-xhdpi/ic_lock_white.png


BIN
res/drawable-xhdpi/ic_ok.png


BIN
res/drawable-xhdpi/ic_view.png


BIN
res/drawable-xhdpi/no_network.png


BIN
res/drawable-xxhdpi/ic_action_refresh.png


BIN
res/drawable-xxhdpi/ic_alert.png


BIN
res/drawable-xxhdpi/ic_hide.png


BIN
res/drawable-xxhdpi/ic_lock_open_white.png


BIN
res/drawable-xxhdpi/ic_lock_white.png


BIN
res/drawable-xxhdpi/ic_ok.png


BIN
res/drawable-xxhdpi/ic_view.png


BIN
res/drawable-xxhdpi/no_network.png


BIN
res/drawable-xxxhdpi/ic_action_refresh.png


BIN
res/drawable-xxxhdpi/ic_alert.png


BIN
res/drawable-xxxhdpi/ic_hide.png


BIN
res/drawable-xxxhdpi/ic_lock_open_white.png


BIN
res/drawable-xxxhdpi/ic_lock_white.png


BIN
res/drawable-xxxhdpi/ic_ok.png


BIN
res/drawable-xxxhdpi/ic_view.png


BIN
res/drawable-xxxhdpi/no_network.png


+ 6 - 14
res/layout-land/account_setup.xml

@@ -21,7 +21,6 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/primary"
 	android:padding="@dimen/standard_padding"
 	android:padding="@dimen/standard_padding"
     >
     >
 
 
@@ -50,13 +49,6 @@
 		    android:fillViewport="true"
 		    android:fillViewport="true"
 		    android:orientation="vertical" >
 		    android:orientation="vertical" >
 
 
-            <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
-                android:id="@+id/card_view"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                card_view:cardBackgroundColor="@color/white"
-                card_view:cardCornerRadius="4dp">
-
 			<LinearLayout
 			<LinearLayout
 			    android:id="@+id/LinearLayout1"
 			    android:id="@+id/LinearLayout1"
 			    android:layout_width="match_parent"
 			    android:layout_width="match_parent"
@@ -125,7 +117,7 @@
 					    android:layout_marginRight="5dp"
 					    android:layout_marginRight="5dp"
 					    android:padding="0dp"
 					    android:padding="0dp"
 					    android:scaleType="fitCenter"
 					    android:scaleType="fitCenter"
-					    android:src="@drawable/ic_action_refresh_grey"
+					    android:src="@drawable/ic_action_refresh"
 					    android:visibility="gone"
 					    android:visibility="gone"
 						android:background="@android:color/transparent"
 						android:background="@android:color/transparent"
                         android:contentDescription="@string/auth_refresh_button"
                         android:contentDescription="@string/auth_refresh_button"
@@ -248,7 +240,6 @@
 					/>
 					/>
 
 
 			</LinearLayout>
 			</LinearLayout>
-		    </android.support.v7.widget.CardView>
 		</ScrollView>
 		</ScrollView>
 						           
 						           
 	</LinearLayout>
 	</LinearLayout>
@@ -263,10 +254,11 @@
         
         
 		<android.support.v7.widget.AppCompatButton
 		<android.support.v7.widget.AppCompatButton
 		    android:id="@+id/buttonOK"
 		    android:id="@+id/buttonOK"
-			android:theme="@style/Button.Primary"
-			style="@style/Button.Primary"
-		    android:layout_width="match_parent"
+			android:theme="@style/Button.Login"
+			style="@style/Button.Login"
+		    android:layout_width="wrap_content"
 		    android:layout_height="wrap_content"
 		    android:layout_height="wrap_content"
+			android:padding="@dimen/standard_padding"
 		    android:layout_gravity="center_horizontal"
 		    android:layout_gravity="center_horizontal"
 		    android:enabled="false"
 		    android:enabled="false"
 		    android:text="@string/setup_btn_connect"
 		    android:text="@string/setup_btn_connect"
@@ -286,7 +278,7 @@
 				android:onClick="onRegisterClick"
 				android:onClick="onRegisterClick"
 				android:paddingTop="5dp"
 				android:paddingTop="5dp"
 				android:text="@string/auth_register"
 				android:text="@string/auth_register"
-				android:textColor="@color/login_text_color"
+				android:textColor="@color/login_text_hint_color"
 				android:contentDescription="@string/auth_register"/>
 				android:contentDescription="@string/auth_register"/>
 
 
 		</LinearLayout>
 		</LinearLayout>

+ 14 - 24
res/layout/account_setup.xml

@@ -19,7 +19,6 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 -->
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-            xmlns:card_view="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_height="match_parent"
     android:layout_gravity="center"
     android:layout_gravity="center"
@@ -31,7 +30,6 @@
     <LinearLayout
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
-        android:background="@color/primary"
         android:gravity="center"
         android:gravity="center"
         android:orientation="vertical"
         android:orientation="vertical"
         android:padding="@dimen/standard_padding" >
         android:padding="@dimen/standard_padding" >
@@ -44,20 +42,12 @@
 			android:src="@drawable/logo"
 			android:src="@drawable/logo"
 			android:contentDescription="@string/app_name"/>
 			android:contentDescription="@string/app_name"/>
 
 
-		<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
-			android:id="@+id/card_view"
-			android:layout_gravity="center"
-			android:layout_width="match_parent"
-			android:layout_height="wrap_content"
-            card_view:cardBackgroundColor="@color/white"
-            card_view:cardCornerRadius="4dp">
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:gravity="center"
-                android:orientation="vertical"
-                android:padding="8dp">
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="vertical"
+            android:padding="@dimen/standard_half_padding">
 
 
         <android.support.v7.widget.AppCompatButton
         <android.support.v7.widget.AppCompatButton
             android:id="@+id/centeredRefreshButton"
             android:id="@+id/centeredRefreshButton"
@@ -104,7 +94,7 @@
                     android:inputType="textUri"
                     android:inputType="textUri"
                     android:paddingRight="55dp"
                     android:paddingRight="55dp"
                     android:textColor="@color/login_text_color"
                     android:textColor="@color/login_text_color"
-                    android:textColorHint="@color/login_text_hint_color">
+                    android:textColorHint="@color/login_text_color">
 
 
                     <requestFocus/>
                     <requestFocus/>
                 </EditText>
                 </EditText>
@@ -119,7 +109,7 @@
 			    android:layout_marginRight="5dp"
 			    android:layout_marginRight="5dp"
 			    android:padding="0dp"
 			    android:padding="0dp"
 			    android:scaleType="fitCenter"
 			    android:scaleType="fitCenter"
-			    android:src="@drawable/ic_action_refresh_grey"
+			    android:src="@drawable/ic_action_refresh"
 				android:visibility="gone"
 				android:visibility="gone"
 				android:background="@android:color/transparent"
 				android:background="@android:color/transparent"
                 android:contentDescription="@string/auth_refresh_button"
                 android:contentDescription="@string/auth_refresh_button"
@@ -147,7 +137,7 @@
             android:onClick="onCheckClick"
             android:onClick="onCheckClick"
             android:text="@string/oauth_check_onoff"
             android:text="@string/oauth_check_onoff"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textAppearance="?android:attr/textAppearanceSmall"
-            android:textColor="@color/primary"
+            android:textColor="@color/white"
             android:contentDescription="@string/oauth_check_onoff"
             android:contentDescription="@string/oauth_check_onoff"
             />
             />
 
 
@@ -242,11 +232,12 @@
 
 
         <android.support.v7.widget.AppCompatButton
         <android.support.v7.widget.AppCompatButton
             android:id="@+id/buttonOK"
             android:id="@+id/buttonOK"
-            android:theme="@style/Button.Primary"
-            style="@style/Button.Primary"
-            android:layout_width="match_parent"
+            android:theme="@style/Button.Login"
+            style="@style/Button.Login"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center_horizontal"
             android:layout_gravity="center_horizontal"
+            android:padding="@dimen/standard_padding"
             android:enabled="false"
             android:enabled="false"
             android:text="@string/setup_btn_connect"
             android:text="@string/setup_btn_connect"
             android:contentDescription="@string/setup_btn_connect"/>
             android:contentDescription="@string/setup_btn_connect"/>
@@ -265,12 +256,11 @@
                 android:paddingBottom="5dp"
                 android:paddingBottom="5dp"
                 android:paddingTop="5dp"
                 android:paddingTop="5dp"
                 android:text="@string/auth_register"
                 android:text="@string/auth_register"
-                android:textColor="@color/login_text_color"
+                android:textColor="@color/login_text_hint_color"
                 android:contentDescription="@string/auth_register"/>
                 android:contentDescription="@string/auth_register"/>
             
             
         </LinearLayout>
         </LinearLayout>
         </LinearLayout>
         </LinearLayout>
-		</android.support.v7.widget.CardView>
 
 
     </LinearLayout>
     </LinearLayout>
 
 

+ 2 - 2
res/values/setup.xml

@@ -31,8 +31,8 @@
     
     
     
     
     <!-- Colors -->
     <!-- Colors -->
-    <color name="login_text_color">#000000</color>
-    <color name="login_text_hint_color">#757575</color>
+    <color name="login_text_color">@color/white</color>
+    <color name="login_text_hint_color">#7fC0E3</color>
     <color name="login_background_color">#FFFFFF</color>
     <color name="login_background_color">#FFFFFF</color>
     <color name="login_logo_background_color">#FFFFFF</color>
     <color name="login_logo_background_color">#FFFFFF</color>
     <color name="background_color">#FFFFFF</color>
     <color name="background_color">#FFFFFF</color>

+ 11 - 1
res/values/styles.xml

@@ -51,7 +51,12 @@
 	</style>
 	</style>
 
 
 	<style name="Theme.ownCloud.noActionBar.Login" parent="Theme.ownCloud.Toolbar">
 	<style name="Theme.ownCloud.noActionBar.Login" parent="Theme.ownCloud.Toolbar">
-
+		<item name="android:windowBackground">@color/primary</item>
+		<item name="colorControlNormal">@color/login_text_hint_color</item>
+		<item name="colorControlActivated">@color/white</item>
+		<item name="colorControlHighlight">@color/login_text_hint_color</item>
+		<item name="colorAccent">@color/login_text_hint_color</item>
+		<item name="android:textColorHint">@color/login_text_hint_color</item>
 	</style>
 	</style>
 
 
 	<style name="ownCloud.AlertDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
 	<style name="ownCloud.AlertDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
@@ -96,6 +101,11 @@
 		<item name="android:textColor">@color/primary_button_text_color</item>
 		<item name="android:textColor">@color/primary_button_text_color</item>
 	</style>
 	</style>
 
 
+	<style name="Button.Login" parent="Button">
+		<item name="colorButtonNormal">@color/white</item>
+		<item name="android:textColor">@color/owncloud_blue</item>
+	</style>
+
 	<style name="Button.Borderless" parent="Base.Widget.AppCompat.Button.Borderless">
 	<style name="Button.Borderless" parent="Base.Widget.AppCompat.Button.Borderless">
 		<item name="android:textColor">@color/color_accent</item>
 		<item name="android:textColor">@color/color_accent</item>
 	</style>
 	</style>

+ 10 - 10
src/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -915,7 +915,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                 !mServerInfo.mVersion.isVersionValid()  || 
                 !mServerInfo.mVersion.isVersionValid()  || 
                 mServerInfo.mBaseUrl == null || 
                 mServerInfo.mBaseUrl == null || 
                 mServerInfo.mBaseUrl.length() == 0) {
                 mServerInfo.mBaseUrl.length() == 0) {
-            mServerStatusIcon = R.drawable.common_error;
+            mServerStatusIcon = R.drawable.ic_alert;
             mServerStatusText = R.string.auth_wtf_reenter_URL;
             mServerStatusText = R.string.auth_wtf_reenter_URL;
             showServerStatus();
             showServerStatus();
             mOkButton.setEnabled(false);
             mOkButton.setEnabled(false);
@@ -1190,11 +1190,11 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
      * @param result    Result of a remote operation performed in this activity
      * @param result    Result of a remote operation performed in this activity
      */
      */
     private void updateServerStatusIconAndText(RemoteOperationResult result) {
     private void updateServerStatusIconAndText(RemoteOperationResult result) {
-        mServerStatusIcon = R.drawable.common_error;    // the most common case in the switch below
+        mServerStatusIcon = R.drawable.ic_alert;    // the most common case in the switch below
 
 
         switch (result.getCode()) {
         switch (result.getCode()) {
         case OK_SSL:
         case OK_SSL:
-            mServerStatusIcon = R.drawable.ic_lock;
+            mServerStatusIcon = R.drawable.ic_lock_white;
             mServerStatusText = R.string.auth_secure_connection;
             mServerStatusText = R.string.auth_secure_connection;
             break;
             break;
 
 
@@ -1205,7 +1205,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                 mServerStatusIcon = R.drawable.ic_ok;
                 mServerStatusIcon = R.drawable.ic_ok;
             } else {
             } else {
                 mServerStatusText = R.string.auth_nossl_plain_ok_title;
                 mServerStatusText = R.string.auth_nossl_plain_ok_title;
-                mServerStatusIcon = R.drawable.ic_lock_open;
+                mServerStatusIcon = R.drawable.ic_lock_open_white;
             }
             }
             break;
             break;
 
 
@@ -1255,7 +1255,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
             mServerStatusText = R.string.auth_unknown_error_title;
             mServerStatusText = R.string.auth_unknown_error_title;
             break;
             break;
         case OK_REDIRECT_TO_NON_SECURE_CONNECTION:
         case OK_REDIRECT_TO_NON_SECURE_CONNECTION:
-            mServerStatusIcon = R.drawable.ic_lock_open;
+            mServerStatusIcon = R.drawable.ic_lock_open_white;
             mServerStatusText = R.string.auth_redirect_non_secure_connection_title;
             mServerStatusText = R.string.auth_redirect_non_secure_connection_title;
             break;
             break;
         default:
         default:
@@ -1271,11 +1271,11 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
      * @param result    Result of a remote operation performed in this activity
      * @param result    Result of a remote operation performed in this activity
      */
      */
     private void updateAuthStatusIconAndText(RemoteOperationResult result) {
     private void updateAuthStatusIconAndText(RemoteOperationResult result) {
-        mAuthStatusIcon = R.drawable.common_error;    // the most common case in the switch below
+        mAuthStatusIcon = R.drawable.ic_alert;    // the most common case in the switch below
 
 
         switch (result.getCode()) {
         switch (result.getCode()) {
         case OK_SSL:
         case OK_SSL:
-            mAuthStatusIcon = R.drawable.ic_lock;
+            mAuthStatusIcon = R.drawable.ic_lock_white;
             mAuthStatusText = R.string.auth_secure_connection;
             mAuthStatusText = R.string.auth_secure_connection;
             break;
             break;
 
 
@@ -1286,7 +1286,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                 mAuthStatusIcon = R.drawable.ic_ok;
                 mAuthStatusIcon = R.drawable.ic_ok;
             } else {
             } else {
                 mAuthStatusText = R.string.auth_nossl_plain_ok_title;
                 mAuthStatusText = R.string.auth_nossl_plain_ok_title;
-                mAuthStatusIcon = R.drawable.ic_lock_open;
+                mAuthStatusIcon = R.drawable.ic_lock_open_white;
             }
             }
             break;
             break;
 
 
@@ -1349,12 +1349,12 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
 
 
 
 
     private void updateStatusIconFailUserName(){
     private void updateStatusIconFailUserName(){
-        mAuthStatusIcon = R.drawable.common_error;
+        mAuthStatusIcon = R.drawable.ic_alert;
         mAuthStatusText = R.string.auth_fail_get_user_name;
         mAuthStatusText = R.string.auth_fail_get_user_name;
     }
     }
 
 
     private void updateServerStatusIconNoRegularAuth(){
     private void updateServerStatusIconNoRegularAuth(){
-        mServerStatusIcon = R.drawable.common_error;
+        mServerStatusIcon = R.drawable.ic_alert;
         mServerStatusText = R.string.auth_can_not_auth_against_server;
         mServerStatusText = R.string.auth_can_not_auth_against_server;
     }
     }