From: Andy Scherzinger Date: Tue, 4 Aug 2015 16:32:33 +0000 (+0200) Subject: fixing the progressbar corner glitch, bumping style of indeterminate animation to... X-Git-Tag: oc-android-1.8~42^2~39 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/e36349f77e19b11c81759dd27315517266e92e09?hp=--cc fixing the progressbar corner glitch, bumping style of indeterminate animation to material style via appcompat, fixing progress bar for folder picker too, see comment --- e36349f77e19b11c81759dd27315517266e92e09 diff --git a/res/drawable/actionbar_progress_horizontal.xml b/res/drawable/actionbar_progress_horizontal.xml index d3dcd20e..6c3c0f18 100644 --- a/res/drawable/actionbar_progress_horizontal.xml +++ b/res/drawable/actionbar_progress_horizontal.xml @@ -4,15 +4,15 @@ + android:drawable="@color/owncloud_blue" /> diff --git a/res/layout/files.xml b/res/layout/files.xml index a968f3bf..5a2e9572 100644 --- a/res/layout/files.xml +++ b/res/layout/files.xml @@ -31,14 +31,14 @@ - diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index b0c51e35..05e73fbb 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -154,7 +154,6 @@ public class FileDisplayActivity extends HookActivity @Override protected void onCreate(Bundle savedInstanceState) { Log_OC.v(TAG, "onCreate() start"); - //requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); super.onCreate(savedInstanceState); // this calls onAccountChanged() when ownCloud Account // is valid @@ -188,6 +187,9 @@ public class FileDisplayActivity extends HookActivity initDrawer(); mProgressBar = (ProgressBar) findViewById(R.id.progressBar); + mProgressBar.setIndeterminateDrawable( + getResources().getDrawable( + R.drawable.actionbar_progress_indeterminate_horizontal)); mDualPane = getResources().getBoolean(R.bool.large_land_layout); mLeftFragmentContainer = findViewById(R.id.left_fragment_container); @@ -205,9 +207,7 @@ public class FileDisplayActivity extends HookActivity //getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); - mProgressBar.setVisibility((mSyncInProgress) ? View.VISIBLE : View.INVISIBLE); - //setSupportProgressBarIndeterminateVisibility(mSyncInProgress - /*|| mRefreshSharesInProgress*/ //); + mProgressBar.setIndeterminate(mSyncInProgress); // always AFTER setContentView(...) ; to work around bug in its implementation initDrawer(); @@ -954,7 +954,8 @@ public class FileDisplayActivity extends HookActivity } removeStickyBroadcast(intent); Log_OC.d(TAG, "Setting progress visibility to " + mSyncInProgress); - mProgressBar.setVisibility((mSyncInProgress) ? View.VISIBLE : View.INVISIBLE); + mProgressBar.setIndeterminate(mSyncInProgress); + //mProgressBar.setVisibility((mSyncInProgress) ? View.VISIBLE : View.INVISIBLE); //setSupportProgressBarIndeterminateVisibility(mSyncInProgress /*|| mRefreshSharesInProgress*/ //); @@ -1053,9 +1054,7 @@ public class FileDisplayActivity extends HookActivity } // TODO what about other kind of previews? } - //setSupportProgressBarIndeterminate(false); - mProgressBar.setVisibility(View.INVISIBLE); - + mProgressBar.setIndeterminate(false); } finally { if (intent != null) { removeStickyBroadcast(intent); @@ -1579,9 +1578,7 @@ public class FileDisplayActivity extends HookActivity getApplicationContext() ); synchFolderOp.execute(getAccount(), MainApp.getAppContext(), this, null, null); - - mProgressBar.setVisibility(View.VISIBLE); - //setSupportProgressBarIndeterminateVisibility(true); + mProgressBar.setIndeterminate(true); setBackgroundText(); } diff --git a/src/com/owncloud/android/ui/activity/FolderPickerActivity.java b/src/com/owncloud/android/ui/activity/FolderPickerActivity.java index df067f0a..4b558f00 100644 --- a/src/com/owncloud/android/ui/activity/FolderPickerActivity.java +++ b/src/com/owncloud/android/ui/activity/FolderPickerActivity.java @@ -40,6 +40,7 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.Window; import android.widget.Button; +import android.widget.ProgressBar; import android.widget.Toast; import com.owncloud.android.R; @@ -80,12 +81,12 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C protected Button mCancelBtn; protected Button mChooseBtn; + private ProgressBar mProgressBar; @Override protected void onCreate(Bundle savedInstanceState) { Log_OC.d(TAG, "onCreate() start"); - requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); super.onCreate(savedInstanceState); @@ -102,14 +103,18 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); - setSupportProgressBarIndeterminateVisibility(mSyncInProgress); - // always AFTER setContentView(...) ; to work around bug in its implementation + + mProgressBar = (ProgressBar) findViewById(R.id.progressBar); + mProgressBar.setIndeterminateDrawable( + getResources().getDrawable( + R.drawable.actionbar_progress_indeterminate_horizontal)); + mProgressBar.setIndeterminate(mSyncInProgress); + // always AFTER setContentView(...) ; to work around bug in its implementation // sets message for empty list of folders setBackgroundText(); Log_OC.d(TAG, "onCreate() end"); - } @Override @@ -215,8 +220,8 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C getApplicationContext() ); synchFolderOp.execute(getAccount(), this, null, null); - - setSupportProgressBarIndeterminateVisibility(true); + + mProgressBar.setIndeterminate(true); setBackgroundText(); } @@ -520,10 +525,10 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C } removeStickyBroadcast(intent); Log_OC.d(TAG, "Setting progress visibility to " + mSyncInProgress); - setSupportProgressBarIndeterminateVisibility(mSyncInProgress /*|| mRefreshSharesInProgress*/); + + mProgressBar.setIndeterminate(mSyncInProgress); setBackgroundText(); - } } catch (RuntimeException e) {