mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
fixing the progressbar corner glitch, bumping style of indeterminate animation to material style via appcompat, fixing progress bar for folder picker too, see comment
This commit is contained in:
parent
f7f468b578
commit
e36349f77e
5 changed files with 30 additions and 28 deletions
|
@ -4,15 +4,15 @@
|
|||
|
||||
<item
|
||||
android:id="@android:id/background"
|
||||
android:drawable="@drawable/owncloud_progress_bg_light" />
|
||||
android:drawable="@color/owncloud_blue" />
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<scale
|
||||
android:drawable="@drawable/owncloud_progress_secondary_light"
|
||||
android:drawable="@color/owncloud_blue"
|
||||
android:scaleWidth="100%" />
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale
|
||||
android:drawable="@drawable/owncloud_progress_primary_light"
|
||||
android:drawable="@color/owncloud_blue"
|
||||
android:scaleWidth="100%" />
|
||||
</item>
|
||||
|
||||
|
|
|
@ -31,14 +31,14 @@
|
|||
|
||||
<ProgressBar android:id="@+id/progressBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="6dp"
|
||||
android:layout_height="4dp"
|
||||
android:padding="0dp"
|
||||
android:layout_margin="0dp"
|
||||
style="@style/Widget.ownCloud.TopProgressBar"
|
||||
android:indeterminate="true"
|
||||
android:indeterminateOnly="true"
|
||||
android:background="#ffffff"
|
||||
|
||||
android:indeterminate="false"
|
||||
android:indeterminateOnly="false"
|
||||
android:background="@color/background_color"
|
||||
android:visibility="visible"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Progress bar -->
|
||||
<style name="Widget.ownCloud.TopProgressBar" parent="android:Widget.Holo.ProgressBar.Horizontal">
|
||||
<style name="Widget.ownCloud.TopProgressBar" parent="style/Widget.AppCompat.ProgressBar.Horizontal">
|
||||
<item name="android:progressDrawable">@drawable/actionbar_progress_horizontal</item>
|
||||
<item name="android:indeterminateDrawable">@drawable/actionbar_progress_indeterminate_horizontal</item>
|
||||
</style>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue