fixed button style blue/grey

This commit is contained in:
Andy Scherzinger 2015-08-12 18:54:27 +02:00
parent 6809e4a9de
commit 05ca0270a8
19 changed files with 87 additions and 85 deletions

View file

@ -58,13 +58,13 @@
android:orientation="vertical"
android:padding="0dp" >
<Button
<android.support.v7.widget.AppCompatButton
android:id="@+id/centeredRefreshButton"
android:theme="@style/Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="10dp"
android:onClick="onRefreshClick"
android:text="@string/auth_check_server"
android:visibility="gone"
android:contentDescription="@string/auth_check_server"/>
@ -224,12 +224,11 @@
<android.support.v7.widget.AppCompatButton
android:id="@+id/buttonOK"
style="@style/ownCloud.Button"
android:theme="@style/Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:enabled="false"
android:onClick="onOkClick"
android:text="@string/setup_btn_connect"
android:contentDescription="@string/setup_btn_connect"/>

View file

@ -49,15 +49,17 @@
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"

View file

@ -45,12 +45,11 @@
<android.support.v7.widget.AppCompatButton
android:id="@+id/centeredRefreshButton"
style="@style/ownCloud.Button"
android:theme="@style/Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="10dp"
android:onClick="onRefreshClick"
android:text="@string/auth_check_server"
android:visibility="gone"
android:contentDescription="@string/auth_check_server"/>
@ -197,12 +196,11 @@
<android.support.v7.widget.AppCompatButton
android:id="@+id/buttonOK"
style="@style/ownCloud.Button"
android:theme="@style/Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:enabled="false"
android:onClick="onOkClick"
android:text="@string/setup_btn_connect"
android:contentDescription="@string/setup_btn_connect"/>

View file

@ -93,7 +93,11 @@
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>

View 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"

View 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"

View 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"

View 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" />

View file

@ -436,7 +436,7 @@
<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"
@ -444,7 +444,7 @@
<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"
@ -452,7 +452,7 @@
<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"

View file

@ -408,7 +408,7 @@
<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"
@ -416,7 +416,7 @@
<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"
@ -424,7 +424,7 @@
<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"

View file

@ -38,7 +38,7 @@
<android.support.v7.widget.AppCompatButton
android:id="@+id/upload_files_btn_cancel"
style="@style/ownCloud.Button"
android:theme="@style/Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -46,7 +46,7 @@
<android.support.v7.widget.AppCompatButton
android:id="@+id/upload_files_btn_upload"
style="@style/ownCloud.Button"
android:theme="@style/Button.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"

View 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"

View file

@ -1,12 +1,6 @@
<?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" >

View 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>

View file

@ -21,37 +21,37 @@
<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 -->

View 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">

View file

@ -176,6 +176,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
private EditText mUsernameInput;
private EditText mPasswordInput;
private View mOkButton;
private View mCenteredRefreshButton;
private TextView mAuthStatusView;
private int mAuthStatusText = 0, mAuthStatusIcon = 0;
@ -252,6 +253,23 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
initOverallUi();
mOkButton = findViewById(R.id.buttonOK);
mOkButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onOkClick();
}
});
mCenteredRefreshButton = findViewById(R.id.centeredRefreshButton);
mCenteredRefreshButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checkOcServer();
}
});
/// initialize block to be moved to single Fragment to check server and get info about it
initServerPreFragment(savedInstanceState);
@ -683,7 +701,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
mHostUrlInput.removeTextChangedListener(mHostUrlInputWatcher);
mHostUrlInput.setOnFocusChangeListener(null);
super.onPause();
}
@ -792,8 +810,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
Intent getServerInfoIntent = new Intent();
getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO);
getServerInfoIntent.putExtra(
OperationsService.EXTRA_SERVER_URL,
normalizeUrlSuffix(uri)
OperationsService.EXTRA_SERVER_URL,
normalizeUrlSuffix(uri)
);
if (mOperationsServiceBinder != null) {
mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(getServerInfoIntent);
@ -870,10 +888,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
* is postponed until it is available.
*
* IMPORTANT ENTRY POINT 4
*
* @param view OK button
*/
public void onOkClick(View view) {
public void onOkClick() {
// this check should be unnecessary
if (mServerInfo.mVersion == null ||
!mServerInfo.mVersion.isVersionValid() ||
@ -1606,18 +1622,6 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
}
}
/**
* Called when the refresh button in the input field for ownCloud host is clicked.
*
* Performs a new check on the URL in the input field.
*
* @param view Refresh 'button'
*/
public void onRefreshClick(View view) {
checkOcServer();
}
/**
* Called when the eye icon in the password field is clicked.
*

View 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);
@ -420,6 +415,21 @@ public class FileActivity extends AppCompatActivity
mDrawerToggle.setDrawerIndicatorEnabled(false);
}
/**
* 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).
*

View 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();