Skip to content

Commit

Permalink
Changed the method signature to be more consistent with the Android API.
Browse files Browse the repository at this point in the history
  • Loading branch information
johannilsson committed Feb 19, 2011
1 parent 24fbd82 commit 78373dc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
22 changes: 19 additions & 3 deletions actionbar/src/com/markupartist/android/widget/ActionBar.java
Expand Up @@ -103,9 +103,25 @@ public void setTitle(CharSequence title) {
public void setTitle(int resid) {
mTitleView.setText(resid);
}

public void setProgressVisibile(boolean isVisible) {
mProgress.setVisibility(isVisible ? View.VISIBLE : View.GONE);

/**
* Set the enabled state of the progress bar.
*
* @param One of {@link View#VISIBLE}, {@link View#INVISIBLE},
* or {@link View#GONE}.
*/
public void setProgressBarVisibility(int visibility) {
mProgress.setVisibility(visibility);
}

/**
* Returns the visibility status for the progress bar.
*
* @param One of {@link View#VISIBLE}, {@link View#INVISIBLE},
* or {@link View#GONE}.
*/
public int getProgressBarVisibility() {
return mProgress.getVisibility();
}

/**
Expand Down
Expand Up @@ -28,15 +28,15 @@ public void onCreate(Bundle savedInstanceState) {
startProgress.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
actionBar.setProgressVisibile(true);
actionBar.setProgressBarVisibility(View.VISIBLE);
}
});

Button stopProgress = (Button) findViewById(R.id.stop_progress);
stopProgress.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
actionBar.setProgressVisibile(false);
actionBar.setProgressBarVisibility(View.GONE);
}
});
}
Expand Down

0 comments on commit 78373dc

Please sign in to comment.