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

Commit 3b28d923 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fine tune Widget library" into sc-dev

parents 90b85f3e bba370ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ public class FooterPreference extends Preference {
    private void init() {
        setLayoutResource(R.layout.preference_footer);
        if (getIcon() == null) {
            setIcon(R.drawable.ic_info_outline_24);
            setIcon(R.drawable.settingslib_ic_info_outline_24);
        }
        setOrder(ORDER_FOOTER);
        if (TextUtils.isEmpty(getKey())) {
+0 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
  -->

<resources xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <color name="settingslib_switchbar_background_color">@*android:color/material_grey_600</color>
    <color name="settingslib_switchbar_switch_track_tint">#BFFFFFFF</color>
    <color name="settingslib_switchbar_switch_thumb_tint">@android:color/white</color>
</resources>
+10 −9
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public class MainSwitchBar extends LinearLayout implements CompoundButton.OnChec
            final TypedArray a = context.obtainStyledAttributes(
                    new int[]{android.R.attr.colorAccent});
            mBackgroundActivatedColor = a.getColor(0, 0);
            mBackgroundColor = context.getColor(R.color.settingslib_switchbar_background_color);
            mBackgroundColor = context.getColor(R.color.material_grey_600);
            a.recycle();
        }

@@ -89,11 +89,12 @@ public class MainSwitchBar extends LinearLayout implements CompoundButton.OnChec
        mFrameView = findViewById(R.id.frame);
        mTextView = (TextView) findViewById(R.id.switch_text);
        mSwitch = (Switch) findViewById(android.R.id.switch_widget);
        if (BuildCompat.isAtLeastS()) {
            mBackgroundOn = getContext().getDrawable(R.drawable.settingslib_switch_bar_bg_on);
            mBackgroundOff = getContext().getDrawable(R.drawable.settingslib_switch_bar_bg_off);
            mBackgroundDisabled = getContext().getDrawable(
                    R.drawable.settingslib_switch_bar_bg_disabled);

        }
        addOnSwitchChangeListener((switchView, isChecked) -> setChecked(isChecked));

        setChecked(mSwitch.isChecked());
@@ -195,10 +196,8 @@ public class MainSwitchBar extends LinearLayout implements CompoundButton.OnChec
     * Remove a listener for switch changes
     */
    public void removeOnSwitchChangeListener(OnMainSwitchChangeListener listener) {
        if (mSwitchChangeListeners.contains(listener)) {
        mSwitchChangeListeners.remove(listener);
    }
    }

    /**
     * Enable or disable the text and switch.
@@ -268,10 +267,12 @@ public class MainSwitchBar extends LinearLayout implements CompoundButton.OnChec

        public static final Parcelable.Creator<SavedState> CREATOR =
                new Parcelable.Creator<SavedState>() {
                    @Override
                    public SavedState createFromParcel(Parcel in) {
                        return new SavedState(in);
                    }

                    @Override
                    public SavedState[] newArray(int size) {
                        return new SavedState[size];
                    }
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
    <!-- Dialog accent color -->
    <color name="settingslib_dialog_accent">@android:color/system_accent1_600</color>
    <!-- Dialog background color -->
    <color name="settingslib_dialog_background">@android:color/system_neutral1_800</color>
    <color name="settingslib_dialog_background">@*android:color/surface_light</color>
    <!-- Dialog error color. -->
    <color name="settingslib_dialog_colorError">#d93025</color> <!-- Red 600 -->

Loading