Java Code Examples for android.widget.ProgressBar#isIndeterminate()
The following examples show how to use
android.widget.ProgressBar#isIndeterminate() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProgressBarContainerView.java From progress-bar-android with MIT License | 6 votes |
private void setColor(ProgressBar progressBar) { Drawable drawable; if (progressBar.isIndeterminate()) { drawable = progressBar.getIndeterminateDrawable(); } else { drawable = progressBar.getProgressDrawable(); } if (drawable == null) { return; } if (mColor != null) { drawable.setColorFilter(mColor, PorterDuff.Mode.SRC_IN); } else { drawable.clearColorFilter(); } }
Example 2
Source File: ProgressBarContainerView.java From react-native-GPay with MIT License | 6 votes |
private void setColor(ProgressBar progressBar) { Drawable drawable; if (progressBar.isIndeterminate()) { drawable = progressBar.getIndeterminateDrawable(); } else { drawable = progressBar.getProgressDrawable(); } if (drawable == null) { return; } if (mColor != null) { drawable.setColorFilter(mColor, PorterDuff.Mode.SRC_IN); } else { drawable.clearColorFilter(); } }
Example 3
Source File: RipperAutomation.java From AndroidRipper with GNU Affero General Public License v3.0 | 6 votes |
@Override public void waitOnThrobber() { int sleepTime = Configuration.SLEEP_ON_THROBBER; if (sleepTime==0) return; boolean flag; do { flag = false; ArrayList<ProgressBar> bars = this.robot.getCurrentProgressBars(); for (ProgressBar b: bars) { if (b.isShown() && b.isIndeterminate()) { Debug.info(this, "Waiting on Progress Bar #" + b.getId()); flag = true; this.robot.sleep(500); sleepTime-=500; } } } while (flag && (sleepTime>0)); //this.robot.sync(); }
Example 4
Source File: StatusView.java From StatusView with Apache License 2.0 | 5 votes |
private void setProgressBarColor(ProgressBar dialogProgressBar, @ColorRes int resId) { if (dialogProgressBar.isIndeterminate()) { dialogProgressBar.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor( getContext(), resId), PorterDuff.Mode.SRC_IN); } else { dialogProgressBar.getProgressDrawable().setColorFilter(ContextCompat.getColor( getContext(), resId), PorterDuff.Mode.SRC_IN); } }