本文整理汇总了Java中android.widget.ProgressBar.setIndeterminate方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressBar.setIndeterminate方法的具体用法?Java ProgressBar.setIndeterminate怎么用?Java ProgressBar.setIndeterminate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.setIndeterminate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateOptionsMenu
import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.device_list_activity_menu, menu);
if (!btScanner.isScanning()) {
menu.findItem(R.id.menu_stop).setVisible(false);
menu.findItem(R.id.menu_scan).setVisible(true);
menu.findItem(R.id.menu_refresh).setActionView(null);
} else {
menu.findItem(R.id.menu_stop).setVisible(true);
menu.findItem(R.id.menu_scan).setVisible(false);
View indicatorLayout = getLayoutInflater().inflate(R.layout.actionbar_indeterminate_progress, null);
ProgressBar indicator = indicatorLayout.findViewById(R.id.loading_indicator);
indicator.setVisibility(View.VISIBLE);
indicator.setIndeterminate(true);
indicator.getIndeterminateDrawable().setColorFilter(0xFF323232, PorterDuff.Mode.MULTIPLY);
menu.findItem(R.id.menu_refresh).setActionView(indicatorLayout);
}
return true;
}
示例2: onCreate
import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.account_setup_check_settings);
mMessageView = (TextView)findViewById(R.id.message);
mProgressBar = (ProgressBar)findViewById(R.id.progress);
findViewById(R.id.cancel).setOnClickListener(this);
setMessage(R.string.account_setup_check_settings_retr_info_msg);
mProgressBar.setIndeterminate(true);
String accountUuid = getIntent().getStringExtra(EXTRA_ACCOUNT);
mAccount = Preferences.getPreferences(this).getAccount(accountUuid);
mDirection = (CheckDirection) getIntent().getSerializableExtra(EXTRA_CHECK_DIRECTION);
new CheckAccountTask(mAccount).execute(mDirection);
}
示例3: onCreate
import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
progressBar = (ProgressBar) findViewById(R.id.progress_bar);
editText = (EditText) findViewById((R.id.edittext_query));
progressBar.setIndeterminate(true);
progressBar.setVisibility(View.VISIBLE);
recyclerView.setLayoutManager(new LinearLayoutManager(MainActivity.this));
recyclerView.addItemDecoration(new DividerItemDecoration(MainActivity.this,
DividerItemDecoration.VERTICAL));
apiService = ApiClient.getClient().create(ApiInterface.class);
}
示例4: 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));
}
示例5: onCreateView
import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View bodyView = inflater.inflate(R.layout.fragment_home, container, false);
scanProgressbar = (ProgressBar) bodyView.findViewById(R.id.scan_progressbar);
scanProgressbar.setIndeterminate(true);
scanProgressbar.setVisibility(GONE);
pandwarfConnectedTextView = (TextView) bodyView.findViewById(R.id.pandwarf_connected_text_view);
listView = (ListView) bodyView.findViewById(R.id.pandwarf_list_view);
listView.setAdapter(new ListAdapterCustom(getContext(), 0, new ArrayList<ExtendedBluetoothDevice>()));
scanIsRunning = new AtomicBoolean(false);
connexionInProgress = new AtomicBoolean(false);
connectionButton = (Button) bodyView.findViewById(R.id.connection_button);
resetFragment();
return bodyView;
}
示例6: onFinishInflate
import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
protected void onFinishInflate() {
super.onFinishInflate();
// 事先保存子控件显示状态,并隐藏所有子控件
for (int i = 0; i < getChildCount(); i++) {
mVisibilityMap.put(getChildAt(i), getChildAt(i).getVisibility());
if (!mAutoLoadingDebug) {
getChildAt(i).setVisibility(GONE);
}
}
mLoadingBar = new ProgressBar(getContext());
mLoadingBar.setIndeterminate(true);
if (mProgressDrawable != null) {
mLoadingBar.setProgressDrawable(mProgressDrawable);
}
LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.CENTER;
addView(mLoadingBar, params);
if (!mAutoLoadingDebug) {
showLoading();
}
}
示例7: onCreate
import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chain_explorer);
blocksList = findViewById(R.id.blocks_list);
// Create a progress bar to display while the list loads
ProgressBar progressBar = new ProgressBar(this);
progressBar.setLayoutParams(new LinearLayout.LayoutParams(GridLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT, CENTER));
progressBar.setIndeterminate(true);
blocksList.setEmptyView(progressBar);
// Must add the progress bar to the root of the layout
ViewGroup root = findViewById(android.R.id.content);
root.addView(progressBar);
init();
}
示例8: UploadView
import android.widget.ProgressBar; //导入方法依赖的package包/类
public UploadView(Context context, String uploadId, Bitmap bm, String title, String statusText, String pText, int progress) {
super(context);
idView = new TextView(context);
idView.setVisibility(View.GONE);
idView.setText(uploadId + "");
imageView = new ImageView(context);
imageView.setImageBitmap(bm);
imageView.setBackgroundColor(0xFF666666);
imageView.setId(VIDEOIMAGE_ID);
titleView = new TextView(context);
titleView.setText(title);
titleView.setTextColor(0xFF000000);
titleView.setId(TITLEVIEW_ID);
titleView.setPaddingRelative(5, 5, 0, 0);
statusTextView = new TextView(context);
statusTextView.setText(statusText);
statusTextView.setTextColor(0xFF000000);
statusTextView.setId(STATUSVIEW_ID);
statusTextView.setPaddingRelative(5, 5, 0, 0);
statusTextView.setTextColor(Color.GRAY);
progressTextView = new TextView(context);
progressTextView.setText(pText);
progressTextView.setTextColor(0xFF000000);
progressTextView.setId(PROGRESSTEXT_ID);
progressTextView.setPaddingRelative(5, 5, 0, 0);
progressTextView.setTextColor(Color.GRAY);
progressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal);
progressBar.setMax(100);
progressBar.setIndeterminate(false);
progressBar.setProgressDrawable(getResources().getDrawable(R.drawable.progressbar));
progressBar.setId(PROGRESSBAR_ID);
progressBar.setPaddingRelative(5, 0, 0, 0);
progressBar.setProgress(progress);
/**
*
* + + + + title
* + img + 0M / 0M
* + + 下载中
* + + + + ********progress**************
*
* */
//左侧
LayoutParams imageLayoutParams = new LayoutParams(ParamsUtil.dpToPx(context, 75), ParamsUtil.dpToPx(context, 75));
imageLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
//位于图片右侧
LayoutParams titleLayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
titleLayoutParams.addRule(RelativeLayout.RIGHT_OF, VIDEOIMAGE_ID);
//位于标题下方
LayoutParams statusLayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
statusLayoutParams.addRule(RelativeLayout.BELOW, TITLEVIEW_ID);
statusLayoutParams.addRule(RelativeLayout.RIGHT_OF, VIDEOIMAGE_ID);
//位于状态下方
LayoutParams progressTextParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
progressTextParams.addRule(RelativeLayout.BELOW, STATUSVIEW_ID);
progressTextParams.addRule(RelativeLayout.RIGHT_OF, VIDEOIMAGE_ID);
//位于图片左侧,进度文本下方
LayoutParams progressBarLayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, ParamsUtil.dpToPx(context, 7));
progressBarLayoutParams.addRule(RelativeLayout.RIGHT_OF, VIDEOIMAGE_ID);
progressBarLayoutParams.addRule(RelativeLayout.BELOW, PROGRESSTEXT_ID);
progressBarLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
addView(imageView, imageLayoutParams);
addView(titleView, titleLayoutParams);
addView(statusTextView, statusLayoutParams);
addView(progressTextView, progressTextParams);
addView(progressBar, progressBarLayoutParams);
setPadding(5, 5, 5, 5);
}
示例9: addDownloadProgress
import android.widget.ProgressBar; //导入方法依赖的package包/类
private void addDownloadProgress() {
LinearLayout ll = new LinearLayout(context);
ll.setOrientation(LinearLayout.VERTICAL);
progressBar = (ProgressBar) LayoutInflater.from(context)
.inflate(R.layout.download_progress_bar, this, false);
progressBar.setIndeterminate(true);
progressBar.setVisibility(View.VISIBLE);
ll.addView(progressBar, LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
progressText = new TextView(context);
progressText.setTextColor(Color.WHITE);
progressText.setGravity(Gravity.CENTER_VERTICAL);
progressText.setTextSize(TypedValue.COMPLEX_UNIT_PX, textFontSize);
progressText.setText(R.string.downloading_title);
ll.addView(progressText, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
LinearLayout.LayoutParams lp =
new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT);
lp.weight = 1;
lp.setMargins(separatorSpacing, 0, separatorSpacing, 0);
if (isRtl) {
lp.leftMargin = spinnerPadding;
} else {
lp.rightMargin = spinnerPadding;
}
addView(ll, lp);
}
示例10: DProgressBar
import android.widget.ProgressBar; //导入方法依赖的package包/类
public static ProgressBar DProgressBar(Context context) {
ViewGroup layout = (ViewGroup) ((Activity) context).findViewById(android.R.id.content).getRootView();
ProgressBar mProgressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleLarge);
mProgressBar.setIndeterminate(true);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
RelativeLayout rl = new RelativeLayout(context);
rl.setGravity(Gravity.CENTER);
rl.addView(mProgressBar);
layout.addView(rl, params);
return mProgressBar;
}
示例11: onCreateView
import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_loading, container, false);
FrameLayout loadingContainer = (FrameLayout) view.findViewById(R.id.fragment_loading_container);
loadingContainer.setBackgroundColor(backgroundColor);
progressBar = new ProgressBar(container.getContext());
if (container instanceof FrameLayout) {
FrameLayout.LayoutParams layoutParams =
new FrameLayout.LayoutParams(progressWidth, progressHeight, Gravity.CENTER);
progressBar.setLayoutParams(layoutParams);
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
if (progressBar.getIndeterminateDrawable() != null) {
progressBar.getIndeterminateDrawable().setColorFilter(getResources().getColor(progressColor),
PorterDuff.Mode.SRC_IN);
}
} else {
ColorStateList stateList = ColorStateList.valueOf(progressColor);
progressBar.setIndeterminateTintMode(PorterDuff.Mode.SRC_IN);
progressBar.setIndeterminateTintList(stateList);
progressBar.setProgressBackgroundTintMode(PorterDuff.Mode.SRC_IN);
progressBar.setProgressBackgroundTintList(stateList);
progressBar.setIndeterminate(true);
}
loadingContainer.addView(progressBar);
return view;
}
示例12: LoadingDialog
import android.widget.ProgressBar; //导入方法依赖的package包/类
public static void LoadingDialog(Context context, int title, DialogInterface.OnClickListener cancelListener) {
ProgressBar progressBar = new ProgressBar(context);
progressBar.setIndeterminate(true);
AlertDialog.Builder builder = new AlertDialog.Builder(context)
.setTitle(title)
.setView(progressBar);
if (cancelListener != null) {
builder.setNegativeButton(R.string.cancel, cancelListener);
}
builder.show();
}
示例13: showDownload
import android.widget.ProgressBar; //导入方法依赖的package包/类
private void showDownload(int position) {
VideoDownLoadInfo item = data.get(position);
item.setDownLoading(true);
adapter.setDownPosition(position);
ProgressBar seekBar = (ProgressBar) adapter.getViewByPosition(position, R.id.sb_progress);
TextView size = (TextView) adapter.getViewByPosition(position, R.id.tv_pause);
size.setText(StringUtils.getPrintSize(item.getCurrentBytes() == null ? 0 : item.getCurrentBytes(), false) + "/" + StringUtils.getPrintSize(item.getContentLength() == null ? 0 : item.getContentLength(), true));
seekBar.setVisibility(View.VISIBLE);
seekBar.setIndeterminate(false);
seekBar.setProgress(data.get(position).getPercent());
}
示例14: setResume
import android.widget.ProgressBar; //导入方法依赖的package包/类
public void setResume(boolean display, int max, int resumePosition, ProgressBar resume){
if (display) {
resume.setMax(max);
resume.setProgress(resumePosition == PlayerActivity.LAST_POSITION_END ? max : resumePosition);
resume.setIndeterminate(false);
resume.setVisibility(View.VISIBLE);
} else { //no progress slider for resume, but simple label icon instead
resume.setVisibility(View.GONE);
}
}
示例15: initView
import android.widget.ProgressBar; //导入方法依赖的package包/类
private void initView() {
if (isInEditMode())
return;
mProgressBar = new ProgressBar(getContext(), null, android.R.attr.progressBarStyleHorizontal);
mProgressBar.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, PROGRESS_HEIGHT));
mProgressBar.setProgressDrawable(ContextCompat.getDrawable(getContext(), R.drawable.webview_progress_drawable));
mProgressBar.setIndeterminate(false);
mProgressBar.setProgress(0);
addView(mProgressBar);
}