fixed button style blue/grey
authorAndy Scherzinger <info@andy-scherzinger.de>
Wed, 12 Aug 2015 16:54:27 +0000 (18:54 +0200)
committerAndy Scherzinger <info@andy-scherzinger.de>
Wed, 12 Aug 2015 16:54:27 +0000 (18:54 +0200)
19 files changed:
res/layout-land/account_setup.xml
res/layout-v14/generic_explanation.xml
res/layout/account_setup.xml
res/layout/drawer.xml
res/layout/files_folder_picker.xml
res/layout/generic_explanation.xml
res/layout/log_send_file.xml
res/layout/passcodelock.xml
res/layout/ssl_untrusted_cert_layout.xml
res/layout/ssl_validator_layout.xml
res/layout/upload_files_layout.xml
res/layout/uploader_layout.xml
res/values-v11/versioned_styles.xml
res/values/colors.xml
res/values/styles.xml
res/values/versioned_styles.xml
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/ui/activity/FileActivity.java
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

index b147852..5f63ecc 100644 (file)
                            android:orientation="vertical"\r
                            android:padding="0dp" >\r
                            \r
-                               <Button\r
+                               <android.support.v7.widget.AppCompatButton\r
                                    android:id="@+id/centeredRefreshButton"\r
+                                       android:theme="@style/Button"\r
                                    android:layout_width="wrap_content"\r
                                    android:layout_height="wrap_content"\r
                                    android:layout_gravity="center_horizontal"\r
                                        android:layout_marginBottom="10dp"\r
-                       android:onClick="onRefreshClick"\r
                                    android:text="@string/auth_check_server"\r
                                    android:visibility="gone"\r
                     android:contentDescription="@string/auth_check_server"/>\r
 \r
                <android.support.v7.widget.AppCompatButton\r
                    android:id="@+id/buttonOK"\r
-                       style="@style/ownCloud.Button"\r
+                       android:theme="@style/Button"\r
                    android:layout_width="match_parent"\r
                    android:layout_height="wrap_content"\r
                    android:layout_gravity="center_horizontal"\r
                    android:enabled="false"\r
-                   android:onClick="onOkClick"\r
                    android:text="@string/setup_btn_connect"\r
             android:contentDescription="@string/setup_btn_connect"/>\r
                \r
index bd4b0b6..d90fb8a 100644 (file)
         android:orientation="horizontal" >
 
         <!-- 'OK' / 'CANCEL' BUTTONS CHANGE THEIR ORDER FROM ANDROID 4.0 ; THANKS, GOOGLE -->
-        <Button
+        <android.support.v7.widget.AppCompatButton
             android:id="@+id/cancel"
+            android:theme="@style/Button"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_weight="1"
             android:text="@string/common_cancel" />
 
-               <Button
+        <android.support.v7.widget.AppCompatButton
                    android:id="@+id/ok"
+            android:theme="@style/Button.Primary"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
index e2b7933..ed3ca84 100644 (file)
 \r
         <android.support.v7.widget.AppCompatButton\r
             android:id="@+id/centeredRefreshButton"\r
-            style="@style/ownCloud.Button"\r
+            android:theme="@style/Button"\r
             android:layout_width="wrap_content"\r
             android:layout_height="wrap_content"\r
             android:layout_gravity="center_horizontal"\r
             android:layout_marginBottom="10dp"\r
-            android:onClick="onRefreshClick"\r
             android:text="@string/auth_check_server"\r
             android:visibility="gone"\r
             android:contentDescription="@string/auth_check_server"/>\r
 \r
         <android.support.v7.widget.AppCompatButton\r
             android:id="@+id/buttonOK"\r
-            style="@style/ownCloud.Button"\r
+            android:theme="@style/Button"\r
             android:layout_width="match_parent"\r
             android:layout_height="wrap_content"\r
             android:layout_gravity="center_horizontal"\r
             android:enabled="false"\r
-            android:onClick="onOkClick"\r
             android:text="@string/setup_btn_connect"\r
             android:contentDescription="@string/setup_btn_connect"/>\r
 \r
index 86b64be..cf68f44 100644 (file)
                 android:text="@string/app_name"
                 android:textColor="#FFF"
                 android:paddingLeft="16dp"
-                android:textSize="24sp" />
+                android:paddingRight="16dp"
+                android:textSize="24sp"
+                android:ellipsize="end"
+                android:singleLine="true"
+                />
         </LinearLayout>
     </RelativeLayout>
 </merge>
\ No newline at end of file
index 4fbec4a..0e334fd 100644 (file)
@@ -48,7 +48,7 @@
 
         <android.support.v7.widget.AppCompatButton
             android:id="@+id/folder_picker_btn_cancel"
-            style="@style/ownCloud.Button"
+            android:theme="@style/Button"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_weight="1"
@@ -56,7 +56,7 @@
 
         <android.support.v7.widget.AppCompatButton
                    android:id="@+id/folder_picker_btn_choose"
-            style="@style/ownCloud.Button"
+            android:theme="@style/Button.Primary"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
index f20c5f3..64c9ed0 100644 (file)
@@ -50,7 +50,7 @@
 
         <android.support.v7.widget.AppCompatButton
                    android:id="@+id/ok"
-            style="@style/ownCloud.Button"
+            android:theme="@style/Button.Primary"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
@@ -58,7 +58,7 @@
 
         <android.support.v7.widget.AppCompatButton
             android:id="@+id/cancel"
-            style="@style/ownCloud.Button"
+            android:theme="@style/Button"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_weight="1"
index 4f90772..89d1ccd 100644 (file)
@@ -51,9 +51,9 @@
         android:layout_height="wrap_content"
         android:orientation="horizontal" >
 
-    <android.support.v7.widget.AppCompatButton
+    <Button
         android:id="@+id/deleteLogHistoryButton"
-        style="@style/ownCloud.Button"
+        android:theme="@style/Button"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_gravity="bottom"
@@ -62,7 +62,7 @@
 
     <android.support.v7.widget.AppCompatButton
         android:id="@+id/sendLogHistoryButton"
-        style="@style/ownCloud.Button"
+        android:theme="@style/Button.Primary"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_gravity="bottom"
index 52a0d30..14c3cf6 100644 (file)
@@ -82,7 +82,7 @@
 
     <android.support.v7.widget.AppCompatButton
         android:id="@+id/cancel"
-        style="@style/ownCloud.Button"
+        android:theme="@style/Button.Primary"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/common_cancel" />
index c8d15fc..7712342 100644 (file)
 
                <android.support.v7.widget.AppCompatButton
             android:id="@+id/cancel"
-                       style="@style/ownCloud.Button"
+                       android:theme="@style/Button"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_weight="1"
 
                <android.support.v7.widget.AppCompatButton
             android:id="@+id/details_btn"
-                       style="@style/ownCloud.Button"
+                       android:theme="@style/Button"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_weight="1"
 
                <android.support.v7.widget.AppCompatButton
             android:id="@+id/ok"
-                       style="@style/ownCloud.Button"
+                       android:theme="@style/Button"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_weight="1"
index 8fda8c2..88e49b4 100644 (file)
 
                <android.support.v7.widget.AppCompatButton
             android:id="@+id/cancel"
-                       style="@style/ownCloud.Button"
+                       android:theme="@style/Button"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_weight="1"
 
                <android.support.v7.widget.AppCompatButton
             android:id="@+id/details_btn"
-                       style="@style/ownCloud.Button"
+                       android:theme="@style/Button"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_weight="1"
 
                <android.support.v7.widget.AppCompatButton
             android:id="@+id/ok"
-                       style="@style/ownCloud.Button"
+                       android:theme="@style/Button"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_weight="1"
index 95a3fb2..121fd64 100644 (file)
@@ -38,7 +38,7 @@
 \r
         <android.support.v7.widget.AppCompatButton\r
             android:id="@+id/upload_files_btn_cancel"\r
-            style="@style/ownCloud.Button"\r
+            android:theme="@style/Button"\r
             android:layout_width="wrap_content"\r
             android:layout_height="wrap_content"\r
             android:layout_weight="1"\r
@@ -46,7 +46,7 @@
 \r
         <android.support.v7.widget.AppCompatButton\r
                    android:id="@+id/upload_files_btn_upload"\r
-            style="@style/ownCloud.Button"\r
+            android:theme="@style/Button.Primary"\r
                    android:layout_width="wrap_content"\r
                    android:layout_height="wrap_content"\r
                    android:layout_weight="1"\r
index 2ba4a0b..d0f9c6e 100644 (file)
@@ -54,7 +54,7 @@
 
                <android.support.v7.widget.AppCompatButton
                    android:id="@+id/uploader_new_folder"
-                       style="@style/ownCloud.Button"
+                       android:theme="@style/Button"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
@@ -63,7 +63,7 @@
 
                <android.support.v7.widget.AppCompatButton
                    android:id="@+id/uploader_choose_folder"
-                       style="@style/ownCloud.Button"
+                       android:theme="@style/Button.Primary"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
index ab237e8..4fdc212 100644 (file)
@@ -1,13 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android">
-       
-       <style name="Theme.ownCloud.ButtonStyle" parent="@android:style/Widget.Holo.Light.Button">
-               <item name="android:background">@android:drawable/btn_default</item>
-               <item name="android:textColor">@color/button_text_color</item>
-       </style>
 
        <!-- Notifications -->
-       <!-- Notifications -->
        <style  name="Theme.ownCloud.NotificationText.Title" 
                parent="@android:style/TextAppearance.StatusBar.EventContent.Title" > 
                <item name="android:textSize">18sp</item>
index 58a3eee..316e076 100644 (file)
@@ -25,6 +25,7 @@
 
     <color name="list_item_lastmod_and_filesize_text">#989898</color>
     <color name="black">#000000</color>
+    <color name="white">#FFFFFF</color>
     <color name="textColor">#303030</color>
     <color name="drawerMenuTextColor">#757575</color>
     <color name="list_divider_background">#fff0f0f0</color>
@@ -32,6 +33,8 @@
     <color name="dark_background_text_color">#EEEEEE</color>
     <color name="login_text_color">@color/dark_background_text_color</color>
     <color name="login_text_hint_color">#777777</color>
+    <color name="primary_button_color">@color/owncloud_blue_accent</color>
+    <color name="secondary_button_color">#D6D7D7</color>
 
     <!-- Colors -->
     <color name="color_accent">@color/owncloud_blue_accent</color>
index 4ad0105..5fd987c 100644 (file)
        <style name="Animations" />
 
        <!-- General ownCloud app style -->
-       <style name="Theme.ownCloud" parent="style/Theme.AppCompat.Light.DarkActionBar">
+       <style name="Theme.ownCloud" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="android:actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
        <item name="actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
-       <item name="android:buttonStyle">@style/Theme.ownCloud.ButtonStyle</item>
                <item name="colorPrimary">@color/primary</item>
                <item name="colorPrimaryDark">@color/primary_dark</item>
                <item name="colorAccent">@color/color_accent</item>
                <item name="android:alertDialogTheme">@style/Theme.ownCloud.Dialog</item>
-               <item name="colorButtonNormal">@color/background_color</item>
-               <item name="colorControlActivated">@color/primary_dark</item>
-               <item name="colorControlHighlight">@color/color_accent</item>
        </style>
 
        <!-- seperate action bar style for activities without an action bar -->
-       <style name="Theme.ownCloud.noActionBar" parent="style/Theme.AppCompat.Light.DarkActionBar">
-               <item name="android:buttonStyle">@style/Theme.ownCloud.ButtonStyle</item>
+       <style name="Theme.ownCloud.noActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
                <item name="windowNoTitle">true</item>
                <item name="windowActionBar">false</item>
                <item name="colorPrimary">@color/primary</item>
                <item name="colorPrimaryDark">@color/primary_dark</item>
                <item name="colorAccent">@color/color_accent</item>
                <item name="android:alertDialogTheme">@style/Theme.ownCloud.Dialog</item>
-               <item name="colorButtonNormal">@color/background_color</item>
-               <item name="colorControlActivated">@color/primary_dark</item>
-               <item name="colorControlHighlight">@color/color_accent</item>
     </style>
 
        <style name="ownCloud.Button" parent="Widget.AppCompat.Button">
                <item name="colorButtonNormal">@color/primary</item>
-               <item name="colorControlActivated">@color/primary_dark</item>
-               <item name="colorControlHighlight">@color/color_accent</item>
+       </style>
+
+       <style name="Button" parent="Base.Widget.AppCompat.Button">
+               <item name="colorButtonNormal">@color/secondary_button_color</item>
+               <item name="android:textColor">@color/color_accent</item>
+       </style>
+
+       <style name="Button.Primary" parent="Button">
+               <item name="colorButtonNormal">@color/primary_button_color</item>
+               <item name="android:textColor">@color/white</item>
        </style>
 
        <!-- separat translucent action bar style -->
index fc5c292..660e0fd 100644 (file)
@@ -1,12 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android">
-       
-    <!-- Buttons -->
-       <style name="Theme.ownCloud.ButtonStyle" parent="@android:style/Widget.Button">
-               <item name="android:background">@android:drawable/btn_default</item>
-               <item name="android:textColor">@color/button_text_color</item>
-       </style>
-       
+
        <!-- DropDown -->
        <style name="Theme.ownCloud.DropDownStyle"
                parent="style/Widget.AppCompat.Spinner.DropDown.ActionBar">
index b7ec1c6..13fdb9e 100644 (file)
@@ -176,6 +176,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
     private EditText mUsernameInput;\r
     private EditText mPasswordInput;\r
     private View mOkButton;\r
+    private View mCenteredRefreshButton;\r
     private TextView mAuthStatusView;\r
 \r
     private int mAuthStatusText = 0, mAuthStatusIcon = 0;\r
@@ -252,6 +253,23 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
         initOverallUi();\r
         \r
         mOkButton = findViewById(R.id.buttonOK);\r
+        mOkButton.setOnClickListener(new View.OnClickListener() {\r
+\r
+            @Override\r
+            public void onClick(View v) {\r
+                onOkClick();\r
+            }\r
+        });\r
+\r
+        mCenteredRefreshButton = findViewById(R.id.centeredRefreshButton);\r
+        mCenteredRefreshButton.setOnClickListener(new View.OnClickListener() {\r
+\r
+            @Override\r
+            public void onClick(View v) {\r
+                checkOcServer();\r
+            }\r
+        });\r
+\r
 \r
         /// initialize block to be moved to single Fragment to check server and get info about it \r
         initServerPreFragment(savedInstanceState);\r
@@ -683,7 +701,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
         \r
         mHostUrlInput.removeTextChangedListener(mHostUrlInputWatcher);\r
         mHostUrlInput.setOnFocusChangeListener(null);\r
-        \r
+\r
         super.onPause();\r
     }\r
     \r
@@ -792,8 +810,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
             Intent getServerInfoIntent = new Intent();\r
             getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO);\r
             getServerInfoIntent.putExtra(\r
-                OperationsService.EXTRA_SERVER_URL,\r
-                normalizeUrlSuffix(uri)\r
+                    OperationsService.EXTRA_SERVER_URL,\r
+                    normalizeUrlSuffix(uri)\r
             );\r
             if (mOperationsServiceBinder != null) {\r
                 mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(getServerInfoIntent);\r
@@ -870,10 +888,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
      * is postponed until it is available.\r
      * \r
      * IMPORTANT ENTRY POINT 4\r
-     * \r
-     * @param view      OK button\r
      */\r
-    public void onOkClick(View view) {\r
+    public void onOkClick() {\r
         // this check should be unnecessary\r
         if (mServerInfo.mVersion == null || \r
                 !mServerInfo.mVersion.isVersionValid()  || \r
@@ -1607,18 +1623,6 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
     }\r
 \r
     /**\r
-     * Called when the refresh button in the input field for ownCloud host is clicked.\r
-     * \r
-     * Performs a new check on the URL in the input field.\r
-     * \r
-     * @param view      Refresh 'button'\r
-     */\r
-    public void onRefreshClick(View view) {\r
-        checkOcServer();\r
-    }\r
-\r
-\r
-    /**\r
      * Called when the eye icon in the password field is clicked.\r
      * \r
      * Toggles the visibility of the password in the field. \r
index 14a65f5..154aa7d 100644 (file)
@@ -349,12 +349,7 @@ public class FileActivity extends AppCompatActivity
 //        }
 
         // Display username in drawer
-        Account account = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
-        if (account != null) {
-            TextView username = (TextView) navigationDrawerLayout.findViewById(R.id.drawer_username);
-            int lastAtPos = account.name.lastIndexOf("@");
-            username.setText(account.name.substring(0, lastAtPos));
-        }
+        setUsernameInDrawer(navigationDrawerLayout, AccountUtils.getCurrentOwnCloudAccount(getApplicationContext()));
 
         // load slide menu items
         mDrawerTitles = getResources().getStringArray(R.array.drawer_items);
@@ -421,6 +416,21 @@ public class FileActivity extends AppCompatActivity
     }
 
     /**
+     * sets the given account name in the drawer in case the drawer is available. The account name
+     * is shortened beginning from the @-sign in the username.
+     *
+     * @param navigationDrawerLayout the drawer layout to be used
+     * @param account                the account to be set in the drawer
+     */
+    protected void setUsernameInDrawer(RelativeLayout navigationDrawerLayout, Account account) {
+        if (navigationDrawerLayout != null && getAccount() != null) {
+            TextView username = (TextView) navigationDrawerLayout.findViewById(R.id.drawer_username);
+            int lastAtPos = account.name.lastIndexOf("@");
+            username.setText(account.name.substring(0, lastAtPos));
+        }
+    }
+
+    /**
      * Updates title bar and home buttons (state and icon).
      *
      * Assumes that navigation drawer is NOT visible.
index 6d7481e..6c8c219 100644 (file)
@@ -262,12 +262,7 @@ public class FileDisplayActivity extends HookActivity
             setFile(file);
 
             if (mAccountWasSet) {
-                RelativeLayout navigationDrawerLayout = (RelativeLayout) findViewById(R.id.left_drawer);
-                if (navigationDrawerLayout != null && getAccount() != null) {
-                    TextView username = (TextView) navigationDrawerLayout.findViewById(R.id.drawer_username);
-                    int lastAtPos = getAccount().name.lastIndexOf("@");
-                    username.setText(getAccount().name.substring(0, lastAtPos));
-                }
+                setUsernameInDrawer((RelativeLayout) findViewById(R.id.left_drawer), getAccount());
             }
 
             if (!stateWasRecovered) {
@@ -284,7 +279,6 @@ public class FileDisplayActivity extends HookActivity
         }
     }
 
-
     private void createMinFragments() {
         OCFileListFragment listOfFiles = new OCFileListFragment();
         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();