Code example for Button

Methods: setEnabled, isEnabled, setVisibility

0
        isShowingControls = false;
    } 
 
    public void updateState(boolean nextAvailable, boolean previousAvailable) {
        next.setEnabled(nextAvailable);
        prev.setEnabled(previousAvailable);
 
        evaluateButtonsVisibility(); 
    } 
 
    private void evaluateButtonsVisibility() { 
        if (isShowingControls) {
            next.setVisibility(next.isEnabled() ? View.VISIBLE : View.INVISIBLE);
            prev.setVisibility(prev.isEnabled() ? View.VISIBLE : View.INVISIBLE);
        } 
    } 
 
    @Override 
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        int height = getHeight();