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

Unverified Commit 0b642065 authored by jhenrique09's avatar jhenrique09 Committed by Michael Bestas
Browse files

VolumeDialogImpl: Fix cut layout when on setup or lock task mode

Change-Id: I20aacbda4e1a90cad3120ed6f4a65c8c884521cf
parent 51e22e2a
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -114,6 +114,18 @@
                        android:tint="?androidprv:attr/colorAccent"
                        android:tint="?androidprv:attr/colorAccent"
                        android:soundEffectsEnabled="false" />
                        android:soundEffectsEnabled="false" />
                </FrameLayout>
                </FrameLayout>
                <FrameLayout
                    android:id="@+id/rounded_border_bottom"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/volume_background_bottom"
                    android:paddingLeft="@dimen/volume_dialog_ringer_rows_padding"
                    android:paddingRight="@dimen/volume_dialog_ringer_rows_padding">
                    <View
                        android:layout_width="0dp"
                        android:layout_height="32dp"
                        android:background="@drawable/ripple_drawable_20dp"/>
                </FrameLayout>
            </LinearLayout>
            </LinearLayout>


        </LinearLayout>
        </LinearLayout>
+12 −0
Original line number Original line Diff line number Diff line
@@ -113,6 +113,18 @@
                        android:tint="?androidprv:attr/colorAccent"
                        android:tint="?androidprv:attr/colorAccent"
                        android:soundEffectsEnabled="false" />
                        android:soundEffectsEnabled="false" />
                </FrameLayout>
                </FrameLayout>
                <FrameLayout
                    android:id="@+id/rounded_border_bottom"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/volume_background_bottom"
                    android:paddingLeft="@dimen/volume_dialog_ringer_rows_padding"
                    android:paddingRight="@dimen/volume_dialog_ringer_rows_padding">
                    <View
                        android:layout_width="0dp"
                        android:layout_height="32dp"
                        android:background="@drawable/ripple_drawable_20dp"/>
                </FrameLayout>
            </LinearLayout>
            </LinearLayout>


        </LinearLayout>
        </LinearLayout>
+10 −3
Original line number Original line Diff line number Diff line
@@ -297,6 +297,8 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
    // Variable to track the default row with which the panel is initially shown
    // Variable to track the default row with which the panel is initially shown
    private VolumeRow mDefaultRow = null;
    private VolumeRow mDefaultRow = null;


    private FrameLayout mRoundedBorderBottom;

    @VisibleForTesting
    @VisibleForTesting
    final int mVolumeRingerIconDrawableId = R.drawable.ic_speaker_on;
    final int mVolumeRingerIconDrawableId = R.drawable.ic_speaker_on;
    @VisibleForTesting
    @VisibleForTesting
@@ -664,6 +666,8 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
        mSettingsView = mDialog.findViewById(R.id.settings_container);
        mSettingsView = mDialog.findViewById(R.id.settings_container);
        mSettingsIcon = mDialog.findViewById(R.id.settings);
        mSettingsIcon = mDialog.findViewById(R.id.settings);


        mRoundedBorderBottom = mDialog.findViewById(R.id.rounded_border_bottom);

        if (mRows.isEmpty()) {
        if (mRows.isEmpty()) {
            if (!AudioSystem.isSingleVolume(mContext)) {
            if (!AudioSystem.isSingleVolume(mContext)) {
                addRow(STREAM_ACCESSIBILITY, R.drawable.ic_volume_accessibility,
                addRow(STREAM_ACCESSIBILITY, R.drawable.ic_volume_accessibility,
@@ -1181,10 +1185,13 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
    }
    }


    private void initSettingsH(int lockTaskModeState) {
    private void initSettingsH(int lockTaskModeState) {
        final boolean showSettings = mDeviceProvisionedController.isCurrentUserSetup()
                && lockTaskModeState == LOCK_TASK_MODE_NONE;
        if (mRoundedBorderBottom != null) {
            mRoundedBorderBottom.setVisibility(!showSettings ? VISIBLE : GONE);
        }
        if (mSettingsView != null) {
        if (mSettingsView != null) {
            mSettingsView.setVisibility(
            mSettingsView.setVisibility(showSettings ? VISIBLE : GONE);
                    mDeviceProvisionedController.isCurrentUserSetup() &&
                            lockTaskModeState == LOCK_TASK_MODE_NONE ? VISIBLE : GONE);
        }
        }
        if (mSettingsIcon != null) {
        if (mSettingsIcon != null) {
            mSettingsIcon.setOnClickListener(v -> {
            mSettingsIcon.setOnClickListener(v -> {