use of android.widget.ProgressBar in project J2ME-Loader by nikita36078.
the class Gauge method getItemContentView.
@Override
protected View getItemContentView() {
if (pbar == null) {
if (interactive) {
pbar = new SeekBar(getOwnerForm().getParentActivity());
((SeekBar) pbar).setOnSeekBarChangeListener(listener);
} else {
pbar = new ProgressBar(getOwnerForm().getParentActivity(), null, android.R.attr.progressBarStyleHorizontal);
}
pbar.setMax(maxValue);
pbar.setProgress(value);
}
return pbar;
}
use of android.widget.ProgressBar in project Android-SpinKit by ybq.
the class Page2Fragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// ProgressBar
ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progress);
DoubleBounce doubleBounce = new DoubleBounce();
doubleBounce.setBounds(0, 0, 100, 100);
doubleBounce.setColor(colors[7]);
progressBar.setIndeterminateDrawable(doubleBounce);
// Button
Button button = (Button) view.findViewById(R.id.button);
mWaveDrawable = new Wave();
mWaveDrawable.setBounds(0, 0, 100, 100);
// noinspection deprecation
mWaveDrawable.setColor(getResources().getColor(R.color.colorAccent));
button.setCompoundDrawables(mWaveDrawable, null, null, null);
// TextView
TextView textView = (TextView) view.findViewById(R.id.text);
mCircleDrawable = new Circle();
mCircleDrawable.setBounds(0, 0, 100, 100);
mCircleDrawable.setColor(Color.WHITE);
textView.setCompoundDrawables(null, null, mCircleDrawable, null);
textView.setBackgroundColor(colors[2]);
// ImageView
ImageView imageView = (ImageView) view.findViewById(R.id.image);
mChasingDotsDrawable = new ChasingDots();
mChasingDotsDrawable.setColor(Color.WHITE);
imageView.setImageDrawable(mChasingDotsDrawable);
imageView.setBackgroundColor(colors[0]);
}
use of android.widget.ProgressBar in project Shuttle by timusus.
the class ChangelogDialog method getChangelogDialog.
public static MaterialDialog getChangelogDialog(Context context) {
@SuppressLint("InflateParams") View customView = LayoutInflater.from(context).inflate(R.layout.dialog_changelog, null);
WebView webView = customView.findViewById(R.id.webView);
webView.setBackgroundColor(ContextCompat.getColor(context, android.R.color.transparent));
CheckBox checkBox = customView.findViewById(R.id.checkbox);
checkBox.setChecked(SettingsManager.getInstance().getShowChangelogOnLaunch());
checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> SettingsManager.getInstance().setShowChangelogOnLaunch(isChecked));
ProgressBar progressBar = customView.findViewById(R.id.progress);
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
ViewUtils.fadeOut(progressBar, () -> ViewUtils.fadeIn(webView, null));
}
});
Aesthetic.get(context).isDark().take(1).subscribe(isDark -> webView.loadUrl(isDark ? "file:///android_asset/web/info_dark.html" : "file:///android_asset/web/info.html"));
return DialogUtils.getBuilder(context).title(R.string.pref_title_changelog).customView(customView, false).negativeText(R.string.close).build();
}
use of android.widget.ProgressBar in project Shuttle by timusus.
the class TintHelper method setTintAuto.
@SuppressWarnings("deprecation")
@SuppressLint("PrivateResource")
static void setTintAuto(@NonNull final View view, @ColorInt final int color, boolean background, final boolean isDark) {
if (!background) {
if (view instanceof RadioButton) {
setTint((RadioButton) view, color, isDark);
} else if (view instanceof SeekBar) {
setTint((SeekBar) view, color, isDark);
} else if (view instanceof ProgressBar) {
setTint((ProgressBar) view, color);
} else if (view instanceof EditText) {
setTint((EditText) view, color, isDark);
} else if (view instanceof CheckBox) {
setTint((CheckBox) view, color, isDark);
} else if (view instanceof ImageView) {
setTint((ImageView) view, color);
} else if (view instanceof Switch) {
setTint((Switch) view, color, isDark);
} else if (view instanceof SwitchCompat) {
setTint((SwitchCompat) view, color, isDark);
} else {
background = true;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && !background && view.getBackground() instanceof RippleDrawable) {
// Ripples for the above views (e.g. when you tap and hold a switch or checkbox)
RippleDrawable rd = (RippleDrawable) view.getBackground();
final int unchecked = ContextCompat.getColor(view.getContext(), isDark ? R.color.ripple_material_dark : R.color.ripple_material_light);
final int checked = Util.adjustAlpha(color, 0.4f);
final ColorStateList sl = new ColorStateList(new int[][] { new int[] { -android.R.attr.state_activated, -android.R.attr.state_checked }, new int[] { android.R.attr.state_activated }, new int[] { android.R.attr.state_checked } }, new int[] { unchecked, checked, checked });
rd.setColor(sl);
}
}
if (background) {
// Need to tint the background of a view
if (view instanceof FloatingActionButton || view instanceof Button) {
setTintSelector(view, color, false, isDark);
} else if (view.getBackground() != null) {
Drawable drawable = view.getBackground();
if (drawable != null) {
if (view instanceof TextInputEditText) {
drawable.setColorFilter(color, PorterDuff.Mode.SRC_IN);
} else {
drawable = createTintedDrawable(drawable, color);
Util.setBackgroundCompat(view, drawable);
}
}
}
}
}
use of android.widget.ProgressBar in project DevRing by LJYcoder.
the class LoadMoreBaseAdapter method bindDataForView.
@Override
protected void bindDataForView(ViewHolder holder, T t, int position) {
if (holder.getItemViewType() == TYPE_FOOTER) {
ProgressBar pbLoading = holder.getView(R.id.pb_loading);
TextView tvLoading = holder.getView(R.id.tv_loading);
LinearLayout llEnd = holder.getView(R.id.ll_end);
switch(loadState) {
case // 正在加载
LOADING:
pbLoading.setVisibility(View.VISIBLE);
tvLoading.setVisibility(View.VISIBLE);
llEnd.setVisibility(View.GONE);
break;
case // 加载完成
LOADING_COMPLETE:
pbLoading.setVisibility(View.INVISIBLE);
tvLoading.setVisibility(View.INVISIBLE);
llEnd.setVisibility(View.GONE);
break;
case // 加载到底
LOADING_END:
pbLoading.setVisibility(View.GONE);
tvLoading.setVisibility(View.GONE);
llEnd.setVisibility(View.VISIBLE);
break;
default:
break;
}
} else {
bindDataForView_(holder, t, position);
}
}
Aggregations