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

Commit f63942e6 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fix mute toggle behavior in Volume dialog.

Adjust some padding and alignment.

Bug: 5128528

Fix highlighted entry when using Battery shortcut.

Bug: 5099767
Change-Id: I830dbb40b0b8a6448d33b2be2c36b9b80ff14bc4
parent ce477dbd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1100,7 +1100,7 @@
            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                android:value="com.android.settings.fuelgauge.PowerUsageSummary" />
            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
                android:resource="@id/application_settings" />
                android:resource="@id/battery_settings" />
        </activity>

        <activity
+10 −9
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@
                <ImageView android:id="@+id/media_mute_button"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:padding="8dip"
                        android:padding="16dip"
                        android:background="?android:attr/selectableItemBackground"
                    />

@@ -68,7 +68,7 @@
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:paddingTop="2dip"
                        android:paddingLeft="20dip"
                        android:paddingLeft="12dip"
                        android:paddingRight="20dip" />
        </LinearLayout>

@@ -100,7 +100,7 @@
                    <ImageView android:id="@+id/ringer_mute_button"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="8dip"
                            android:padding="16dip"
                            android:background="?android:attr/selectableItemBackground"
                        />

@@ -109,7 +109,7 @@
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:paddingTop="2dip"
                            android:paddingLeft="20dip"
                            android:paddingLeft="12dip"
                            android:paddingRight="20dip" />
            </LinearLayout>

@@ -143,7 +143,7 @@
                    <ImageView android:id="@+id/notification_mute_button"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="8dip"
                            android:padding="16dip"
                            android:background="?android:attr/selectableItemBackground"
                        />

@@ -152,7 +152,7 @@
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:paddingTop="2dip"
                            android:paddingLeft="20dip"
                            android:paddingLeft="12dip"
                            android:paddingRight="20dip" />
            </LinearLayout>

@@ -173,12 +173,13 @@
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="8dip"
                android:orientation="horizontal">
                android:orientation="horizontal"
                android:gravity="center_vertical">

                <ImageView android:id="@+id/alarm_mute_button"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:padding="8dip"
                        android:padding="16dip"
                        android:background="?android:attr/selectableItemBackground"
                    />
                <SeekBar android:id="@+id/alarm_volume_seekbar"
@@ -186,7 +187,7 @@
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:paddingTop="2dip"
                        android:paddingLeft="20dip"
                        android:paddingLeft="12dip"
                        android:paddingRight="20dip" />
        </LinearLayout>

+8 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.media.AudioSystem;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
@@ -36,6 +37,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.preference.VolumePreference;
import android.provider.Settings;
import android.provider.Settings.System;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
@@ -164,10 +166,15 @@ public class RingerVolumePreference extends VolumePreference implements OnClickL
            }
        }

        final int silentableStreams = System.getInt(getContext().getContentResolver(),
                System.MODE_RINGER_STREAMS_AFFECTED,
                ((1 << AudioSystem.STREAM_NOTIFICATION) | (1 << AudioSystem.STREAM_RING)));
        // Register callbacks for mute/unmute buttons
        for (int i = 0; i < mCheckBoxes.length; i++) {
            ImageView checkbox = (ImageView) view.findViewById(CHECKBOX_VIEW_ID[i]);
            if ((silentableStreams & (1 << SEEKBAR_TYPE[i])) != 0) {
                checkbox.setOnClickListener(this);
            }
            mCheckBoxes[i] = checkbox;
        }