Code example for TextView

Methods: setText, setContentDescription, setOnClickListener, setVisibility

0
    public void resetRotateDialog() { 
        inflateDialogLayout(); 
        mRotateDialogTitleLayout.setVisibility(View.GONE);
        mRotateDialogSpinner.setVisibility(View.GONE);
        mRotateDialogButton1.setVisibility(View.GONE);
        mRotateDialogButton2.setVisibility(View.GONE);
        mRotateDialogButtonLayout.setVisibility(View.GONE);
    } 
 
    private void fadeOutDialog() { 
        mDialogRootLayout.startAnimation(mFadeOutAnim);
        mDialogRootLayout.setVisibility(View.GONE);
    } 
 
    private void fadeInDialog() { 
        mDialogRootLayout.startAnimation(mFadeInAnim);
        mDialogRootLayout.setVisibility(View.VISIBLE);
    } 
 
    public void dismissDialog() { 
        if (mDialogRootLayout != null && mDialogRootLayout.getVisibility() != View.GONE) {
            fadeOutDialog(); 
        } 
    } 
 
    public void showAlertDialog(String title, String msg, String button1Text,
                final Runnable r1, String button2Text, final Runnable r2) {
        resetRotateDialog(); 
 
        if (title != null) { 
            mRotateDialogTitle.setText(title); 
            mRotateDialogTitleLayout.setVisibility(View.VISIBLE); 
        } 
 
        mRotateDialogText.setText(msg); 
 
        if (button1Text != null) { 
            mRotateDialogButton1.setText(button1Text); 
            mRotateDialogButton1.setContentDescription(button1Text); 
            mRotateDialogButton1.setVisibility(View.VISIBLE); 
            mRotateDialogButton1.setOnClickListener(new View.OnClickListener() { 
                @Override 
                public void onClick(View v) { 
                    if (r1 != null) r1.run(); 
                    dismissDialog(); 
                } 
            }); 
            mRotateDialogButtonLayout.setVisibility(View.VISIBLE); 
        } 
        if (button2Text != null) { 
            mRotateDialogButton2.setText(button2Text); 
            mRotateDialogButton2.setContentDescription(button2Text); 
            mRotateDialogButton2.setVisibility(View.VISIBLE); 
            mRotateDialogButton2.setOnClickListener(new View.OnClickListener() { 
                @Override 
                public void onClick(View v) {
                    if (r2 != null) r2.run(); 
                    dismissDialog(); 
                }