Java 类android.widget.ProgressBar 实例源码

项目:MuslimMateAndroid    文件:AboutActivity.java   
@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);

}
项目:Hillffair17    文件:EventActivity.java   
@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();
}
项目:GitHub    文件:BoxingViewActivity.java   
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);
            }
        });
    }
}
项目:letv    文件:MyDownloadActivity.java   
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();
}
项目:RoomDemo2017    文件:ListFragment.java   
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);
}
项目:AndroidSDK2.0    文件:FwUpdateDialog.java   
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() );

        }
    } );

}
项目:CXJPadProject    文件:ImageMessageHolder.java   
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"));
}
项目:TestChat    文件:WeiXinNewsActivity.java   
@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);
}
项目:Phoenix-for-VK    文件:GifPagerFragment.java   
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);
}
项目:NeiHanDuanZiTV    文件:BoxingViewActivity.java   
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);
            }
        });
    }
}
项目:BrewBook    文件:user.java   
@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;



}
项目:MyFire    文件:LoadingTip.java   
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);
}
项目:ThunderMusic    文件:AudioPreview.java   
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();
}
项目:Make-A-Pede-Android-App    文件:DeviceListActivity.java   
@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;
}
项目:RxTransfer    文件:ListenerSample.java   
@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();
}
项目:AndroidUIExtentions    文件:UCPaginatedList.java   
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);
}
项目:EsperantoRadio    文件:Basisaktivitet.java   
@Override
public void setContentView(int layoutResID) {
  setTitle(R.string.D_R_Radio); // til blinde, for at undgå at "DR Radio" bliver udtalt som "Doktor Radio"
  super.setContentView(layoutResID);
  Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  if (toolbar != null) {
    toolbar.setLogo(R.drawable.appikon);
    setSupportActionBar(toolbar);
    ActionBar ab = getSupportActionBar();
    ab.setDisplayShowTitleEnabled(false);
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setHomeButtonEnabled(true);

    //actionBar.setTitle(""); // tom - vi bruger logo
    progressBar = (ProgressBar) findViewById(R.id.progressBar);
  }
}
项目:ucar-weex-core    文件:WXWebView.java   
@Override
public View getView() {
    FrameLayout root = new FrameLayout(mContext);
    root.setBackgroundColor(Color.WHITE);

    mWebView = new WebView(mContext);//mContext.getApplicationContext();
    FrameLayout.LayoutParams wvLayoutParams =
            new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
                    FrameLayout.LayoutParams.MATCH_PARENT);
    wvLayoutParams.gravity = Gravity.CENTER;
    mWebView.setLayoutParams(wvLayoutParams);
    root.addView(mWebView);
    initWebView(mWebView);

    mProgressBar = new ProgressBar(mContext);
    showProgressBar(false);
    FrameLayout.LayoutParams pLayoutParams =
            new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,
                    FrameLayout.LayoutParams.WRAP_CONTENT);
    mProgressBar.setLayoutParams(pLayoutParams);
    pLayoutParams.gravity = Gravity.CENTER;
    root.addView(mProgressBar);
    return root;
}
项目:AndroidSDK2.0    文件:FwUpdateDialog.java   
@Override
public void onDownloading ( final int percent, final long downloadBytes )
{
    if(!isShowing() || isDisconnect)
        return;
    activity.runOnUiThread( new Runnable()
    {
        @Override
        public void run ()
        {
            NLog.d( "AsyncFirmDownloadTask onDownloading percent=" +percent+" ,downloadBytes="+downloadBytes);
            ((TextView)fw_loading_layout.findViewById( R.id.fw_loading_progress_text )).setText( downloadBytes+" byte : "+percent+"%");
            ((ProgressBar)fw_loading_layout.findViewById( R.id.fw_loading_progressbar )).setIndeterminate( false );
            ((ProgressBar)fw_loading_layout.findViewById( R.id.fw_loading_progressbar )).setProgress( percent );
        }
    } );

}
项目:RNLearn_Project1    文件:ProgressBarTestCase.java   
/**
 * Test that the sizes of the progressBars are setup correctly
 */
public void testProgressBarSizes() {
  for (String style : styleList) {
    ProgressBar newProgressBar =
        new ProgressBar(getContext(), null, styles.get(style));
    final int spec = View.MeasureSpec.makeMeasureSpec(
        ViewGroup.LayoutParams.WRAP_CONTENT,
        View.MeasureSpec.UNSPECIFIED);
    newProgressBar.measure(spec, spec);
    final int expectedHeight = newProgressBar.getMeasuredHeight();

    // verify correct size of view containing ProgressBar
    View viewContainingProgressBar = getViewByTestId(mRootView, style);
    assertEquals(expectedHeight, viewContainingProgressBar.getHeight());

    assertTrue(((ViewGroup) viewContainingProgressBar).getChildAt(0) instanceof ProgressBar);
  }
}
项目:MangoBloggerAndroidApp    文件:FirebaseListFragment.java   
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_recycler_view, container ,false);

        recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
//        mShimmerView = (ListShimmerView) view.findViewById(R.id.shimmer_view);
        mProgressBar = (ProgressBar) view.findViewById(R.id.progress_bar);
//        mShimmerView.setVisibility(View.VISIBLE);
        final GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 1);

        recyclerView.setLayoutManager(gridLayoutManager);
        recyclerView.addItemDecoration(new GridSpacingItemDecoration(1, 20, true));


        mBlogList = new ArrayList<>();
        FirebaseDatabase.getInstance().setPersistenceEnabled(true);
        mFirebaseRef = new Firebase(mUrl); /* connect to firebase*/


        return view;
    }
项目:filepicker    文件:ImageEditActivity.java   
private void showProgressDialog() {
    if (mProgressDialog == null) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        LinearLayout dialogView = new LinearLayout(this);
        dialogView.setOrientation(LinearLayout.VERTICAL);
        ProgressBar progressBar = new ProgressBar(this);
        dialogView.addView(progressBar);
        TextView tvMessage = new TextView(this);
        tvMessage.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
        tvMessage.setTextColor(Color.WHITE);
        tvMessage.setText(R.string.saving);
        tvMessage.setGravity(Gravity.CENTER);
        tvMessage.setPadding(0, Util.dip2px(5), 0, Util.dip2px(5));
        tvMessage.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
        dialogView.addView(tvMessage);
        builder.setView(dialogView);
        mProgressDialog = builder.create();
        mProgressDialog.setCancelable(false);
    }
    mProgressDialog.show();
    WindowManager.LayoutParams params = mProgressDialog.getWindow().getAttributes();
    params.width = (int) (Util.getScreenWidth()*0.4);
    mProgressDialog.getWindow().setAttributes(params);
    mProgressDialog.getWindow().getDecorView().setBackgroundColor(getResources().getColor(R.color.BgToolBar));
}
项目:KUtils    文件:Buildable.java   
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;
}
项目:MusicX-music-player    文件:TintHelper.java   
public static void setTint(@NonNull ProgressBar progressBar, @ColorInt int color, boolean skipIndeterminate) {
    ColorStateList sl = ColorStateList.valueOf(color);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        progressBar.setProgressTintList(sl);
        progressBar.setSecondaryProgressTintList(sl);
        if (!skipIndeterminate)
            progressBar.setIndeterminateTintList(sl);
    } else {
        PorterDuff.Mode mode = PorterDuff.Mode.SRC_IN;
        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
            mode = PorterDuff.Mode.MULTIPLY;
        }
        if (!skipIndeterminate && progressBar.getIndeterminateDrawable() != null)
            progressBar.getIndeterminateDrawable().setColorFilter(color, mode);
        if (progressBar.getProgressDrawable() != null)
            progressBar.getProgressDrawable().setColorFilter(color, mode);
    }
}
项目:SimpleAvatarPicker    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    if (savedInstanceState == null) {
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        toolbar.setTitle(getResources().getString(R.string.app_name));
        setSupportActionBar(toolbar);
    }

    mAvatarPicker = AvatarPickBuilder.build(this, AVATAR_FILE_PROVIDER_AUTHORITY);
    mProfileThumbnail = (ImageView) findViewById(R.id.user_profile_thumbnail);
    mProgressBar = (ProgressBar) findViewById(R.id.loading_bar);

    RxView
          .clicks(mProfileThumbnail)
          .throttleFirst(1, TimeUnit.SECONDS, AndroidSchedulers.mainThread())
          .subscribe(o -> showPicturePickerMenuDialog());

    renderImage("http://cfile25.uf.tistory.com/image/262EA640568FDABE08957B");
}
项目:Nird2    文件:BasePostFragment.java   
@CallSuper
@Nullable
@Override
public View onCreateView(LayoutInflater inflater,
        @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    // retrieve MessageId of blog post from arguments
    byte[] p = getArguments().getByteArray(POST_ID);
    if (p == null) throw new IllegalStateException("No post ID in args");
    postId = new MessageId(p);

    View view = inflater.inflate(R.layout.fragment_blog_post, container,
            false);
    progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
    progressBar.setVisibility(VISIBLE);
    ui = new BlogPostViewHolder(view);
    return view;
}
项目:immersify    文件:ExcludeAppsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_exclude_apps);

    getSupportActionBar().setTitle(R.string.exclude_apps_activity_title);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);


    mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
    mListView = (ListView) findViewById(R.id.appListView);

    mAdapter = new AppAdapter(getApplicationContext());
    mListView.setAdapter(mAdapter);

    setListShown(false);

    // Prepare the loader.  Either re-connect with an existing one,
    // or start a new one.
    getSupportLoaderManager().initLoader(0, null, this).forceLoad();
}
项目:mobile-store    文件:SwapAppsView.java   
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    View view = getInflater(context).inflate(R.layout.swap_app_list_item, parent, false);

    ViewHolder holder = new ViewHolder();

    holder.progressView = (ProgressBar) view.findViewById(R.id.progress);
    holder.nameView = (TextView) view.findViewById(R.id.name);
    holder.iconView = (ImageView) view.findViewById(android.R.id.icon);
    holder.btnInstall = (Button) view.findViewById(R.id.btn_install);
    holder.statusInstalled = (TextView) view.findViewById(R.id.status_installed);
    holder.statusIncompatible = (TextView) view.findViewById(R.id.status_incompatible);

    view.setTag(holder);
    bindView(view, context, cursor);
    return view;
}
项目:NeiHanDuanZiTV    文件:LoadingView.java   
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;
    }
项目:uob-timetable-android    文件:TermDatesFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    triedLoad = false;

    View view = inflater.inflate(R.layout.fragment_term_dates, container, false);

    pbLoad = (ProgressBar)view.findViewById(R.id.pbLoad);
    pbLoad.setVisibility(View.GONE);

    // Load WebView content
    // We do not get an error if this fails for some reason
    wvContent = (WebView)view.findViewById(R.id.wvContent);

    // Set custom WebChromeClient for reporting progress
    wvContent.setWebChromeClient(new TermDateWebChromeClient(this));

    if (getArguments().getBoolean(Args.loadOnStart.name()))
        tryLoad();

    return view;
}
项目:Nimbus    文件:Workshops.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_workshops);
     workshopsRv = (RecyclerView) findViewById(R.id.workshops_view);
    workshopsAdapter = new WorkshopsAdapter(Workshops.this);
    workshopsRv.setAdapter(workshopsAdapter);
    bar=(ProgressBar)findViewById(R.id.progress);
    errorView= (TextView) findViewById(R.id.errorView);
    if(new Connection(this).isInternet()){
        retrofit();
    }
    else {
        errorView.setVisibility(View.VISIBLE);
        errorView.setText("Please Check Your Internet Connection");
        bar.setVisibility(View.GONE);
    }

    workshopstb = (Toolbar) findViewById(R.id.workshops_toolbar);
    workshopstb.setTitle("Special Events");
 setSupportActionBar(workshopstb);
 getSupportActionBar().setDisplayHomeAsUpEnabled(true);


}
项目:BrewBook    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main1);
    SubjectListView = (ListView) findViewById(R.id.listview1);
    //this.feeditems = new ArrayList();
    progressBarSubject = (ProgressBar) findViewById(R.id.progressBar);

    new GetHttpResponse(MainActivity.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);
}
项目:cordova-plugin-x5-webview    文件:X5WebChromeClient.java   
/**
 * Ask the host application for a custom progress view to show while
 * a <video> is loading.
 * @return View The progress view.
 */
public View getVideoLoadingProgressView() {

    if (mVideoProgressView == null) {
        // Create a new Loading view programmatically.

        // create the linear layout
        LinearLayout layout = new LinearLayout(parentEngine.getView().getContext());
        layout.setOrientation(LinearLayout.VERTICAL);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
        layout.setLayoutParams(layoutParams);
        // the proress bar
        ProgressBar bar = new ProgressBar(parentEngine.getView().getContext());
        LinearLayout.LayoutParams barLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        barLayoutParams.gravity = Gravity.CENTER;
        bar.setLayoutParams(barLayoutParams);
        layout.addView(bar);

        mVideoProgressView = layout;
    }
return mVideoProgressView;
}
项目:cat-is-a-dog    文件:ViewHabitActivity.java   
/**
 * OnCreate method to setup the UI and fill TextView values with habit data
 * @param savedInstanceState
 */
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_view_habit);

    Intent intent = getIntent();
    Bundle bundle = intent.getExtras();

    habitKey = bundle.getString(getString(R.string.VIEW_HABIT_HABIT_KEY), "invalid");
    habitOwner = bundle.getString(getString(R.string.VIEW_HABIT_USER_ID), "invalid");

    mHabitViewGroup = (Group) findViewById(R.id.habitViewGroup);
    mLoadingBar = (ProgressBar) findViewById(R.id.habitViewLoadingBar);

    habitRepository = new HabitRepository(habitOwner);
}
项目:RecyclerViewTutorial2017    文件:ListActivity.java   
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);
}
项目:Hotspot-master-devp    文件:MediaGalleryActivity.java   
public void getViews() {
    mTitleTv = (TextView) findViewById(R.id.tv_center);
    mBackIv = (ImageView) findViewById(R.id.iv_left);
    mLeftTv = (TextView) findViewById(R.id.tv_left);
    mRightTv = (TextView) findViewById(R.id.tv_right);
    mMediasGv = (GridView) findViewById(R.id.gv_medias);
    mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
    mMediaListLayout = (LinearLayout) findViewById(R.id.ll_media_list);
    mMediaLv = (ListView) findViewById(R.id.listview);
    mProBtn = (RelativeLayout) findViewById(R.id.rl_toscreen);
    toscreen = (ImageView) findViewById(R.id.toscreen);
}
项目:AliZhiBoHao    文件:WebActivity.java   
private void initViews() {
    versionCode = BuildConfig.VERSION_CODE;
    mFrameLayout = (FrameLayout) findViewById(R.id.frame_layout);
    mWebView = new WebView(this);
    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    mWebView.setLayoutParams(layoutParams);
    mFrameLayout.addView(mWebView);
    tv_url_title = (TextView) findViewById(R.id.tv_url_title);
    rl_back = (RelativeLayout) findViewById(R.id.rl_back);
    rl_option = (RelativeLayout) findViewById(R.id.rl_option);
    mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
}
项目:deepenlib-android-sample    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    FloatingActionButton mFloatingActionButton = (FloatingActionButton) findViewById(R.id.fab);
    mFloatingActionButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            fabAction();
        }
    });

    mGenderTextView = (TextView) findViewById(R.id.text_view_gender);
    mCustomObjectTextView = (TextView) findViewById(R.id.text_view_custom_object);
    mGenderImageView = (ImageView) findViewById(R.id.image_view_gender);
    mCustomObjectImageView = (ImageView) findViewById(R.id.image_view_custom_object);

    mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
    mProgressBar.getIndeterminateDrawable().setColorFilter(getResources().getColor(
            R.color.colorPrimaryDark),
            PorterDuff.Mode.MULTIPLY);
    mImageView = (ImageView) findViewById(R.id.image_view);
    Picasso.with(this).load("file://" + getImagePath(Prefs.getMode(this))).into(mImageView);
    mCustomObjectLinearLayout = (LinearLayout) findViewById(R.id.linear_layout_custom_object);
    mGenderLinearLayout = (LinearLayout) findViewById(R.id.linear_layout_gender);
    mGeneralClassesListView = (ListView) findViewById(R.id.list_view_general_classes);
    mGeneralClassesListViewAdapter = new ClassifierArrayAdapter(this);
    mGeneralClassesListView.setAdapter(mGeneralClassesListViewAdapter);
    mInferenceTime = (TextView) findViewById(R.id.text_view_inference_time);

    if (!PermissionUtil.hasPermission(this)) {
        PermissionUtil.requestPermission(this);
    }
    refreshResults();
}
项目:LoRaWAN-Smart-Parking    文件:CordovaChromeClient.java   
@Override
/**
 * Ask the host application for a custom progress view to show while
 * a <video> is loading.
 * @return View The progress view.
 */
public View getVideoLoadingProgressView() {

    if (mVideoProgressView == null) {            
        // Create a new Loading view programmatically.

        // create the linear layout
        LinearLayout layout = new LinearLayout(this.appView.getContext());
        layout.setOrientation(LinearLayout.VERTICAL);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
        layout.setLayoutParams(layoutParams);
        // the proress bar
        ProgressBar bar = new ProgressBar(this.appView.getContext());
        LinearLayout.LayoutParams barLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        barLayoutParams.gravity = Gravity.CENTER;
        bar.setLayoutParams(barLayoutParams);   
        layout.addView(bar);

        mVideoProgressView = layout;
    }
return mVideoProgressView; 
}
项目:androidgithub    文件:PRTHeader.java   
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);
}