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


Java ProgressBar类代码示例

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


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

示例1: onCreate

import android.widget.ProgressBar; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);

    getSupportActionBar().setTitle(getString(R.string.about));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    progressBar = (ProgressBar) findViewById(R.id.progress);
    progressBar.getIndeterminateDrawable()
            .setColorFilter(ContextCompat.getColor(this, R.color.colorPrimary), PorterDuff.Mode.SRC_IN);
    info_web = (WebView) findViewById(R.id.webview_company_info);
    info_web.setBackgroundColor(Color.TRANSPARENT);
    info_web.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    info_web.setWebViewClient(new myWebClient());
    info_web.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
    info_web.getSettings().setJavaScriptEnabled(true);
    info_web.getSettings().setDefaultFontSize((int) getResources().getDimension(R.dimen.about_text_size));

    String infoText = getString(R.string.company_info_web);
    info_web.loadDataWithBaseURL("file:///android_asset/fonts/", getWebViewText(infoText), "text/html", "utf-8", null);

}
 
开发者ID:fekracomputers,项目名称:MuslimMateAndroid,代码行数:24,代码来源:AboutActivity.java

示例2: onCreate

import android.widget.ProgressBar; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    SharedPref pref= new SharedPref(this);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_event);
    Toolbar toolbar= (Toolbar) findViewById(R.id.my_toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    progressBar= (ProgressBar) findViewById(R.id.progress);
    adapter=new ClubEventAdapter(this);
    recyclerView.setAdapter(adapter);
    recyclerView.setLayoutManager(new GridLayoutManager(this,2));
    recyclerView.addOnItemTouchListener(new RecyclerItemClickListener(this, new RecyclerItemClickListener.OnItemClickListener() {
        @Override
        public void onItemClick(View view, int position) {
            Intent i=new Intent(EventActivity.this,ClubActivity.class);
            i.putExtra(CLUB_ID,list.get(position).getId());
            startActivity(i);
        }
    }));
    showData();
}
 
开发者ID:appteam-nith,项目名称:Hillffair17,代码行数:24,代码来源:EventActivity.java

示例3: initView

import android.widget.ProgressBar; //导入依赖的package包/类
private void initView() {
    mAdapter = new ImagesAdapter(getSupportFragmentManager());
    mOkBtn = (Button) findViewById(R.id.image_items_ok);
    mGallery = (HackyViewPager) findViewById(R.id.pager);
    mProgressBar = (ProgressBar) findViewById(R.id.loading);
    mGallery.setAdapter(mAdapter);
    mGallery.addOnPageChangeListener(new OnPagerChangeListener());
    if (!mNeedEdit) {
        View chooseLayout = findViewById(R.id.item_choose_layout);
        chooseLayout.setVisibility(View.GONE);
    } else {
        setOkTextNumber();
        mOkBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finishByBackPressed(false);
            }
        });
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:BoxingViewActivity.java

示例4: initView

import android.widget.ProgressBar; //导入依赖的package包/类
private void initView() {
    this.mCapacityRoot = findViewById(2131361935);
    this.mCapacityTextView = (TextView) findViewById(2131361937);
    this.mCapacityPBar = (ProgressBar) findViewById(2131361936);
    this.mTipLayout = findViewById(R.id.download_vip_layout);
    this.mVipTipTV = (TextView) findViewById(R.id.download_vip_tip);
    this.mOpenVipTV = (TextView) findViewById(R.id.download_open_vip_btn);
    this.mOpenVipTV.setOnClickListener(new OnClickListener(this) {
        final /* synthetic */ MyDownloadActivity this$0;

        {
            if (HotFix.PREVENT_VERIFY) {
                System.out.println(VerifyLoad.class);
            }
            this.this$0 = this$0;
        }

        public void onClick(View v) {
            LetvVipActivity.launch(this.this$0.mContext, this.this$0.mContext.getResources().getString(2131100645));
            StatisticsUtils.statisticsActionInfo(this.this$0.mContext, PageIdConstant.downloadingPage, "0", "vp13", "开通会员", 1, PreferencesManager.getInstance().isVip() ? "vip=1" : "vip=0");
        }
    });
    initNavigationBar();
    initViewPager();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:26,代码来源:MyDownloadActivity.java

示例5: CustomViewHolder

import android.widget.ProgressBar; //导入依赖的package包/类
public CustomViewHolder(View itemView) {
    super(itemView);
    this.coloredCircle = (CircleImageView) itemView.findViewById(R.id.imv_list_item_circle);
    this.dateAndTime = (TextView) itemView.findViewById(R.id.lbl_date_and_time);
    this.message = (TextView) itemView.findViewById(R.id.lbl_message);
    this.loading = (ProgressBar) itemView.findViewById(R.id.pro_item_data);

    this.container = (ViewGroup) itemView.findViewById(R.id.root_list_item);
    /*
    We can pass "this" as an Argument, because "this", which refers to the Current
    Instance of type CustomViewHolder currently conforms to (implements) the
    View.OnClickListener interface. I have a Video on my channel which goes into
    Interfaces with Detailed Examples.

    Search "Android WTF: Java Interfaces by Example"
     */
    this.container.setOnClickListener(this);
}
 
开发者ID:BracketCove,项目名称:RoomDemo2017,代码行数:19,代码来源:ListFragment.java

示例6: onUpgrading

import android.widget.ProgressBar; //导入依赖的package包/类
private void onUpgrading( final int total, final int progress )
{
    if(!isShowing() || isDisconnect)
        return;
    activity.runOnUiThread( new Runnable()
    {
        @Override
        public void run ()
        {
            int percent = progress*100/total;
            if(percent > 100)
                percent = 100;
            ((TextView)fw_loading_layout.findViewById( R.id.fw_loading_text )).setText( "Sending Fw to Pen.. ");
            ((TextView)fw_loading_layout.findViewById( R.id.fw_loading_progress_text )).setText( percent+"%");

            ((ProgressBar)fw_loading_layout.findViewById( R.id.fw_loading_progressbar )).setProgress( percent );
            ((ProgressBar)fw_loading_layout.findViewById( R.id.fw_loading_progressbar )).setIndeterminate( false );
            mBuilder.setContentText( "Sending" ).setProgress( total, progress, false );
            mNotifyManager.notify( 0, mBuilder.build() );

        }
    } );

}
 
开发者ID:NeoSmartpen,项目名称:AndroidSDK2.0,代码行数:25,代码来源:FwUpdateDialog.java

示例7: ImageMessageHolder

import android.widget.ProgressBar; //导入依赖的package包/类
public ImageMessageHolder(Context context, View convertView){
    super(context,convertView);
    isGif = (TextView) convertView.findViewById(ResourceUtils
            .getIdByName(context, "id", "sobot_pic_isgif"));
    image = (ImageView) convertView.findViewById(ResourceUtils
            .getIdByName(context, "id", "sobot_iv_picture"));

    pic_send_status = (ImageView) convertView
            .findViewById(ResourceUtils.getIdByName(context, "id",
                    "sobot_pic_send_status"));
    pic_progress = (ProgressBar) convertView
            .findViewById(ResourceUtils.getIdByName(context, "id",
                    "sobot_pic_progress"));
    sobot_pic_progress_round = (RoundProgressBar) convertView.findViewById(ResourceUtils.getIdByName(context, "id",
            "sobot_pic_progress_round"));

    sobot_pic_progress_rl = (RelativeLayout) convertView.findViewById(ResourceUtils.getIdByName(context, "id", "sobot_pic_progress_rl"));
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:19,代码来源:ImageMessageHolder.java

示例8: initView

import android.widget.ProgressBar; //导入依赖的package包/类
@Override
public void initView() {
        mFloatingActionsMenu = (FloatingActionsMenu) findViewById(R.id.fam_wei_xin_news_menu);
        browser = (FloatingActionButton) findViewById(R.id.fab_wei_xin_news_browser);
        share = (FloatingActionButton) findViewById(R.id.fab_wei_xin_news_share);
        display = (WebView) findViewById(R.id.wv_wei_xin_news_display);
        mProgressBar = (ProgressBar) findViewById(R.id.pb_wei_xin_news_load);
        findViewById(R.id.rl_wei_xin_news_container).setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View v, MotionEvent event) {
                        if (mFloatingActionsMenu.isExpanded()) {
                                mFloatingActionsMenu.collapse();
                                return true;
                        } else {
                                return false;
                        }
                }
        });
        browser.setOnClickListener(this);
        share.setOnClickListener(this);
}
 
开发者ID:HelloChenJinJun,项目名称:TestChat,代码行数:22,代码来源:WeiXinNewsActivity.java

示例9: Holder

import android.widget.ProgressBar; //导入依赖的package包/类
Holder(int adapterPosition, View rootView) {
    super(adapterPosition, rootView);
    FlingRelativeLayout flingRelativeLayout = (FlingRelativeLayout) rootView.findViewById(R.id.fling_root_view);
    flingRelativeLayout.setOnClickListener(v -> toggleFullscreen());
    flingRelativeLayout.setOnSingleFlingListener(new CloseOnFlingListener(rootView.getContext()) {
        @Override
        public boolean onVerticalFling(float distanceByY) {
            goBack();
            return true;
        }
    });

    mSurfaceView = (SurfaceView) rootView.findViewById(R.id.surface_view);
    mSurfaceHolder = mSurfaceView.getHolder();
    mSurfaceHolder.addCallback(this);

    mAspectRatioLayout = (AlternativeAspectRatioFrameLayout) rootView.findViewById(R.id.aspect_ratio_layout);
    mProgressBar = (ProgressBar) rootView.findViewById(R.id.preparing_progress_bar);
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:20,代码来源:GifPagerFragment.java

示例10: onCreate

import android.widget.ProgressBar; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_user);
    SubjectListView = (ListView) findViewById(R.id.listview1);

    progressBarSubject = (ProgressBar) findViewById(R.id.progressBar);

    new GetHttpResponse(user.this).execute();


    trendingBtm = (ImageButton) findViewById(R.id.imageBtmtrending);
    userBtm = (ImageButton) findViewById(R.id.imageBtmuser);
    locationBtm = (ImageButton) findViewById(R.id.imageBtmlocation);
    settingsBtm = (ImageButton) findViewById(R.id.imageBtmSettings);
    addReviewBtm = (FloatingActionButton) findViewById(R.id.addReview);
    trendingBtm.setOnClickListener(btTrending);
    userBtm.setOnClickListener(btUser);
    locationBtm.setOnClickListener(btlocation);
    settingsBtm.setOnClickListener(btSettings);
    addReviewBtm.setOnClickListener(btAdd);
    userid = Users.userID;



}
 
开发者ID:cdc03819,项目名称:BrewBook,代码行数:27,代码来源:user.java

示例11: initView

import android.widget.ProgressBar; //导入依赖的package包/类
private void initView(Context context) {
    View.inflate(context, R.layout.dialog_loading_tip, this);
    img_tip_logo = (ImageView) findViewById(R.id.img_tip_logo);
    progress = (ProgressBar) findViewById(R.id.progress);
    tv_tips = (TextView) findViewById(R.id.tv_tips);
    bt_operate = (Button) findViewById(R.id.bt_operate);
    //重新尝试
    bt_operate.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            if(onReloadListener!=null){
                onReloadListener.reload();
            }
        }
    });
    setVisibility(View.GONE);
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:18,代码来源:LoadingTip.java

示例12: showPostPrepareUI

import android.widget.ProgressBar; //导入依赖的package包/类
private void showPostPrepareUI() {
    ProgressBar pb = (ProgressBar) findViewById(R.id.spinner);
    pb.setVisibility(View.GONE);
    mDuration = mPlayer.getDuration();
    if (mDuration != 0) {
        mSeekBar.setMax(mDuration);
        mSeekBar.setVisibility(View.VISIBLE);
    }
    mSeekBar.setOnSeekBarChangeListener(mSeekListener);
    mLoadingText.setVisibility(View.GONE);
    View v = findViewById(R.id.titleandbuttons);
    v.setVisibility(View.VISIBLE);
    mAudioManager.requestAudioFocus(mAudioFocusListener, AudioManager.STREAM_MUSIC,
            AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
    mProgressRefresher.postDelayed(new ProgressRefresher(), 200);
    updatePlayPause();
}
 
开发者ID:89luca89,项目名称:ThunderMusic,代码行数:18,代码来源:AudioPreview.java

示例13: 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;
}
 
开发者ID:Make-A-Pede,项目名称:Make-A-Pede-Android-App,代码行数:24,代码来源:DeviceListActivity.java

示例14: onCreate

import android.widget.ProgressBar; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_listener_sample);
    mLayout = findViewById(R.id.mainLayout);

    final ProgressBar progressBar = findViewById(R.id.progress);
    final TextView progressText = findViewById(R.id.progressText);

    String path = Environment.getExternalStorageDirectory().getAbsolutePath();
    String testFilePath = path + "/testFile";
    String url = "http://ipv4.download.thinkbroadband.com/200MB.zip";

    new RxDownload(this, 1)
        .saveTo(testFilePath)
        .listener(progress -> {
            progressBar.setProgress(progress);
            progressText.setText(Integer.toString(progress));

            if(progress == 100)
                DialogBuilder.showMessage("Operation Completed", mLayout);
        })
        .url(url)
        .start();
}
 
开发者ID:MattiaPrimavera,项目名称:RxTransfer,代码行数:26,代码来源:ListenerSample.java

示例15: inflateUI

import android.widget.ProgressBar; //导入依赖的package包/类
private void inflateUI() {
    setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));

    LayoutInflater inflater = (LayoutInflater)
            getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    View view = inflater.inflate(
            R.layout.paginated_recycler, this, true);

    mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe_container);
    mRecyclerView = (RecyclerView) view.findViewById(R.id.list);
    mProgressBar = (ProgressBar) view.findViewById(R.id.progress_bar);
    mEmptyView = (SwipeRefreshLayout) view.findViewById(R.id.empty_view);
    mEmptyViewTextView = (TextView) mEmptyView.findViewById(R.id.no_data_message);
}
 
开发者ID:ilagarwal,项目名称:AndroidUIExtentions,代码行数:17,代码来源:UCPaginatedList.java


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