Search in sources :

Example 91 with ProgressBar

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

Example 92 with ProgressBar

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]);
}
Also used : Wave(com.github.ybq.android.spinkit.style.Wave) ChasingDots(com.github.ybq.android.spinkit.style.ChasingDots) Circle(com.github.ybq.android.spinkit.style.Circle) Button(android.widget.Button) DoubleBounce(com.github.ybq.android.spinkit.style.DoubleBounce) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ProgressBar(android.widget.ProgressBar)

Example 93 with ProgressBar

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();
}
Also used : CheckBox(android.widget.CheckBox) SuppressLint(android.annotation.SuppressLint) WebView(android.webkit.WebView) View(android.view.View) WebView(android.webkit.WebView) ProgressBar(android.widget.ProgressBar) WebViewClient(android.webkit.WebViewClient)

Example 94 with ProgressBar

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);
                }
            }
        }
    }
}
Also used : TextInputEditText(android.support.design.widget.TextInputEditText) EditText(android.widget.EditText) SeekBar(android.widget.SeekBar) Drawable(android.graphics.drawable.Drawable) RippleDrawable(android.graphics.drawable.RippleDrawable) ColorStateList(android.content.res.ColorStateList) RadioButton(android.widget.RadioButton) SuppressLint(android.annotation.SuppressLint) RippleDrawable(android.graphics.drawable.RippleDrawable) Switch(android.widget.Switch) RadioButton(android.widget.RadioButton) Button(android.widget.Button) FloatingActionButton(android.support.design.widget.FloatingActionButton) CheckBox(android.widget.CheckBox) FloatingActionButton(android.support.design.widget.FloatingActionButton) TextInputEditText(android.support.design.widget.TextInputEditText) ImageView(android.widget.ImageView) ProgressBar(android.widget.ProgressBar) SwitchCompat(android.support.v7.widget.SwitchCompat) SuppressLint(android.annotation.SuppressLint)

Example 95 with ProgressBar

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

Aggregations

ProgressBar (android.widget.ProgressBar)193 TextView (android.widget.TextView)66 View (android.view.View)63 ImageView (android.widget.ImageView)41 LinearLayout (android.widget.LinearLayout)30 Context (android.content.Context)18 ViewGroup (android.view.ViewGroup)16 WindowManager (android.view.WindowManager)14 FrameLayout (android.widget.FrameLayout)14 Drawable (android.graphics.drawable.Drawable)13 Dialog (android.app.Dialog)12 Button (android.widget.Button)12 RelativeLayout (android.widget.RelativeLayout)12 LayoutInflater (android.view.LayoutInflater)11 SuppressLint (android.annotation.SuppressLint)10 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