Java Code Examples for android.widget.ProgressBar#setEnabled()

The following examples show how to use android.widget.ProgressBar#setEnabled() . 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: MediaController.java    From FlutterQiniucloudLivePlugin with Apache License 2.0 4 votes vote down vote up
private void initControllerView(View v) {
    // By default these are hidden.
    mPrevButton = (ImageButton) v.findViewById(PRV_BUTTON_ID);
    if (mPrevButton != null) {
        mPrevButton.setVisibility(View.GONE);
    }
    mNextButton = (ImageButton) v.findViewById(NEXT_BUTTON_ID);
    if (mNextButton != null) {
        mNextButton.setVisibility(View.GONE);
    }

    mFfwdButton = (ImageButton) v.findViewById(FFWD_BUTTON_ID);
    if (mFfwdButton != null) {
        mFfwdButton.setOnClickListener(mFfwdListener);
        if (!mFromXml) {
            mFfwdButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }

    mRewButton = (ImageButton) v.findViewById(REW_BUTTON_ID);
    if (mRewButton != null) {
        mRewButton.setOnClickListener(mRewListener);
        if (!mFromXml) {
            mRewButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }
    mPauseButton = (ImageButton) v.findViewById(PAUSE_BUTTON_ID);
    if (mPauseButton != null) {
        mPauseButton.requestFocus();
        mPauseButton.setOnClickListener(mPauseListener);
    }

    mProgress = (ProgressBar) v.findViewById(MEDIACONTROLLER_PROGRESS_ID);
    if (mProgress != null) {
        if (mProgress instanceof SeekBar) {
            SeekBar seeker = (SeekBar) mProgress;
            seeker.setOnSeekBarChangeListener(mSeekListener);
            seeker.setThumbOffset(1);
        }
        mProgress.setMax(1000);
        mProgress.setEnabled(!mDisableProgress);
    }

    mEndTime = (TextView) v.findViewById(END_TIME_ID);
    mCurrentTime = (TextView) v.findViewById(CURRENT_TIME_ID);
}
 
Example 2
Source File: MediaController.java    From PLDroidShortVideo with Apache License 2.0 4 votes vote down vote up
private void initControllerView(View v) {
    // By default these are hidden.
    mPrevButton = (ImageButton) v.findViewById(PRV_BUTTON_ID);
    if (mPrevButton != null) {
        mPrevButton.setVisibility(View.GONE);
    }
    mNextButton = (ImageButton) v.findViewById(NEXT_BUTTON_ID);
    if (mNextButton != null) {
        mNextButton.setVisibility(View.GONE);
    }

    mFfwdButton = (ImageButton) v.findViewById(FFWD_BUTTON_ID);
    if (mFfwdButton != null) {
        mFfwdButton.setOnClickListener(mFfwdListener);
        if (!mFromXml) {
            mFfwdButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }

    mRewButton = (ImageButton) v.findViewById(REW_BUTTON_ID);
    if (mRewButton != null) {
        mRewButton.setOnClickListener(mRewListener);
        if (!mFromXml) {
            mRewButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }
    mPauseButton = (ImageButton) v.findViewById(PAUSE_BUTTON_ID);
    if (mPauseButton != null) {
        mPauseButton.requestFocus();
        mPauseButton.setOnClickListener(mPauseListener);
    }

    mProgress = (ProgressBar) v.findViewById(MEDIACONTROLLER_PROGRESS_ID);
    if (mProgress != null) {
        if (mProgress instanceof SeekBar) {
            SeekBar seeker = (SeekBar) mProgress;
            seeker.setOnSeekBarChangeListener(mSeekListener);
            seeker.setThumbOffset(1);
        }
        mProgress.setMax(1000);
        mProgress.setEnabled(!mDisableProgress);
    }

    mEndTime = (TextView) v.findViewById(END_TIME_ID);
    mCurrentTime = (TextView) v.findViewById(CURRENT_TIME_ID);
}
 
Example 3
Source File: MediaController.java    From PLDroidShortVideo with Apache License 2.0 4 votes vote down vote up
private void initControllerView(View v) {
    // By default these are hidden.
    mPrevButton = (ImageButton) v.findViewById(PRV_BUTTON_ID);
    if (mPrevButton != null) {
        mPrevButton.setVisibility(View.GONE);
    }
    mNextButton = (ImageButton) v.findViewById(NEXT_BUTTON_ID);
    if (mNextButton != null) {
        mNextButton.setVisibility(View.GONE);
    }

    mFfwdButton = (ImageButton) v.findViewById(FFWD_BUTTON_ID);
    if (mFfwdButton != null) {
        mFfwdButton.setOnClickListener(mFfwdListener);
        if (!mFromXml) {
            mFfwdButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }

    mRewButton = (ImageButton) v.findViewById(REW_BUTTON_ID);
    if (mRewButton != null) {
        mRewButton.setOnClickListener(mRewListener);
        if (!mFromXml) {
            mRewButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }
    mPauseButton = (ImageButton) v.findViewById(PAUSE_BUTTON_ID);
    if (mPauseButton != null) {
        mPauseButton.requestFocus();
        mPauseButton.setOnClickListener(mPauseListener);
    }

    mProgress = (ProgressBar) v.findViewById(MEDIACONTROLLER_PROGRESS_ID);
    if (mProgress != null) {
        if (mProgress instanceof SeekBar) {
            SeekBar seeker = (SeekBar) mProgress;
            seeker.setOnSeekBarChangeListener(mSeekListener);
            seeker.setThumbOffset(1);
        }
        mProgress.setMax(1000);
        mProgress.setEnabled(!mDisableProgress);
    }

    mEndTime = (TextView) v.findViewById(END_TIME_ID);
    mCurrentTime = (TextView) v.findViewById(CURRENT_TIME_ID);
}
 
Example 4
Source File: MediaController.java    From MeiZiNews with MIT License 4 votes vote down vote up
private void initControllerView(View v) {
    // By default these are hidden.
    mPrevButton = (ImageButton) v.findViewById(PRV_BUTTON_ID);
    if (mPrevButton != null) {
        mPrevButton.setVisibility(View.GONE);
    }
    mNextButton = (ImageButton) v.findViewById(NEXT_BUTTON_ID);
    if (mNextButton != null) {
        mNextButton.setVisibility(View.GONE);
    }

    mFfwdButton = (ImageButton) v.findViewById(FFWD_BUTTON_ID);
    if (mFfwdButton != null) {
        mFfwdButton.setOnClickListener(mFfwdListener);
        if (!mFromXml) {
            mFfwdButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }

    mRewButton = (ImageButton) v.findViewById(REW_BUTTON_ID);
    if (mRewButton != null) {
        mRewButton.setOnClickListener(mRewListener);
        if (!mFromXml) {
            mRewButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }
    mPauseButton = (ImageButton) v.findViewById(PAUSE_BUTTON_ID);
    if (mPauseButton != null) {
        mPauseButton.requestFocus();
        mPauseButton.setOnClickListener(mPauseListener);
    }

    mProgress = (ProgressBar) v.findViewById(MEDIACONTROLLER_PROGRESS_ID);
    if (mProgress != null) {
        if (mProgress instanceof SeekBar) {
            SeekBar seeker = (SeekBar) mProgress;
            seeker.setOnSeekBarChangeListener(mSeekListener);
            seeker.setThumbOffset(1);
        }
        mProgress.setMax(1000);
        mProgress.setEnabled(!mDisableProgress);
    }

    mEndTime = (TextView) v.findViewById(END_TIME_ID);
    mCurrentTime = (TextView) v.findViewById(CURRENT_TIME_ID);
}
 
Example 5
Source File: MediaController.java    From qiniu-lab-android with MIT License 4 votes vote down vote up
private void initControllerView(View v) {
    // By default these are hidden.
    mPrevButton = (ImageButton) v.findViewById(PRV_BUTTON_ID);
    if (mPrevButton != null) {
        mPrevButton.setVisibility(View.GONE);
    }
    mNextButton = (ImageButton) v.findViewById(NEXT_BUTTON_ID);
    if (mNextButton != null) {
        mNextButton.setVisibility(View.GONE);
    }

    mFfwdButton = (ImageButton) v.findViewById(FFWD_BUTTON_ID);
    if (mFfwdButton != null) {
        mFfwdButton.setOnClickListener(mFfwdListener);
        if (!mFromXml) {
            mFfwdButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }

    mRewButton = (ImageButton) v.findViewById(REW_BUTTON_ID);
    if (mRewButton != null) {
        mRewButton.setOnClickListener(mRewListener);
        if (!mFromXml) {
            mRewButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }
    mPauseButton = (ImageButton) v.findViewById(PAUSE_BUTTON_ID);
    if (mPauseButton != null) {
        mPauseButton.requestFocus();
        mPauseButton.setOnClickListener(mPauseListener);
    }

    mProgress = (ProgressBar) v.findViewById(MEDIACONTROLLER_PROGRESS_ID);
    if (mProgress != null) {
        if (mProgress instanceof SeekBar) {
            SeekBar seeker = (SeekBar) mProgress;
            seeker.setOnSeekBarChangeListener(mSeekListener);
            seeker.setThumbOffset(1);
        }
        mProgress.setMax(1000);
        mProgress.setEnabled(!mDisableProgress);
    }

    mEndTime = (TextView) v.findViewById(END_TIME_ID);
    mCurrentTime = (TextView) v.findViewById(CURRENT_TIME_ID);
}