|
@@ -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;
|
|
|
|
|
@@ -62,11 +63,20 @@ public class IndeterminateProgressDialog extends DialogFragment {
|
|
|
/// create indeterminate progress dialog
|
|
|
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) {
|
|
@@ -77,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;
|