Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc561d1d authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Hide the Automatic brightness button on tablets when there's no support" into ics

parents 04e63173 cebfd537
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -58,8 +58,7 @@ public class BrightnessController implements ToggleSlider.Listener {
            }
            control.setChecked(automatic != 0);
        } else {
            control.setChecked(false);
            //control.hideToggle();
            control.hideToggle();
        }
        
        int value;
+14 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Slog;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
@@ -75,6 +76,19 @@ public class ToggleSlider extends RelativeLayout
        a.recycle();
    }

    /* @hide */
    public void hideToggle() {
        /* Using View.GONE makes the slider disappear */
        ViewGroup.LayoutParams params = mToggle.getLayoutParams();
        params.width = 0;
        params.height = 0;
        mToggle.setLayoutParams(params);
        mToggle.setVisibility(View.INVISIBLE);

        /* We can use GONE on the label though */
        mLabel.setVisibility(View.GONE);
    }

    public void onCheckedChanged(CompoundButton toggle, boolean checked) {
        Drawable thumb;
        Drawable slider;