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
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"
\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
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
<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"
<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"
<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"
<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"
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"
<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"
<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" />
<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"
<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"
\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
\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
<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"
<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"
<?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>
<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>
<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>
<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 -->
<?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">
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
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
\r
mHostUrlInput.removeTextChangedListener(mHostUrlInputWatcher);\r
mHostUrlInput.setOnFocusChangeListener(null);\r
- \r
+\r
super.onPause();\r
}\r
\r
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
* 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
}\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
// }
// 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);
}
/**
+ * 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.
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) {
}
}
-
private void createMinFragments() {
OCFileListFragment listOfFiles = new OCFileListFragment();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();