当前位置: 首页>>代码示例>>Java>>正文


Java ProgressBar.setIndeterminateDrawable方法代码示例

本文整理汇总了Java中android.widget.ProgressBar.setIndeterminateDrawable方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressBar.setIndeterminateDrawable方法的具体用法?Java ProgressBar.setIndeterminateDrawable怎么用?Java ProgressBar.setIndeterminateDrawable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ProgressBar的用法示例。


在下文中一共展示了ProgressBar.setIndeterminateDrawable方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildLoadingVertical

import android.widget.ProgressBar; //导入方法依赖的package包/类
protected BuildBean buildLoadingVertical(BuildBean bean) {
    Dialog dialog = new Dialog(bean.mContext);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    bean.dialog = dialog;

    View root = View.inflate(bean.mContext, R.layout.dialogui_loading_vertical, null);
    View llBg = (View) root.findViewById(R.id.dialogui_ll_bg);
    ProgressBar pbBg = (ProgressBar) root.findViewById(R.id.pb_bg);
    TextView tvMsg = (TextView) root.findViewById(R.id.dialogui_tv_msg);
    tvMsg.setText(bean.msg);
    if (bean.isWhiteBg) {
        llBg.setBackgroundResource(R.drawable.dialogui_shape_wihte_round_corner);
        pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_rotate_mum));
        tvMsg.setTextColor(bean.mContext.getResources().getColor(R.color.text_black));
    } else {
        llBg.setBackgroundResource(R.drawable.dialogui_shape_gray_round_corner);
        pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_rotate_mum_light));
        tvMsg.setTextColor(Color.WHITE);
    }
    bean.dialog.setContentView(root);
    return bean;
}
 
开发者ID:weileng11,项目名称:KUtils-master,代码行数:23,代码来源:Buildable.java

示例2: showLoading

import android.widget.ProgressBar; //导入方法依赖的package包/类
public LoadingView showLoading(CharSequence msg, boolean cancleabl) {

        mDialog = new Dialog(mContext);// TODO: 2017/8/28 内存泄露时这里也修改为弱引用
        mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

        rootView = View.inflate(mContext, R.layout.dialogui_loading_horizontal, null);
        mLinearLayout = (LinearLayout) rootView.findViewById(R.id.dialogui_ll_bg);
        mProgressBar = (ProgressBar) rootView.findViewById(R.id.pb_bg);
        mTextView = (TextView) rootView.findViewById(R.id.dialogui_tv_msg);
        mTextView.setText(msg);
        mLinearLayout.setBackgroundResource(R.drawable.dialogui_shape_wihte_round_corner);
        mProgressBar.setIndeterminateDrawable(mContext.getResources().getDrawable(R.drawable.dialogui_shape_progress));
        mTextView.setTextColor(mContext.getResources().getColor(R.color.text_black));
        mDialog.setContentView(rootView);

        if (mDialog != null) {
            if (mDialog.isShowing()) {
                mDialog.dismiss();
            }
            mDialog.setCancelable(cancleabl);
            mDialog.setOnCancelListener(this);
            mDialog.show();
        }
        return this;
    }
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:26,代码来源:LoadingView.java

示例3: buildMdLoadingVertical

import android.widget.ProgressBar; //导入方法依赖的package包/类
protected BuildBean buildMdLoadingVertical(BuildBean bean) {
    AlertDialog.Builder builder = new AlertDialog.Builder(bean.mContext);
    View root = View.inflate(bean.mContext, R.layout.dialogui_loading_vertical, null);
    View llBg = (View) root.findViewById(R.id.dialogui_ll_bg);
    ProgressBar pbBg = (ProgressBar) root.findViewById(R.id.pb_bg);
    TextView tvMsg = (TextView) root.findViewById(R.id.dialogui_tv_msg);
    tvMsg.setText(bean.msg);
    if (bean.isWhiteBg) {
        llBg.setBackgroundResource(R.drawable.dialogui_shape_wihte_round_corner);
        pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_rotate_mum));
        tvMsg.setTextColor(bean.mContext.getResources().getColor(R.color.text_black));
    } else {
        llBg.setBackgroundResource(R.drawable.dialogui_shape_gray_round_corner);
        pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_rotate_mum_light));
        tvMsg.setTextColor(Color.WHITE);
    }
    builder.setView(root);
    AlertDialog dialog = builder.create();
    bean.alertDialog = dialog;
    return bean;
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:22,代码来源:Buildable.java

示例4: buildMdLoadingHorizontal

import android.widget.ProgressBar; //导入方法依赖的package包/类
protected BuildBean buildMdLoadingHorizontal(BuildBean bean) {
    AlertDialog.Builder builder = new AlertDialog.Builder(bean.mContext);
    View root = View.inflate(bean.mContext, R.layout.dialogui_loading_horizontal, null);
    View llBg = (View) root.findViewById(R.id.dialogui_ll_bg);
    ProgressBar pbBg = (ProgressBar) root.findViewById(R.id.pb_bg);
    TextView tvMsg = (TextView) root.findViewById(R.id.dialogui_tv_msg);
    tvMsg.setText(bean.msg);
    if (bean.isWhiteBg) {
        llBg.setBackgroundResource(R.drawable.dialogui_shape_wihte_round_corner);
        pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_shape_progress));
        tvMsg.setTextColor(bean.mContext.getResources().getColor(R.color.text_black));
    } else {
        llBg.setBackgroundResource(R.drawable.dialogui_shape_gray_round_corner);
        pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_shape_progress_light));
        tvMsg.setTextColor(Color.WHITE);
    }
    builder.setView(root);
    AlertDialog dialog = builder.create();
    bean.alertDialog = dialog;
    return bean;
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:22,代码来源:Buildable.java

示例5: buildLoadingHorizontal

import android.widget.ProgressBar; //导入方法依赖的package包/类
protected BuildBean buildLoadingHorizontal(BuildBean bean) {
    Dialog dialog = new Dialog(bean.mContext);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    bean.dialog = dialog;

    View root = View.inflate(bean.mContext, R.layout.dialogui_loading_horizontal, null);
    View llBg = (View) root.findViewById(R.id.dialogui_ll_bg);
    ProgressBar pbBg = (ProgressBar) root.findViewById(R.id.pb_bg);
    TextView tvMsg = (TextView) root.findViewById(R.id.dialogui_tv_msg);
    tvMsg.setText(bean.msg);
    if (bean.isWhiteBg) {
        llBg.setBackgroundResource(R.drawable.dialogui_shape_wihte_round_corner);
        pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_shape_progress));
        tvMsg.setTextColor(bean.mContext.getResources().getColor(R.color.text_black));
    } else {
        llBg.setBackgroundResource(R.drawable.dialogui_shape_gray_round_corner);
        pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_shape_progress_light));
        tvMsg.setTextColor(Color.WHITE);
    }
    bean.dialog.setContentView(root);
    return bean;
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:23,代码来源:Buildable.java

示例6: ChatLoadingCell

import android.widget.ProgressBar; //导入方法依赖的package包/类
public ChatLoadingCell(Context context) {
    super(context);

    frameLayout = new FrameLayout(context);
    frameLayout.setBackgroundResource(R.drawable.system_loader);
    frameLayout.getBackground().setColorFilter(Theme.colorFilter);
    addView(frameLayout, LayoutHelper.createFrame(36, 36, Gravity.CENTER));

    ProgressBar progressBar = new ProgressBar(context);
    try {
        progressBar.setIndeterminateDrawable(getResources().getDrawable(R.drawable.loading_animation));
    } catch (Exception e) {
        //don't promt
    }
    progressBar.setIndeterminate(true);
    AndroidUtilities.setProgressBarAnimationDuration(progressBar, 1500);
    frameLayout.addView(progressBar, LayoutHelper.createFrame(32, 32, Gravity.CENTER));
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:19,代码来源:ChatLoadingCell.java

示例7: PRTHeader

import android.widget.ProgressBar; //导入方法依赖的package包/类
public PRTHeader(Context context) {
	super(context);
	int[] size = ResHelper.getScreenSize(context);
	float screenWidth = size[0] < size[1] ? size[0] : size[1];
	float ratio = screenWidth / DESIGN_SCREEN_WIDTH;

	setOrientation(VERTICAL);

	LinearLayout llInner = new LinearLayout(context);
	LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	lp.gravity = Gravity.CENTER_HORIZONTAL;
	addView(llInner, lp);

	ivArrow = new RotateImageView(context);
	int resId = ResHelper.getBitmapRes(context, "ssdk_oks_ptr_ptr");
	if (resId > 0) {
		ivArrow.setImageResource(resId);
	}
	int avatarWidth = (int) (ratio * DESIGN_AVATAR_WIDTH);
	lp = new LayoutParams(avatarWidth, avatarWidth);
	lp.gravity = Gravity.CENTER_VERTICAL;
	int avataPadding = (int) (ratio * DESIGN_AVATAR_PADDING);
	lp.topMargin = lp.bottomMargin = avataPadding;
	llInner.addView(ivArrow, lp);

	pbRefreshing = new ProgressBar(context);
	resId = ResHelper.getBitmapRes(context, "ssdk_oks_classic_progressbar");
	Drawable pbdrawable = context.getResources().getDrawable(resId);
	pbRefreshing.setIndeterminateDrawable(pbdrawable);
	llInner.addView(pbRefreshing, lp);
	pbRefreshing.setVisibility(View.GONE);

	tvHeader = new TextView(getContext());
	tvHeader.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
	tvHeader.setPadding(avataPadding, 0, avataPadding, 0);
	tvHeader.setTextColor(0xff09bb07);
	lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	lp.gravity = Gravity.CENTER_VERTICAL;
	llInner.addView(tvHeader, lp);
}
 
开发者ID:gaolhjy,项目名称:cniao5,代码行数:41,代码来源:PRTHeader.java

示例8: makeAllProgressBarsIdle

import android.widget.ProgressBar; //导入方法依赖的package包/类
private static void makeAllProgressBarsIdle(View view) {
    if (view instanceof ViewGroup) {
        ViewGroup viewGroup = (ViewGroup) view;
        for (int i = 0; i < viewGroup.getChildCount(); i++) {
            makeAllProgressBarsIdle(viewGroup.getChildAt(i));
        }
    } else if (view instanceof ProgressBar) {
        ProgressBar progressBar = (ProgressBar) view;
        if (progressBar.isIndeterminate()) {
            progressBar.setIndeterminateDrawable(ContextCompat.getDrawable(InstrumentationRegistry.getTargetContext(), android.R.drawable.ic_lock_lock));
        }
    }
}
 
开发者ID:erdo,项目名称:asaf-project,代码行数:14,代码来源:ProgressBarIdler.java

示例9: PRTHeader

import android.widget.ProgressBar; //导入方法依赖的package包/类
public PRTHeader(Context context) {
	super(context);
	int[] size = R.getScreenSize(context);
	float screenWidth = size[0] < size[1] ? size[0] : size[1];
	float ratio = screenWidth / DESIGN_SCREEN_WIDTH;

	setOrientation(VERTICAL);

	LinearLayout llInner = new LinearLayout(context);
	LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	lp.gravity = Gravity.CENTER_HORIZONTAL;
	addView(llInner, lp);

	ivArrow = new RotateImageView(context);
	int resId = R.getBitmapRes(context, "ssdk_oks_ptr_ptr");
	if (resId > 0) {
		ivArrow.setImageResource(resId);
	}
	int avatarWidth = (int) (ratio * DESIGN_AVATAR_WIDTH);
	lp = new LayoutParams(avatarWidth, avatarWidth);
	lp.gravity = Gravity.CENTER_VERTICAL;
	int avataPadding = (int) (ratio * DESIGN_AVATAR_PADDING);
	lp.topMargin = lp.bottomMargin = avataPadding;
	llInner.addView(ivArrow, lp);

	pbRefreshing = new ProgressBar(context);
	resId = R.getBitmapRes(context, "ssdk_oks_classic_progressbar");
	Drawable pbdrawable = context.getResources().getDrawable(resId);
	pbRefreshing.setIndeterminateDrawable(pbdrawable);
	llInner.addView(pbRefreshing, lp);
	pbRefreshing.setVisibility(View.GONE);

	tvHeader = new TextView(getContext());
	tvHeader.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
	tvHeader.setPadding(avataPadding, 0, avataPadding, 0);
	tvHeader.setTextColor(0xff09bb07);
	lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	lp.gravity = Gravity.CENTER_VERTICAL;
	llInner.addView(tvHeader, lp);
}
 
开发者ID:Jusenr,项目名称:androidgithub,代码行数:41,代码来源:PRTHeader.java

示例10: initView

import android.widget.ProgressBar; //导入方法依赖的package包/类
private void initView(BaseViewHolder holder) {
    if (holder == null) {
        return;
    }

    holder.setText(R.id.tv_loadingFastLoadMore, mLoadingText)
            .setTextColor(R.id.tv_loadingFastLoadMore, mLoadingTextColor)
            .setText(R.id.tv_loadFailFastLoadMore, mLoadFailText)
            .setTextColor(R.id.tv_loadFailFastLoadMore, mLoadFailTextColor)
            .setText(R.id.tv_loadEndFastLoadMore, mLoadEndText)
            .setTextColor(R.id.tv_loadEndFastLoadMore, mLoadEndTextColor);
    TextView tvLoading = holder.getView(R.id.tv_loadingFastLoadMore);
    TextView tvLoadFail = holder.getView(R.id.tv_loadFailFastLoadMore);
    TextView tvLoadEnd = holder.getView(R.id.tv_loadEndFastLoadMore);
    ProgressBar pbLoading = holder.getView(R.id.pb_loadingFastLoadMore);
    tvLoading.setTextSize(TypedValue.COMPLEX_UNIT_PX, mLoadingTextSize);
    tvLoading.getPaint().setFakeBoldText(mLoadingTextFakeBold);
    tvLoadFail.setTextSize(TypedValue.COMPLEX_UNIT_PX, mLoadFailTextSize);
    tvLoadFail.getPaint().setFakeBoldText(mLoadFailTextFakeBold);
    tvLoadEnd.setTextSize(TypedValue.COMPLEX_UNIT_PX, mLoadEndTextSize);
    tvLoadEnd.getPaint().setFakeBoldText(mLoadEndTextFakeBold);
    if (mLoadingSize >= 0) {
        pbLoading.getIndeterminateDrawable().setBounds(0, 0, mLoadingSize, mLoadingSize);
        ViewGroup.LayoutParams params = pbLoading.getLayoutParams();
        params.width = mLoadingSize;
        params.height = mLoadingSize;
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        pbLoading.setIndeterminateTintList(ColorStateList.valueOf(mLoadingProgressColor));
    }
    if (mLoadingProgressDrawable != null) {
        mLoadingProgressDrawable.setBounds(pbLoading.getIndeterminateDrawable().getBounds());
        pbLoading.setIndeterminateDrawable(mLoadingProgressDrawable);
    }
}
 
开发者ID:AriesHoo,项目名称:FastLib,代码行数:36,代码来源:FastLoadMoreView.java

示例11: disableProgressBarAnimation

import android.widget.ProgressBar; //导入方法依赖的package包/类
/**
 * necessary to run tests on older API levels where progress bar uses handler loop to animate.
 *
 * @param progressBar The progress bar whose animation will be swapped with a drawable
 */
private static void disableProgressBarAnimation(ProgressBar progressBar) {
    progressBar.setIndeterminateDrawable(new ColorDrawable(Color.BLUE));
}
 
开发者ID:googlesamples,项目名称:android-architecture-components,代码行数:9,代码来源:EspressoTestUtil.java


注:本文中的android.widget.ProgressBar.setIndeterminateDrawable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。