Bug 918007 - Factor out method to enable/disable buttons (r=sriram)

This commit is contained in:
Lucas Rocha 2013-10-23 14:16:39 +01:00
parent d912c6ad42
commit 0d20ffdad1

View File

@ -1564,12 +1564,17 @@ public class BrowserToolbar extends GeckoRelativeLayout
}
}
public void updateBackButton(boolean enabled) {
Drawable drawable = mBack.getDrawable();
if (drawable != null)
drawable.setAlpha(enabled ? 255 : 77);
public void setButtonEnabled(ImageButton button, boolean enabled) {
final Drawable drawable = button.getDrawable();
if (drawable != null) {
drawable.setAlpha(enabled ? 255 : 61);
}
mBack.setEnabled(enabled);
button.setEnabled(enabled);
}
public void updateBackButton(boolean enabled) {
setButtonEnabled(mBack, enabled);
}
public void updateForwardButton(final boolean enabled) {