android.widget.ProgressBar Java Examples

The following examples show how to use android.widget.ProgressBar. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ListFragment.java    From letv with Apache License 2.0 6 votes vote down vote up
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Context context = getActivity();
    FrameLayout root = new FrameLayout(context);
    LinearLayout pframe = new LinearLayout(context);
    pframe.setId(INTERNAL_PROGRESS_CONTAINER_ID);
    pframe.setOrientation(1);
    pframe.setVisibility(8);
    pframe.setGravity(17);
    pframe.addView(new ProgressBar(context, null, 16842874), new LayoutParams(-2, -2));
    root.addView(pframe, new LayoutParams(-1, -1));
    FrameLayout lframe = new FrameLayout(context);
    lframe.setId(INTERNAL_LIST_CONTAINER_ID);
    TextView tv = new TextView(getActivity());
    tv.setId(INTERNAL_EMPTY_ID);
    tv.setGravity(17);
    lframe.addView(tv, new LayoutParams(-1, -1));
    ListView lv = new ListView(getActivity());
    lv.setId(16908298);
    lv.setDrawSelectorOnTop(false);
    lframe.addView(lv, new LayoutParams(-1, -1));
    root.addView(lframe, new LayoutParams(-1, -1));
    root.setLayoutParams(new LayoutParams(-1, -1));
    return root;
}
 
Example #2
Source File: ObtainRssData.java    From WiFi-and-Sensors-Indoor-Positioning with GNU General Public License v3.0 6 votes vote down vote up
private void saveRssToFile(final ProgressBar progressBar, ObtainRssData obtainRssData, String fileStr) {
	/*
	 * save RSS data and position coordinate to file.
	 */
	mainAty.runOnUiThread(new Runnable() {
		
		@Override
		public void run() {
			progressBar.setVisibility(View.GONE);
			Toast.makeText(mainAty, "saving", Toast.LENGTH_SHORT).show();
		}
	});
	
	try {
		FileOperation.appendToFile(record_data.toString(), fileStr); 
		acquireSignalNum = 0;
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
Example #3
Source File: VideoViewActivity.java    From MediaPlayer-Extended with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_videoview);
    Utils.setActionBarSubtitleEllipsizeMiddle(this);

    mVideoView = (VideoView) findViewById(R.id.vv);
    mProgress = (ProgressBar) findViewById(R.id.progress);

    mMediaPlayerControl = mVideoView; //new MediaPlayerDummyControl();
    mMediaController = new MediaController(this);
    mMediaController.setAnchorView(findViewById(R.id.container));
    mMediaController.setMediaPlayer(mMediaPlayerControl);
    mMediaController.setEnabled(false);

    mProgress.setVisibility(View.VISIBLE);

    // Init video playback state (will eventually be overwritten by saved instance state)
    mVideoUri = getIntent().getData();
    mVideoPosition = 0;
    mVideoPlaybackSpeed = 1;
    mVideoPlaying = false;
}
 
Example #4
Source File: ColorPickerDialog.java    From FastAccess with GNU General Public License v3.0 6 votes vote down vote up
@SuppressLint("InflateParams") @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) {
    View view = LayoutInflater.from(getActivity()).inflate(R.layout.color_picker_dialog, null, false);
    final Activity activity = getActivity();
    mProgress = (ProgressBar) view.findViewById(android.R.id.progress);
    mPalette = (ColorPickerPalette) view.findViewById(R.id.color_picker);
    mPalette.init(mSize, mColumns, this);

    if (mColors != null) {
        showPaletteView();
    }

    mAlertDialog = new AlertDialog.Builder(activity)
            .setTitle(mTitleResId)
            .setView(view)
            .create();
    mAlertDialog.setCanceledOnTouchOutside(true);
    return mAlertDialog;
}
 
Example #5
Source File: ColorPickerDialog.java    From ColorPicker with Apache License 2.0 6 votes vote down vote up
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Activity activity = getActivity();

    View view = LayoutInflater.from(getActivity()).inflate(R.layout.color_picker_dialog, null);
    mProgress = (ProgressBar) view.findViewById(android.R.id.progress);
    mPalette = (ColorPickerPalette) view.findViewById(R.id.color_picker);
    mPalette.init(mSize, mColumns, this, mBackwardsOrder);

    if (mColors != null) {
        showPaletteView();
    }

    mAlertDialog = new AlertDialog.Builder(activity)
            .setTitle(mTitleResId)
            .setView(view)
            .create();
    mAlertDialog.setCanceledOnTouchOutside(true);
    return mAlertDialog;
}
 
Example #6
Source File: NewsFragmentWithTopic.java    From zhangshangwuda with Apache License 2.0 6 votes vote down vote up
/**
 * 初始化View
 */
private void InitView() {
	// System.out.println("InitViewPager");
	// 设置首页
	// loadMoreButton = getLoadMoreButton();
	newsList = new ArrayList<Map<String, String>>();
	ListView = (PullToRefreshListView) rootView
			.findViewById(R.id.news_all_ListView);
	PB = (ProgressBar) rootView
			.findViewById(R.id.news_all_ListView_progressBar);
	ListView.setOnItemClickListener(new ListViewItemClickListener());
	ListView.setOnRefreshListener(new PullToRefreshListView.OnRefreshListener() {
		public void onRefresh() {
			refreshData();
		}
	});
	ListView.setOnLoadMoreListener(new PullToRefreshListView.OnLoadMoreListener() {

		@Override
		public void onLoadMore() {
			loadMore();
		}
	});
}
 
Example #7
Source File: HomeActivity.java    From Passbook with Apache License 2.0 6 votes vote down vote up
private void startSync(boolean animationOn) {
    Resources r = getResources();
    int[] strRes = {R.string.sync_none, R.string.sync_gpg, R.string.sync_gdrive};
    mButtonContainer = findViewById(R.id.btn_container);
    if(animationOn) {
        mButtonContainer.animate().scaleY(0.0f).setListener(this);
    }
    else {
        mButtonContainer.setVisibility(View.INVISIBLE);
    }
    mSyncText = findViewById(R.id.sync_hint);
    mSyncText.setText(r.getString(R.string.contacting,
            r.getString(strRes[Application.Options.mSync])));
    ProgressBar pb = findViewById(R.id.pb);
    if(animationOn) {
        pb.animate().alpha(1.0f).setStartDelay(300);
        mSyncText.animate().alpha(1.0f).setStartDelay(300);
    }
    else {
        pb.setAlpha(1.0f);
        mSyncText.setAlpha(1.0f);
    }
    SyncService ss = SyncService.getInstance(Application.Options.mSync);
    ss.initialize(this).setListener(this).connect(this, 0);
}
 
Example #8
Source File: QuickFragment.java    From quickhybrid-android with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * 初始化布局控件
 */
protected void initView() {
    pb = (ProgressBar) findViewById(R.id.pb);
    wv = (QuickWebView) findViewById(R.id.wv);

    //初始化控制器
    control = new WebloaderControl(this, bean, wv);


    //设置错误状态页点击事件
    pageControl.getStatusPage().setClickButton(getString(R.string.status_page_reload),new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            //加载历史记录最近一页
            control.loadLastPage(true);
        }
    });

    //加载页面
    control.loadPage();
}
 
Example #9
Source File: LoaderImageView.java    From callerid-for-android with GNU General Public License v3.0 6 votes vote down vote up
/**
 *  First time loading of the LoaderImageView
 *  Sets up the LayoutParams of the view, you can change these to
 *  get the required effects you want
 */
private void instantiate(final Context context, final String imageUrl) {
	mContext = context;
	
	mImage = new ImageView(mContext);
	
	mImage.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
	
	mSpinner = new ProgressBar(mContext);
	mSpinner.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
		
	mSpinner.setIndeterminate(true);
	
	addView(mSpinner);
	addView(mImage);
	
	if(imageUrl == null){
		spin();
	}else{
		setImageDrawable(imageUrl);
	}
}
 
Example #10
Source File: ActivityWebView.java    From RxTools-master with Apache License 2.0 6 votes vote down vote up
private void initView() {
    // TODO Auto-generated method stub
    mRxTextAutoZoom = (RxTextAutoZoom) findViewById(R.id.afet_tv_title);
    llIncludeTitle = (LinearLayout) findViewById(R.id.ll_include_title);
    tvTitle = (TextView) findViewById(R.id.tv_title);
    pbWebBase = (ProgressBar) findViewById(R.id.pb_web_base);
    webBase = (WebView) findViewById(R.id.web_base);
    ivFinish = (ImageView) findViewById(R.id.iv_finish);
    ivFinish.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (webBase.canGoBack()) {
                webBase.goBack();
            } else {
                finish();
            }
        }
    });

    initAutoFitEditText();
}
 
Example #11
Source File: ReadWorker.java    From iBeebo with GNU General Public License v3.0 6 votes vote down vote up
public ReadWorker(IWeiboDrawable view, String url, FileLocationMethod method, boolean isMultiPictures) {

        this(view.getImageView(), url, method, false);
        this.IWeiboDrawable = view;
        this.pbWeakReference = new WeakReference<ProgressBar>(view.getProgressBar());
        view.setGifFlag(false);
        if (SettingUtils.getEnableBigPic()) {
            if (view.getProgressBar() != null) {
                view.getProgressBar().setVisibility(View.VISIBLE);
                view.getProgressBar().setProgress(0);
            }
        } else {
            if (view.getProgressBar() != null) {
                view.getProgressBar().setVisibility(View.INVISIBLE);
                view.getProgressBar().setProgress(0);
            }
        }
        this.isMultiPictures = isMultiPictures;

    }
 
Example #12
Source File: ChatActivity.java    From ChatMessagesAdapter-android with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_chat);
    ArrayList<QBUser> qbUsers = (ArrayList<QBUser>) getIntent().getExtras().getSerializable(EXTRA_QB_USERS);
    chatDialog = new QBChatDialog(DIALOG_ID);

    messagesListView = (RecyclerView) findViewById(R.id.list_chat_messages);
    progressBar = (ProgressBar) findViewById(R.id.progress_chat);
    audioLayout = (LinearLayout) findViewById(R.id.layout_chat_audio_container);
    recordButton = (QBRecordAudioButton) findViewById(R.id.button_chat_record_audio);
    recordChronometer = (Chronometer) findViewById(R.id.chat_audio_record_chronometer);
    bucketView = (ImageView) findViewById(R.id.chat_audio_record_bucket_imageview);
    audioRecordTextView = (TextView) findViewById(R.id.chat_audio_record_textview);
    vibro = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

    requestPermission();
    initAudioRecorder();
    recordButton.setRecordTouchListener(new RecordTouchListenerImpl());

    loadChatHistory(qbUsers);
}
 
Example #13
Source File: MainActivity.java    From ns-usbloader-mobile with GNU General Public License v3.0 6 votes vote down vote up
private void blockUI(boolean shouldBlock){
    if (shouldBlock) {
        selectBtn.setEnabled(false);
        recyclerView.suppressLayout(true);
        uploadToNsBtn.setCompoundDrawablesWithIntrinsicBounds(null, getResources().getDrawable(R.drawable.ic_cancel), null, null);
        uploadToNsBtn.setText(R.string.interrupt_btn);
        uploadToNsBtn.setOnClickListener(e -> stopService(new Intent(this, CommunicationsService.class)));
        progressBarMain.setVisibility(ProgressBar.VISIBLE);
        progressBarMain.setIndeterminate(true);//TODO
        uploadToNsBtn.setEnabled(true);
        return;
    }
    selectBtn.setEnabled(true);
    recyclerView.suppressLayout(false);
    uploadToNsBtn.setCompoundDrawablesWithIntrinsicBounds(null, getResources().getDrawable(R.drawable.ic_upload_btn), null, null);
    uploadToNsBtn.setText(R.string.upload_btn);
    uploadToNsBtn.setOnClickListener(e -> this.uploadFiles() );
    progressBarMain.setVisibility(ProgressBar.INVISIBLE);
    this.updateUploadBtnState();
}
 
Example #14
Source File: DialogFragmentFancyQrCodeSinglePage.java    From bither-android with Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    vContainer = inflater.inflate(R.layout.fragment_qr_code_single_page, null);
    flQrContainer = (FrameLayout) vContainer.findViewById(R.id.fl_qr_container);
    ivQr = (ImageView) vContainer.findViewById(R.id.iv_qrcode);
    ivAvatar = (ImageView) vContainer.findViewById(R.id.iv_avatar);
    pb = (ProgressBar) vContainer.findViewById(R.id.pb);
    ivQr.getLayoutParams().height = ivQr.getLayoutParams().width = QrCodeSize;
    ivAvatar.getLayoutParams().height = ivAvatar.getLayoutParams().width = (int) (QrCodeSize
            * FancyQrCodeThread.AvatarSizeRate);
    vContainer.setOnClickListener(clickListener);
    if (AppSharedPreference.getInstance().hasUserAvatar() && isShowAvatar) {
        ivAvatar.setVisibility(View.VISIBLE);
    } else {
        ivAvatar.setVisibility(View.GONE);
    }
    configureImages();
    configureVanityAddress();
    return vContainer;
}
 
Example #15
Source File: WordsFragment.java    From green_android with GNU General Public License v3.0 6 votes vote down vote up
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
                         final Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_onboarding_words, container, false);

    // Get arguments: words and offset
    final Bundle b = this.getArguments();
    if (b == null)
        return view;
    final List<String> words = b.getStringArrayList("words");
    final int offset = b.getInt("offset");
    final int index = offset / 6;

    final ProgressBar progressBar = UI.find(view, R.id.progressBar);
    progressBar.setProgress(25+index*25);

    // Setup words recyclerview
    final WordsViewAdapter wordsViewAdapter = new WordsViewAdapter(getContext(), words, offset);
    final RecyclerView wordsRecyclerView = UI.find(view, R.id.wordsRecyclerView);
    wordsRecyclerView.setHasFixedSize(true);
    wordsRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    wordsRecyclerView.setAdapter(wordsViewAdapter);
    return view;
}
 
Example #16
Source File: ChartActivity.java    From InteractiveChart with Apache License 2.0 6 votes vote down vote up
/**
 * 数据开始加载
 *
 * @param loadingType 加载框出现类型
 */
public void loadBegin(int loadingType, ProgressBar bar, Chart chart) {
  this.constraintSet.setVisibility(bar.getId(), VISIBLE);
  this.constraintSet.connect(bar.getId(), ConstraintSet.START, chart.getId(),
      ConstraintSet.START, Utils.dpTopx(this, 30));
  this.constraintSet.connect(bar.getId(), ConstraintSet.END, chart.getId(),
      ConstraintSet.END, Utils.dpTopx(this, 30));
  switch (loadingType) {
    case LEFT_LOADING:
      this.constraintSet.clear(bar.getId(), ConstraintSet.END);
      break;
    case RIGHT_LOADING:
      this.constraintSet.clear(bar.getId(), ConstraintSet.START);
      break;
  }
  this.chartLayout.setConstraintSet(constraintSet);
}
 
Example #17
Source File: WebViewActivity.java    From NetEasyNews with GNU General Public License v3.0 6 votes vote down vote up
private void initTitle() {
    StatusBarUtil.setColor(this, CommonUtils.getColor(R.color.colorTheme),0);
    mProgressBar = (ProgressBar) findViewById(R.id.pb_progress);
    webView = (WebView) findViewById(R.id.webview_detail);
    videoFullView = (FrameLayout) findViewById(R.id.video_fullView);
    mTitleToolBar = (Toolbar) findViewById(R.id.title_tool_bar);
    setSupportActionBar(mTitleToolBar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        //去除默认Title显示
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeAsUpIndicator(R.drawable.icon_back);
    }
    setTitle(mTitle);
    mTitleToolBar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
}
 
Example #18
Source File: LighthouseSearchTask.java    From lbry-android with MIT License 5 votes vote down vote up
public LighthouseSearchTask(String rawQuery, int size, int from, boolean nsfw, String relatedTo, ProgressBar progressBar, ClaimSearchResultHandler handler) {
    this.rawQuery = rawQuery;
    this.size = size;
    this.from = from;
    this.nsfw = nsfw;
    this.relatedTo = relatedTo;
    this.progressBar = progressBar;
    this.handler = handler;
}
 
Example #19
Source File: QuizQuestionActivity.java    From Hillffair17 with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_quiz_question);

    manager=getSupportFragmentManager();

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    pager=(ViewPager)findViewById(R.id.question_pager);
    back2home=(Button)findViewById(R.id.home_link);
    finish=(Button)findViewById(R.id.finish_button);
    staytuned_message=(LinearLayout)findViewById(R.id.stay_tuned_message);
    progressBar=(ProgressBar)findViewById(R.id.progress);
    message=(TextView)findViewById(R.id.message);
    time_left=(TextView)findViewById(R.id.time_left);
    scoreCalculator= ScoreCalculator.getInstance();

    back2home.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            finish();
        }
    });
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    SharedPref pref=new SharedPref(this);
    String userId=pref.getUserId();
    i1 = getIntent();
    String category = i1.getExtras().getString("Category_Name");
    String topic = i1.getExtras().getString("Topic_Name");
    if(!userId.isEmpty()){
    loadQuizwithRetrofit(userId,category,topic);
    t=new timer(this,time_left);}
    else {
        message.setText("Please Login to Play Quiz ");
    }

}
 
Example #20
Source File: PollIntermediateActivity.java    From Hillffair17 with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_poll_intermediate);
    progressBar = (ProgressBar) findViewById(R.id.category_progress);
    progressBar.setVisibility(View.VISIBLE);
    coordinatorLayout= (CoordinatorLayout) findViewById(R.id.core_view);
    loadingText = (TextView) findViewById(R.id.loadingText);

    pref = new SharedPref(this);

    fetchQuestion(this);
}
 
Example #21
Source File: FriendHistoryFragment.java    From repay-android with Apache License 2.0 5 votes vote down vote up
@Override
protected void onPreExecute()
{
	mList.setAdapter(null);
	mList.setVisibility(ListView.GONE);
	mNoDebtsMsg.setVisibility(TextView.GONE);
	mProgressBar.setVisibility(ProgressBar.VISIBLE);
}
 
Example #22
Source File: ProgressIndicatorController.java    From GithubApp with Apache License 2.0 5 votes vote down vote up
@Override
public View newInstance(@NonNull Context context) {
    mProgressBar = (ProgressBar) View.inflate(context, R.layout.progress_indicator, null);
    if (selectedDotColor != DEFAULT_COLOR)
        mProgressBar.getProgressDrawable().setColorFilter(selectedDotColor,
                PorterDuff.Mode.SRC_IN);
    if (unselectedDotColor != DEFAULT_COLOR)
        mProgressBar.getIndeterminateDrawable().setColorFilter(unselectedDotColor,
                PorterDuff.Mode.SRC_IN);

    return mProgressBar;
}
 
Example #23
Source File: DeviceControlActivity.java    From freeiot-android with MIT License 5 votes vote down vote up
@Override
	protected void onCreate(Bundle savedInstances) {
		super.onCreate(savedInstances);
		setContentView(R.layout.activity_outlet_control);
		
		Bundle bundle = getIntent().getExtras();
		if (bundle != null) {
            mIdentifier = bundle.getString("identifier");
//			operateUrl = String.format(operateUrl, mIdentifier);
			mUrl = bundle.getString("app");
			if (BridgeUtil.hasAssetFile(this, "index.html")) {
				mUrl = "file:///android_asset/index.html";
			}
			LogUtils.e("url=> " + mUrl);
//			mUrl = "file:///android_asset/index.html";
//            mUrl = "file:///android_asset/failed/404.html";
            mTitleName = bundle.getString("name");
			((TextView)findViewById(R.id.title)).setText(mTitleName);
		}
		
		mSwipeRefreshLayout = (SwipeRefreshLayout)findViewById(R.id.swipe_container);
		mSwipeRefreshLayout.setColorScheme(R.color.main_red_color);
		mSwipeRefreshLayout.setOnRefreshListener(this);
		
		mProgressBar = (ProgressBar)findViewById(R.id.progressbar);
		mWebView = (XWalkView) findViewById(R.id.webview);
		findViewById(R.id.back).setOnClickListener(this);
		bridgeHelper = new BridgeHelper(this, mWebView);
		initVebView();
	}
 
Example #24
Source File: DisplayOriginalListActivity.java    From coolreader with MIT License 5 votes vote down vote up
public void toggleProgressBar(boolean show) {
	if (show) {
		loadingText.setText("Loading List, please wait...");
		loadingText.setVisibility(TextView.VISIBLE);
		loadingBar.setVisibility(ProgressBar.VISIBLE);
		getListView().setVisibility(ListView.GONE);
	} else {
		loadingText.setVisibility(TextView.GONE);
		loadingBar.setVisibility(ProgressBar.GONE);
		getListView().setVisibility(ListView.VISIBLE);
	}
}
 
Example #25
Source File: FollowListPage.java    From BigApp_Discuz_Android with Apache License 2.0 5 votes vote down vote up
public PRTHeader(Context context) {
	super(context);
	setOrientation(VERTICAL);

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

	ivArrow = new RotateImageView(context);
	int resId = getBitmapRes(context, "ssdk_oks_ptr_ptr");
	if (resId > 0) {
		ivArrow.setImageResource(resId);
	}
	int dp_32 = dipToPx(context, 32);
	LayoutParams lpIv = new LayoutParams(dp_32, dp_32);
	lpIv.gravity = Gravity.CENTER_VERTICAL;
	llInner.addView(ivArrow, lpIv);

	pbRefreshing = new ProgressBar(context);
	llInner.addView(pbRefreshing, lpIv);
	pbRefreshing.setVisibility(View.GONE);

	tvHeader = new TextView(getContext());
	tvHeader.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
	tvHeader.setGravity(Gravity.CENTER);
	int dp_10 = com.mob.tools.utils.R.dipToPx(getContext(), 10);
	tvHeader.setPadding(dp_10, dp_10, dp_10, dp_10);
	tvHeader.setTextColor(0xff000000);
	LayoutParams lpTv = new LayoutParams(
			LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	lpTv.gravity = Gravity.CENTER_VERTICAL;
	llInner.addView(tvHeader, lpTv);
}
 
Example #26
Source File: UIProgressDialog.java    From UIWidget with Apache License 2.0 5 votes vote down vote up
@Override
public View createProgressView() {
    mProgressBar = new ProgressBar(mContext);
    mProgressBar.setLayoutParams(new ViewGroup.LayoutParams(mLoadingSize, mLoadingSize));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
            && mIndeterminateDrawable == null) {
        mProgressBar.setIndeterminateTintList(ColorStateList.valueOf(mLoadingColor));
    }
    if (mIndeterminateDrawable != null) {
        mProgressBar.setIndeterminateDrawable(mIndeterminateDrawable);
    }
    return mProgressBar;
}
 
Example #27
Source File: MsgSafeActivity.java    From MobileGuard with MIT License 5 votes vote down vote up
/**
 * 1
 */
@Override
protected void initView() {
    setContentView(R.layout.activity_msg_safe);
    // bind view
    pbLoading = (ProgressBar) findViewById(R.id.pb_loading);
    tvNoData = (TextView) findViewById(R.id.tv_no_data);
    lvBlacklist = (ListView) findViewById(R.id.lv_blacklist);

}
 
Example #28
Source File: AutoDiagnosisActivity.java    From FreezeYou with Apache License 2.0 5 votes vote down vote up
private void setProgress(final ProgressBar progressBar, final int progress) {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            if (Build.VERSION.SDK_INT >= 24) {
                progressBar.setProgress(progress, true);
            } else {
                progressBar.setProgress(progress);
            }
        }
    });
}
 
Example #29
Source File: JCVideoPlayerStandard.java    From JieCaoVideoPlayer-develop with MIT License 5 votes vote down vote up
@Override
protected void init(Context context) {
    super.init(context);
    bottomProgressBar = (ProgressBar) findViewById(R.id.bottom_progressbar);
    titleTextView = (TextView) findViewById(R.id.title);
    backButton = (ImageView) findViewById(R.id.back);
    thumbImageView = (ImageView) findViewById(R.id.thumb);
    coverImageView = (ImageView) findViewById(R.id.cover);
    loadingProgressBar = (ProgressBar) findViewById(R.id.loading);

    thumbImageView.setOnClickListener(this);
    backButton.setOnClickListener(this);

}
 
Example #30
Source File: AppCompatProgressBarHelper.java    From timecat with Apache License 2.0 5 votes vote down vote up
private void applySupportIndeterminateTint() {
    Drawable mIndeterminateDrawable = ((ProgressBar) mView).getIndeterminateDrawable();
    if (mIndeterminateDrawable != null && mIndeterminateTintInfo != null) {
        final TintInfo tintInfo = mIndeterminateTintInfo;
        if (tintInfo.mHasTintList || tintInfo.mHasTintMode) {
            ((ProgressBar) mView).setIndeterminateDrawable(mIndeterminateDrawable = mIndeterminateDrawable.mutate());
            TintManager.tintViewDrawable(mView, mIndeterminateDrawable, mIndeterminateTintInfo);
            // The drawable (or one of its children) may not have been
            // stateful before applying the tint, so let's try again.
            if (mIndeterminateDrawable.isStateful()) {
                mIndeterminateDrawable.setState(mView.getDrawableState());
            }
        }
    }
}