本文整理匯總了Java中android.widget.ProgressBar.getLayoutParams方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressBar.getLayoutParams方法的具體用法?Java ProgressBar.getLayoutParams怎麽用?Java ProgressBar.getLayoutParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.getLayoutParams方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
}