Search in sources :

Example 11 with ProgressBar

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;
}
Also used : LayerDrawable(android.graphics.drawable.LayerDrawable) LayerDrawable(android.graphics.drawable.LayerDrawable) Drawable(android.graphics.drawable.Drawable) ProgressBar(android.widget.ProgressBar) Nullable(android.support.annotation.Nullable)

Example 12 with ProgressBar

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);
}
Also used : LVLoadingView(com.taobao.luaview.view.LVLoadingView) View(android.view.View) ProgressBar(android.widget.ProgressBar)

Example 13 with ProgressBar

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);
}
Also used : AdBlockWebViewClient(io.github.hidroh.materialistic.widget.AdBlockWebViewClient) CacheableWebView(io.github.hidroh.materialistic.widget.CacheableWebView) NestedScrollView(android.support.v4.widget.NestedScrollView) CacheableWebView(io.github.hidroh.materialistic.widget.CacheableWebView) WebView(android.webkit.WebView) ProgressBar(android.widget.ProgressBar) Toolbar(android.support.v7.widget.Toolbar)

Example 14 with ProgressBar

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);
            }
        }
    }
}
Also used : Dialog(android.app.Dialog) Activity(android.app.Activity) AbsListView(android.widget.AbsListView) View(android.view.View) AdapterView(android.widget.AdapterView) ExpandableListView(android.widget.ExpandableListView) ProgressBar(android.widget.ProgressBar)

Example 15 with ProgressBar

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;
}
Also used : FrameLayout(android.widget.FrameLayout) ProgressBar(android.widget.ProgressBar)

Aggregations

ProgressBar (android.widget.ProgressBar)184 TextView (android.widget.TextView)63 View (android.view.View)60 ImageView (android.widget.ImageView)40 LinearLayout (android.widget.LinearLayout)27 Context (android.content.Context)18 ViewGroup (android.view.ViewGroup)14 WindowManager (android.view.WindowManager)14 FrameLayout (android.widget.FrameLayout)14 Dialog (android.app.Dialog)12 Drawable (android.graphics.drawable.Drawable)12 RelativeLayout (android.widget.RelativeLayout)12 LayoutInflater (android.view.LayoutInflater)11 Button (android.widget.Button)11 LayoutParams (android.widget.LinearLayout.LayoutParams)9 Intent (android.content.Intent)8 LayoutParams (android.view.ViewGroup.LayoutParams)8 AlertDialog (android.app.AlertDialog)7 TypedArray (android.content.res.TypedArray)7 AdapterView (android.widget.AdapterView)7