public void showProgress ( boolean show ) { Log . v ( TAG , show ? "Disabling the button while showing progress" : "Enabling the button and hiding progress" ) ; setEnabled ( ! show ) ; progress . setVisibility ( show ? VISIBLE : GONE ) ; if ( show ) { icon . setVisibility ( INVISIBLE ) ; labeledLayout . setVisibility ( INVISIBLE ) ; return ; } icon . setVisibility ( shouldShowLabel ? GONE : VISIBLE ) ; labeledLayout . setVisibility ( ! shouldShowLabel ? GONE : VISIBLE ) ; }
Used to display a progress bar and disable the button .