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

Commit cbcce922 authored by Joe Onorato's avatar Joe Onorato Committed by Android (Google) Code Review
Browse files

Merge "Make the ToggleSlider in the status bar settings panel show the right...

Merge "Make the ToggleSlider in the status bar settings panel show the right track when it's disabled."
parents 1c3e3c78 4b0912d4
Loading
Loading
Loading
Loading
+1.09 KiB
Loading image diff...
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background"
            android:drawable="@*android:drawable/scrubber_track_holo_dark" />
    <item android:id="@android:id/secondaryProgress">
        <scale android:scaleWidth="100%"
                android:drawable="@*android:drawable/scrubber_track_holo_dark" />
    </item>
    <item android:id="@android:id/progress">
        <scale android:scaleWidth="100%"
                android:drawable="@*android:drawable/scrubber_track_holo_dark" />
    </item>
</layer-list>
+6 −1
Original line number Diff line number Diff line
@@ -24,10 +24,10 @@ import android.util.AttributeSet;
import android.util.Slog;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.CompoundButton;

import com.android.systemui.R;

@@ -77,13 +77,18 @@ public class ToggleSlider extends RelativeLayout

    public void onCheckedChanged(CompoundButton toggle, boolean checked) {
        Drawable thumb;
        Drawable slider;
        final Resources res = getContext().getResources();
        if (checked) {
            thumb = res.getDrawable(R.drawable.scrubber_control_disabled_holo);
            slider = res.getDrawable(R.drawable.status_bar_settings_slider_disabled);
        } else {
            thumb = res.getDrawable(R.drawable.scrubber_control_holo);
            slider = res.getDrawable(
                    com.android.internal.R.drawable.scrubber_progress_horizontal_holo_dark);
        }
        mSlider.setThumb(thumb);
        mSlider.setProgressDrawable(slider);

        if (mListener != null) {
            mListener.onChanged(this, mTracking, checked, mSlider.getProgress());