use of android.widget.ProgressBar in project remusic by aa112901.
the class AppCompatProgressBarHelper method getTintTarget.
@Nullable
private Drawable getTintTarget(int layerId, boolean shouldFallback) {
Drawable layer = null;
final Drawable d = ((ProgressBar) mView).getProgressDrawable();
if (d != null) {
((ProgressBar) mView).setProgressDrawable(d.mutate());
if (d instanceof LayerDrawable) {
layer = ((LayerDrawable) d).findDrawableByLayerId(layerId);
}
if (shouldFallback && layer == null) {
layer = d;
}
}
return layer;
}
use of android.widget.ProgressBar in project LuaViewSDK by alibaba.
the class CustomLoading method initPanel.
@Override
public void initPanel() {
final View lvLoadingView = new ProgressBar(getContext(), null, android.R.attr.progressBarStyleSmallInverse);
LayoutParams relativeLayout = LuaViewUtil.createRelativeLayoutParamsWW();
relativeLayout.addRule(RelativeLayout.CENTER_IN_PARENT);
lvLoadingView.setVisibility(View.VISIBLE);
addView(lvLoadingView, relativeLayout);
}
use of android.widget.ProgressBar in project materialistic by hidroh.
the class OfflineWebActivity method onCreate.
@SuppressWarnings("ConstantConditions")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String url = getIntent().getStringExtra(EXTRA_URL);
if (TextUtils.isEmpty(url)) {
finish();
return;
}
setTitle(url);
setContentView(R.layout.activity_offline_web);
final NestedScrollView scrollView = (NestedScrollView) findViewById(R.id.nested_scroll_view);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setOnClickListener(v -> scrollView.smoothScrollTo(0, 0));
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE);
getSupportActionBar().setSubtitle(R.string.offline);
final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progress);
final WebView webView = (WebView) findViewById(R.id.web_view);
webView.setBackgroundColor(Color.TRANSPARENT);
webView.setWebViewClient(new AdBlockWebViewClient(Preferences.adBlockEnabled(this)) {
@Override
public void onPageFinished(WebView view, String url) {
setTitle(view.getTitle());
}
});
webView.setWebChromeClient(new CacheableWebView.ArchiveClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
progressBar.setVisibility(View.VISIBLE);
progressBar.setProgress(newProgress);
if (newProgress == 100) {
progressBar.setVisibility(View.GONE);
webView.setBackgroundColor(Color.WHITE);
webView.setVisibility(View.VISIBLE);
}
}
});
AppUtils.toggleWebViewZoom(webView.getSettings(), true);
webView.loadUrl(url);
}
use of android.widget.ProgressBar in project SmartAndroidSource by jaychou2012.
the class Common method showProgress.
public static void showProgress(Object p, String url, boolean show) {
if (p != null) {
if (p instanceof View) {
View pv = (View) p;
ProgressBar pbar = null;
if (p instanceof ProgressBar) {
pbar = (ProgressBar) p;
}
if (show) {
pv.setTag(AQuery.TAG_URL, url);
pv.setVisibility(View.VISIBLE);
if (pbar != null) {
pbar.setProgress(0);
pbar.setMax(100);
}
} else {
Object tag = pv.getTag(AQuery.TAG_URL);
if (tag == null || tag.equals(url)) {
pv.setTag(AQuery.TAG_URL, null);
if (pbar == null || pbar.isIndeterminate()) {
pv.setVisibility(View.GONE);
}
}
}
} else if (p instanceof Dialog) {
Dialog pd = (Dialog) p;
AQuery aq = new AQuery(pd.getContext());
if (show) {
aq.show(pd);
} else {
aq.dismiss(pd);
}
} else if (p instanceof Activity) {
Activity act = (Activity) p;
;
act.setProgressBarIndeterminateVisibility(show);
act.setProgressBarVisibility(show);
if (show) {
act.setProgress(0);
}
}
}
}
use of android.widget.ProgressBar in project FastDev4Android by jiangqqlmj.
the class BaseQuickAdapter method createIndeterminateProgressView.
/**
* 创建进度条 显示在view的结尾
* @param convertView
* @param parent
* @return
*/
private View createIndeterminateProgressView(View convertView, ViewGroup parent) {
if (convertView == null) {
FrameLayout container = new FrameLayout(context);
container.setForegroundGravity(Gravity.CENTER);
ProgressBar progress = new ProgressBar(context);
container.addView(progress);
convertView = container;
}
return convertView;
}
Aggregations