android.widget.Button#isEnabled ( )源码实例Demo

下面列出了android.widget.Button#isEnabled ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: 365browser   文件: CardUnmaskPrompt.java
/**
 * Validates the values of the input fields to determine whether the submit button should be
 * enabled. Also displays a detailed error message and highlights the fields for which the value
 * is wrong. Finally checks whether the focuse should move to the next field.
 */
private void validate() {
    Button positiveButton = mDialog.getButton(AlertDialog.BUTTON_POSITIVE);

    @ErrorType int errorType = getExpirationAndCvcErrorType();
    positiveButton.setEnabled(errorType == ERROR_TYPE_NONE);
    showDetailedErrorMessage(errorType);
    moveFocus(errorType);

    if (sObserverForTest != null) {
        sObserverForTest.onCardUnmaskPromptValidationDone(this);

        if (positiveButton.isEnabled()) {
            sObserverForTest.onCardUnmaskPromptReadyToUnmask(this);
        }
    }
}
 
源代码2 项目: delion   文件: CardUnmaskPrompt.java
private void validate() {
    Button positiveButton = mDialog.getButton(AlertDialog.BUTTON_POSITIVE);
    positiveButton.setEnabled(areInputsValid());
    if (positiveButton.isEnabled() && sObserverForTest != null) {
        sObserverForTest.onCardUnmaskPromptReadyToUnmask(this);
    }
}
 
源代码3 项目: AndroidChromium   文件: CardUnmaskPrompt.java
private void validate() {
    Button positiveButton = mDialog.getButton(AlertDialog.BUTTON_POSITIVE);
    positiveButton.setEnabled(areInputsValid());
    if (positiveButton.isEnabled() && sObserverForTest != null) {
        sObserverForTest.onCardUnmaskPromptReadyToUnmask(this);
    }
}
 
/**
 * Updates the current state of the controls.
 */
private void updateControls() {
    String str = getString(R.string.secondsOfVideo, mSecondsOfVideo);
    TextView tv = (TextView) findViewById(R.id.capturedVideoDesc_text);
    tv.setText(str);

    boolean wantEnabled = (mCircEncoder != null) && !mFileSaveInProgress;
    Button button = (Button) findViewById(R.id.capture_button);
    if (button.isEnabled() != wantEnabled) {
        Log.d(TAG, "setting enabled = " + wantEnabled);
        button.setEnabled(wantEnabled);
    }
}
 
源代码5 项目: Augendiagnose   文件: CameraActivity.java
@Override
public final boolean onKeyDown(final int keyCode, final KeyEvent event) {
	final Button captureButton = findViewById(R.id.buttonCameraTrigger);
	if ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_VOLUME_UP)
			&& captureButton.isEnabled() && mCurrentFlashlightMode != FlashMode.EXT) {
		captureButton.setEnabled(false);
		mCameraHandler.takePicture();
		TrackingUtil.sendEvent(Category.EVENT_USER, CAMERA, "Capture");
		return true;
	}
	else {
		return super.onKeyDown(keyCode, event);
	}
}
 
源代码6 项目: grafika   文件: ContinuousCaptureActivity.java
/**
 * Updates the current state of the controls.
 */
private void updateControls() {
    String str = getString(R.string.secondsOfVideo, mSecondsOfVideo);
    TextView tv = (TextView) findViewById(R.id.capturedVideoDesc_text);
    tv.setText(str);

    boolean wantEnabled = (mCircEncoder != null) && !mFileSaveInProgress;
    Button button = (Button) findViewById(R.id.capture_button);
    if (button.isEnabled() != wantEnabled) {
        Log.d(TAG, "setting enabled = " + wantEnabled);
        button.setEnabled(wantEnabled);
    }
}