Code example for Button

Methods: setOnClickListenersetVisibilitysetText

0
 
    private synchronized void updateOkButton() { 
        if (this.promptingPin) {
            okButton.setOnClickListener(pinEnterClickListener);
        } else { 
            okButton.setOnClickListener(okClickListener);
        } 
        if (this.oneButton) {
            okButton.setVisibility(View.GONE);
        } else { 
            okButton.setVisibility(View.VISIBLE);
        } 
 
        if (pinentry.ok.length() != 0) {
            okButton.setText(fix(pinentry.ok));
        } else { 
            okButton.setText(fix(pinentry.default_ok));
        } 
    } 
 
    private synchronized void updateCancelButton() { 
        cancelButton.setOnClickListener(cancelClickListener);
        okButton.setVisibility(View.VISIBLE);
        if (pinentry.cancel.length() != 0) {
            cancelButton.setText(fix(pinentry.cancel));
        } else { 
            cancelButton.setText(fix(pinentry.default_cancel));
        } 
Experience pair programming with AI  Get Codota for Java