From: Andy Scherzinger Date: Tue, 18 Aug 2015 21:23:36 +0000 (+0200) Subject: Merge branch 'material_buttons' of https://github.com/owncloud/android into material_fab X-Git-Tag: beta-20151202~3^2~69 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/99e6db3d34f7f7498cc0d5bcc49fb3b7487511c1?hp=b0cb99b7c8081670af3c0e7f7a59f3cf0aa9c7d7 Merge branch 'material_buttons' of https://github.com/owncloud/android into material_fab --- diff --git a/AndroidManifest.xml b/AndroidManifest.xml index f36d2489..fc701a94 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -133,7 +133,7 @@ diff --git a/res/drawable-hdpi/common_error.png b/res/drawable-hdpi/common_error.png index 30eee6c4..14590e5b 100644 Binary files a/res/drawable-hdpi/common_error.png and b/res/drawable-hdpi/common_error.png differ diff --git a/res/drawable-hdpi/ic_lock.png b/res/drawable-hdpi/ic_lock.png index 895aabbf..1a5784fc 100644 Binary files a/res/drawable-hdpi/ic_lock.png and b/res/drawable-hdpi/ic_lock.png differ diff --git a/res/drawable-hdpi/ic_lock_open.png b/res/drawable-hdpi/ic_lock_open.png index 04c8f8c4..3e96a135 100644 Binary files a/res/drawable-hdpi/ic_lock_open.png and b/res/drawable-hdpi/ic_lock_open.png differ diff --git a/res/drawable-hdpi/ic_ok.png b/res/drawable-hdpi/ic_ok.png index 36d1ab20..9680855a 100644 Binary files a/res/drawable-hdpi/ic_ok.png and b/res/drawable-hdpi/ic_ok.png differ diff --git a/res/drawable-hdpi/logo.png b/res/drawable-hdpi/logo.png new file mode 100644 index 00000000..188d693a Binary files /dev/null and b/res/drawable-hdpi/logo.png differ diff --git a/res/drawable-hdpi/no_network.png b/res/drawable-hdpi/no_network.png new file mode 100644 index 00000000..a921888c Binary files /dev/null and b/res/drawable-hdpi/no_network.png differ diff --git a/res/drawable-xhdpi/common_error.png b/res/drawable-xhdpi/common_error.png index 6eb7943c..08177e7b 100644 Binary files a/res/drawable-xhdpi/common_error.png and b/res/drawable-xhdpi/common_error.png differ diff --git a/res/drawable-xhdpi/ic_lock.png b/res/drawable-xhdpi/ic_lock.png index c5e9d0b4..c7b3d383 100644 Binary files a/res/drawable-xhdpi/ic_lock.png and b/res/drawable-xhdpi/ic_lock.png differ diff --git a/res/drawable-xhdpi/ic_lock_open.png b/res/drawable-xhdpi/ic_lock_open.png index 6e1321e4..ad1b519f 100644 Binary files a/res/drawable-xhdpi/ic_lock_open.png and b/res/drawable-xhdpi/ic_lock_open.png differ diff --git a/res/drawable-xhdpi/ic_ok.png b/res/drawable-xhdpi/ic_ok.png index e5024472..c46df6b8 100644 Binary files a/res/drawable-xhdpi/ic_ok.png and b/res/drawable-xhdpi/ic_ok.png differ diff --git a/res/drawable-xhdpi/no_network.png b/res/drawable-xhdpi/no_network.png index b1b28b2a..628515df 100644 Binary files a/res/drawable-xhdpi/no_network.png and b/res/drawable-xhdpi/no_network.png differ diff --git a/res/drawable-xxhdpi/common_error.png b/res/drawable-xxhdpi/common_error.png index 3f401317..dc007ee6 100644 Binary files a/res/drawable-xxhdpi/common_error.png and b/res/drawable-xxhdpi/common_error.png differ diff --git a/res/drawable-xxhdpi/ic_lock.png b/res/drawable-xxhdpi/ic_lock.png index 0dcada81..745227fb 100644 Binary files a/res/drawable-xxhdpi/ic_lock.png and b/res/drawable-xxhdpi/ic_lock.png differ diff --git a/res/drawable-xxhdpi/ic_lock_open.png b/res/drawable-xxhdpi/ic_lock_open.png index b90a5980..a0eec1ff 100644 Binary files a/res/drawable-xxhdpi/ic_lock_open.png and b/res/drawable-xxhdpi/ic_lock_open.png differ diff --git a/res/drawable-xxhdpi/ic_ok.png b/res/drawable-xxhdpi/ic_ok.png index 6e03d54c..6fe6ef64 100644 Binary files a/res/drawable-xxhdpi/ic_ok.png and b/res/drawable-xxhdpi/ic_ok.png differ diff --git a/res/drawable-xxhdpi/logo.png b/res/drawable-xxhdpi/logo.png deleted file mode 100644 index c33cdb31..00000000 Binary files a/res/drawable-xxhdpi/logo.png and /dev/null differ diff --git a/res/drawable-xxhdpi/no_network.png b/res/drawable-xxhdpi/no_network.png index 1ffec0df..1fec70bc 100644 Binary files a/res/drawable-xxhdpi/no_network.png and b/res/drawable-xxhdpi/no_network.png differ diff --git a/res/drawable-xxxhdpi/logo.png b/res/drawable-xxxhdpi/logo.png deleted file mode 100644 index c33cdb31..00000000 Binary files a/res/drawable-xxxhdpi/logo.png and /dev/null differ diff --git a/res/drawable/process_dialog_background.xml b/res/drawable/process_dialog_background.xml new file mode 100644 index 00000000..9ba0b1e9 --- /dev/null +++ b/res/drawable/process_dialog_background.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/res/layout-land/account_setup.xml b/res/layout-land/account_setup.xml index 74b3e86f..2fcc1d0b 100644 --- a/res/layout-land/account_setup.xml +++ b/res/layout-land/account_setup.xml @@ -21,7 +21,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/login_background_color" - android:padding="@dimen/standard_padding" + android:padding="8dip" > + android:padding="8dp" > - @@ -129,14 +128,14 @@ android:text="@string/auth_testing_connection" android:contentDescription="@string/auth_testing_connection"/> - @@ -165,7 +164,7 @@ android:text="@string/oauth2_url_endpoint_access" android:singleLine="true" android:inputType="textUri" - android:textColor="@color/login_text_color" + android:textColor="@color/primary" android:textColorHint="@color/login_text_hint_color" android:visibility="gone"> @@ -178,7 +177,7 @@ android:ems="10" android:hint="@string/auth_username" android:inputType="textNoSuggestions" - android:textColor="@color/login_text_color" + android:textColor="@color/primary" android:textColorHint="@color/login_text_hint_color" android:contentDescription="@string/auth_username" /> @@ -191,9 +190,8 @@ android:hint="@string/auth_password" android:inputType="textPassword" android:drawablePadding="5dp" - android:textColor="@color/login_text_color" + android:textColor="@color/primary" android:textColorHint="@color/login_text_hint_color" - android:contentDescription="@string/auth_password" /> - + diff --git a/res/layout/account_setup.xml b/res/layout/account_setup.xml index c6b0943a..0789c599 100644 --- a/res/layout/account_setup.xml +++ b/res/layout/account_setup.xml @@ -32,19 +32,20 @@ android:background="@color/login_background_color" android:gravity="center" android:orientation="vertical" - android:padding="@dimen/standard_padding" > + android:padding="8dp" > @@ -115,7 +116,7 @@ android:text="@string/auth_testing_connection" android:contentDescription="@string/auth_testing_connection"/> - @@ -134,7 +135,7 @@ android:layout_height="wrap_content" android:ems="10" android:enabled="false" - android:textColor="@color/login_text_color" + android:textColor="@color/primary" android:textColorHint="@color/login_text_hint_color" android:text="@string/oauth2_url_endpoint_auth" android:singleLine="true" @@ -151,7 +152,7 @@ android:text="@string/oauth2_url_endpoint_access" android:singleLine="true" android:inputType="textUri" - android:textColor="@color/login_text_color" + android:textColor="@color/primary" android:textColorHint="@color/login_text_hint_color" android:visibility="gone"/> @@ -162,7 +163,7 @@ android:ems="10" android:hint="@string/auth_username" android:inputType="textNoSuggestions" - android:textColor="@color/login_text_color" + android:textColor="@color/primary" android:textColorHint="@color/login_text_hint_color" android:contentDescription="@string/auth_username" /> @@ -175,7 +176,7 @@ android:ems="10" android:hint="@string/auth_password" android:inputType="textPassword" - android:textColor="@color/login_text_color" + android:textColor="@color/primary" android:textColorHint="@color/login_text_hint_color" android:contentDescription="@string/auth_password" /> @@ -195,7 +196,8 @@ + + + + diff --git a/res/values-de-rDE/strings.xml b/res/values-de-rDE/strings.xml index 2491ad20..bcc60122 100644 --- a/res/values-de-rDE/strings.xml +++ b/res/values-de-rDE/strings.xml @@ -256,9 +256,9 @@ /SofortUpload Dateikonflikt Welche Datei möchtest du behalten? Wenn du beide Versionen auswählst, wird der lokalen Datei eine Zahl am Ende Ihres Dateiname angehangen. - Beide behalten - Benutze lokale Version - Benutze Version auf dem Server + Beide + lokale Version + Server Version Bildvorschau Dieses Bild kann nicht angezeigt werden %1$s konnte nicht in den lokalen %2$s Ordner kopiert werden diff --git a/res/values-v21/styles.xml b/res/values-v21/styles.xml new file mode 100644 index 00000000..173136cc --- /dev/null +++ b/res/values-v21/styles.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/res/values/colors.xml b/res/values/colors.xml index d3426536..49780a78 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -35,10 +35,11 @@ #fff0f0f0 #DDDDDD #EEEEEE - @color/dark_background_text_color - #777777 + #757575 + #757575 @color/owncloud_blue_accent #D6D7D7 + #00000000 @color/owncloud_blue_accent diff --git a/res/values/setup.xml b/res/values/setup.xml index ed2180ea..76bdd9f8 100644 --- a/res/values/setup.xml +++ b/res/values/setup.xml @@ -28,8 +28,8 @@ - #1D2D44 - #1D2D44 + #FFFFFF + #FFFFFF #F7F7F7 #1D2D44 #1D2D44 diff --git a/res/values/strings.xml b/res/values/strings.xml index a5d412b8..cc3587d1 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -269,8 +269,8 @@ File conflict Which files do you want to keep? If you select both versions, the local file will have a number added to its name. Keep both - Use local version - Use server version + local version + server version Image preview This image cannot be shown diff --git a/res/values/styles.xml b/res/values/styles.xml index dac28d9c..f37e4279 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -53,6 +53,14 @@ + diff --git a/src/com/owncloud/android/authentication/AuthenticatorActivity.java b/src/com/owncloud/android/authentication/AuthenticatorActivity.java index 13fdb9eb..3db9b7a3 100644 --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@ -251,6 +251,24 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity /// initialize general UI elements 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(); + } + }); mOkButton = findViewById(R.id.buttonOK); mOkButton.setOnClickListener(new View.OnClickListener() { diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index f0e7d854..e1c5c10d 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -47,6 +47,7 @@ import android.preference.PreferenceManager; import android.support.annotation.LayoutRes; import android.support.annotation.Nullable; import android.support.v7.app.ActionBar; +import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatDelegate; import android.support.v7.widget.Toolbar; import android.view.ContextMenu; @@ -58,6 +59,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemLongClickListener; +import android.widget.ArrayAdapter; import android.widget.ListAdapter; import android.widget.ListView; @@ -151,7 +153,49 @@ public class Preferences extends PreferenceActivity mShowContextMenu = true; mAccountName = ((RadioButtonPreference) obj).getKey(); - Preferences.this.openContextMenu(listView); + String[] items = { + getResources().getString(R.string.change_password), + getResources().getString(R.string.delete_account) + }; + final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Preferences.this); + View convertView = getLayoutInflater().inflate(R.layout.alert_dialog_list_view, null); + alertDialogBuilder.setView(convertView); + ListView lv = (ListView) convertView.findViewById(R.id.list); + ArrayAdapter adapter = new ArrayAdapter( + Preferences.this,R.layout.simple_dialog_list_item,items); + lv.setAdapter(adapter); + + //Setup proper inline listener + final AlertDialog alertDialog = alertDialogBuilder.create(); + lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + AccountManager am = (AccountManager) getSystemService(ACCOUNT_SERVICE); + Account accounts[] = am.getAccountsByType(MainApp.getAccountType()); + for (Account a : accounts) { + if (a.name.equals(mAccountName)) { + if (position==0) { + + // Change account password + Intent updateAccountCredentials = new Intent(Preferences.this, AuthenticatorActivity.class); + updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT, a); + updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACTION, + AuthenticatorActivity.ACTION_UPDATE_TOKEN); + startActivity(updateAccountCredentials); + alertDialog.cancel(); + + } else if (position==1) { + + // Remove account + am.removeAccount(a, Preferences.this, mHandler); + Log_OC.d(TAG, "Remove an account " + a.name); + alertDialog.cancel(); + } + } + } + } + }); + alertDialog.show(); View.OnLongClickListener longListener = (View.OnLongClickListener) obj; return longListener.onLongClick(view); @@ -440,40 +484,6 @@ public class Preferences extends PreferenceActivity super.onCreateContextMenu(menu, v, menuInfo); } - /** - * Called when the user clicked on an item into the context menu created at - * {@link #onCreateContextMenu(ContextMenu, View, ContextMenuInfo)} for - * every ownCloud {@link Account} , containing 'secondary actions' for them. - * - * {@inheritDoc} - */ - @Override - public boolean onContextItemSelected(android.view.MenuItem item) { - AccountManager am = (AccountManager) getSystemService(ACCOUNT_SERVICE); - Account accounts[] = am.getAccountsByType(MainApp.getAccountType()); - for (Account a : accounts) { - if (a.name.equals(mAccountName)) { - if (item.getItemId() == R.id.change_password) { - - // Change account password - Intent updateAccountCredentials = new Intent(this, AuthenticatorActivity.class); - updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT, a); - updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACTION, - AuthenticatorActivity.ACTION_UPDATE_TOKEN); - startActivity(updateAccountCredentials); - - } else if (item.getItemId() == R.id.delete_account) { - - // Remove account - am.removeAccount(a, this, mHandler); - Log_OC.d(TAG, "Remove an account " + a.name); - } - } - } - - return true; - } - @Override public void run(AccountManagerFuture future) { if (future.isDone()) { diff --git a/src/com/owncloud/android/ui/activity/Uploader.java b/src/com/owncloud/android/ui/activity/Uploader.java index 8ff505bc..7bea4bb3 100644 --- a/src/com/owncloud/android/ui/activity/Uploader.java +++ b/src/com/owncloud/android/ui/activity/Uploader.java @@ -64,6 +64,7 @@ import android.widget.AdapterView.OnItemClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; +import android.widget.ProgressBar; import android.widget.SimpleAdapter; import android.widget.Toast; @@ -201,10 +202,19 @@ public class Uploader extends FileActivity final AlertDialog.Builder builder = new Builder(this); switch (id) { case DIALOG_WAITING: - ProgressDialog pDialog = new ProgressDialog(this); + final ProgressDialog pDialog = new ProgressDialog(this, R.style.ProgressDialogTheme); pDialog.setIndeterminate(false); pDialog.setCancelable(false); pDialog.setMessage(getResources().getString(R.string.uploader_info_uploading)); + pDialog.setOnShowListener(new DialogInterface.OnShowListener() { + @Override + public void onShow(DialogInterface dialog) { + ProgressBar v = (ProgressBar) pDialog.findViewById(android.R.id.progress); + v.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.color_accent), + android.graphics.PorterDuff.Mode.MULTIPLY); + + } + }); return pDialog; case DIALOG_NO_ACCOUNT: builder.setIcon(android.R.drawable.ic_dialog_alert); diff --git a/src/com/owncloud/android/ui/dialog/AccountActionsDialogFragment.java b/src/com/owncloud/android/ui/dialog/AccountActionsDialogFragment.java new file mode 100644 index 00000000..968aac26 --- /dev/null +++ b/src/com/owncloud/android/ui/dialog/AccountActionsDialogFragment.java @@ -0,0 +1,146 @@ +package com.owncloud.android.ui.dialog; + +import android.os.Bundle; +import android.support.v4.app.DialogFragment; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.widget.AdapterView; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.ArrayAdapter; +import android.widget.ListView; + +import com.owncloud.android.R; +import com.owncloud.android.ui.dialog.parcel.MenuItemParcelable; +import com.owncloud.android.ui.dialog.parcel.MenuParcelable; + +import java.util.ArrayList; +import java.util.List; + +/** + * Dialog for choosing a file action. + */ +public class AccountActionsDialogFragment extends DialogFragment implements + OnItemClickListener { + private static final String ARG_ITEM_LIST = "ITEM_LIST"; + private static final String ARG_FILE_POSITION = "FILE_POSITION"; + public static final String FTAG_FILE_ACTIONS = "FILE_ACTIONS_FRAGMENT"; + + private List menuItems; + + private int filePosition; + + private ListView mListView; + + /** + * Listener interface for the file action fragment. + */ + public interface FileActionsDialogFragmentListener { + public boolean onFileActionChosen(int menuId, int filePosition); + } + + /** + * Public factory method to create new FileActionsDialogFragment instances. + * + * @param menu menu to be display. + * @return Dialog ready to show. + */ + public static AccountActionsDialogFragment newInstance(Menu menu, int filePosition) { + AccountActionsDialogFragment fragment = new AccountActionsDialogFragment(); + Bundle args = new Bundle(); + + MenuParcelable menuParcelable = new MenuParcelable(); + menuParcelable.setMenuItems(calculateMenuParcel(menu)); + + args.putParcelable(ARG_ITEM_LIST, menuParcelable); + args.putInt(ARG_FILE_POSITION, filePosition); + + fragment.setArguments(args); + return fragment; + } + + /** + * {@inheritDoc} + */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setStyle(DialogFragment.STYLE_NORMAL, R.style.ownCloud_Dialog); + } + + /** + * {@inheritDoc} + */ + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.file_actions, null, false); + mListView = (ListView) view.findViewById(R.id.file_actions_list); + + getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); + return view; + } + + + /** + * {@inheritDoc} + */ + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + + filePosition = getArguments().getInt(ARG_FILE_POSITION); + + MenuParcelable menu = getArguments().getParcelable(ARG_ITEM_LIST); + menuItems = menu.getMenuItems(); + List stringList = new ArrayList(); + for (int i = 0; i < menuItems.size(); i++) { + stringList.add(menuItems.get(i).getMenuText()); + } + + ArrayAdapter adapter = new ArrayAdapter(getActivity(), + R.layout.simple_dialog_list_item, stringList); + + mListView.setAdapter(adapter); + + mListView.setOnItemClickListener(this); + } + + /** + * {@inheritDoc} + */ + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + dismiss(); + ((FileActionsDialogFragmentListener) getTargetFragment()).onFileActionChosen(menuItems.get(position).getMenuItemId(), filePosition); + } + + /** + * calculates a parcelable list of MenuItemParcelable based on the given menu and the visibility of the menu items. + * + * @param menu the menu to be displayed + * @return a filtered List of parcelables based on the menu + */ + private static List calculateMenuParcel(Menu menu) { + int index = 0; + boolean hasNext = true; + List itemList = new ArrayList(); + MenuParcelable menuParcelable = new MenuParcelable(); + try { + while (hasNext) { + MenuItem item = menu.getItem(index); + if (item.isVisible()) { + itemList.add(new MenuItemParcelable(item)); + } + index++; + } + } catch (IndexOutOfBoundsException iobe) { + // reach the end of the item list + } + + return itemList; + } +} diff --git a/src/com/owncloud/android/ui/dialog/ConflictsResolveDialog.java b/src/com/owncloud/android/ui/dialog/ConflictsResolveDialog.java index dc228125..a01a7f9b 100644 --- a/src/com/owncloud/android/ui/dialog/ConflictsResolveDialog.java +++ b/src/com/owncloud/android/ui/dialog/ConflictsResolveDialog.java @@ -60,8 +60,8 @@ public class ConflictsResolveDialog extends DialogFragment { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { String remotepath = getArguments().getString("remotepath"); - return new AlertDialog.Builder(getActivity()) - .setIcon(DisplayUtils.getSeasonalIconId()) + return new AlertDialog.Builder(getActivity(), R.style.Theme_ownCloud_Dialog) + .setIcon(R.drawable.ic_warning) .setTitle(R.string.conflict_title) .setMessage(String.format(getString(R.string.conflict_message), remotepath)) .setPositiveButton(R.string.conflict_use_local_version, diff --git a/src/com/owncloud/android/ui/dialog/IndeterminateProgressDialog.java b/src/com/owncloud/android/ui/dialog/IndeterminateProgressDialog.java index 6f4b680d..6290e33e 100644 --- a/src/com/owncloud/android/ui/dialog/IndeterminateProgressDialog.java +++ b/src/com/owncloud/android/ui/dialog/IndeterminateProgressDialog.java @@ -26,6 +26,7 @@ import android.content.DialogInterface.OnKeyListener; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.view.KeyEvent; +import android.widget.ProgressBar; import com.owncloud.android.R; @@ -45,6 +46,7 @@ public class IndeterminateProgressDialog extends DialogFragment { */ public static IndeterminateProgressDialog newInstance(int messageId, boolean cancelable) { IndeterminateProgressDialog fragment = new IndeterminateProgressDialog(); + fragment.setStyle(DialogFragment.STYLE_NO_FRAME, R.style.ownCloud_AlertDialog); Bundle args = new Bundle(); args.putInt(ARG_MESSAGE_ID, messageId); args.putBoolean(ARG_CANCELABLE, cancelable); @@ -59,13 +61,22 @@ public class IndeterminateProgressDialog extends DialogFragment { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { /// create indeterminate progress dialog - final ProgressDialog dialog = new ProgressDialog(getActivity()); + final ProgressDialog dialog = new ProgressDialog(getActivity(), R.style.ProgressDialogTheme); dialog.setIndeterminate(true); + dialog.setOnShowListener(new DialogInterface.OnShowListener() { + @Override + public void onShow(DialogInterface dialog) { + ProgressBar v = (ProgressBar) getDialog().findViewById(android.R.id.progress); + v.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.color_accent), + android.graphics.PorterDuff.Mode.MULTIPLY); + + } + }); /// set message int messageId = getArguments().getInt(ARG_MESSAGE_ID, R.string.placeholder_sentence); dialog.setMessage(getString(messageId)); - + /// set cancellation behavior boolean cancelable = getArguments().getBoolean(ARG_CANCELABLE, false); if (!cancelable) { @@ -76,7 +87,7 @@ public class IndeterminateProgressDialog extends DialogFragment { public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) { - if( keyCode == KeyEvent.KEYCODE_BACK){ + if( keyCode == KeyEvent.KEYCODE_BACK) { return true; } return false; diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index ce9d2e6f..146d0ba2 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -235,7 +235,6 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi } } - MenuItem menuItem = new DialogMenuItem(item.getItemId()); FileActionsDialogFragment dialog = FileActionsDialogFragment.newInstance(menu, fileIndex); dialog.setTargetFragment(this, 0); dialog.show(getFragmentManager(), FileActionsDialogFragment.FTAG_FILE_ACTIONS);