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

Commit 8923830f authored by Jagrut Desai's avatar Jagrut Desai
Browse files

Remove Change Navigation Mode option for Taskbar Divider Popup Menu

- Breakout CL part 3
- This is a breakout cl from ag/24272821 to make it more readable and atomic.
- This cl consist removal of an option from taskbar divider popup meu which is no longer required and other changes regarding the removal like ripple.

Test: Manual, Visual
Bug: 265170176
Flag: ENABLE_TASKBAR_PINNING
Change-Id: I3664df7a134cc0eb5b4ed856c7e0730ef1b75dea
parent 12d43fe4
Loading
Loading
Loading
Loading
+1 −37
Original line number Original line Diff line number Diff line
@@ -32,7 +32,7 @@
        android:clickable="true"
        android:clickable="true"
        android:gravity="center_vertical"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:orientation="horizontal"
        android:background="@drawable/top_rounded_popup_ripple"
        android:background="@drawable/rounded_popup_ripple"
        android:paddingEnd="10dp"
        android:paddingEnd="10dp"
        android:paddingStart="10dp"
        android:paddingStart="10dp"
        android:theme="@style/PopupItem">
        android:theme="@style/PopupItem">
@@ -59,40 +59,4 @@
            android:text="@string/always_show_taskbar" />
            android:text="@string/always_show_taskbar" />


    </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/navigation_mode_switch_option"
        android:layout_width="match_parent"
        android:layout_height="52dp"
        android:layout_gravity="center_vertical"
        android:elevation="2dp"
        android:clickable="true"
        android:focusable="true"
        android:background="@drawable/bottom_rounded_popup_ripple"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:paddingEnd="10dp"
        android:paddingStart="10dp"
        android:theme="@style/PopupItem">

        <View
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_margin="4dp"
            android:background="@drawable/ic_touch"
            android:backgroundTint="?android:attr/textColorPrimary" />

        <com.android.launcher3.BubbleTextView
            style="@style/BaseIcon"
            android:id="@+id/change_navigation_mode_text"
            android:gravity="start|center_vertical"
            android:textAlignment="viewStart"
            android:paddingStart="12dp"
            android:singleLine="true"
            android:ellipsize="end"
            android:textSize="14sp"
            android:textColor="?android:attr/textColorPrimary"
            android:text="@string/change_navigation_mode" />

    </LinearLayout>
</com.android.launcher3.taskbar.TaskbarDividerPopupView>
</com.android.launcher3.taskbar.TaskbarDividerPopupView>
 No newline at end of file
+0 −13
Original line number Original line Diff line number Diff line
@@ -17,7 +17,6 @@ package com.android.launcher3.taskbar


import android.annotation.SuppressLint
import android.annotation.SuppressLint
import android.content.Context
import android.content.Context
import android.content.Intent
import android.graphics.Rect
import android.graphics.Rect
import android.graphics.drawable.GradientDrawable
import android.graphics.drawable.GradientDrawable
import android.util.AttributeSet
import android.util.AttributeSet
@@ -44,9 +43,6 @@ constructor(
    companion object {
    companion object {
        private const val TAG = "TaskbarDividerPopupView"
        private const val TAG = "TaskbarDividerPopupView"
        private const val DIVIDER_POPUP_CLOSING_DELAY = 500L
        private const val DIVIDER_POPUP_CLOSING_DELAY = 500L
        private const val SETTINGS_PACKAGE_NAME = "com.android.settings"
        private const val CHANGE_NAVIGATION_MODE_ACTION =
            "com.android.settings.NAVIGATION_MODE_SETTINGS"


        @JvmStatic
        @JvmStatic
        fun createAndPopulate(
        fun createAndPopulate(
@@ -103,21 +99,12 @@ constructor(
        super.onFinishInflate()
        super.onFinishInflate()
        val taskbarSwitchOption = requireViewById<LinearLayout>(R.id.taskbar_switch_option)
        val taskbarSwitchOption = requireViewById<LinearLayout>(R.id.taskbar_switch_option)
        val alwaysShowTaskbarSwitch = requireViewById<Switch>(R.id.taskbar_pinning_switch)
        val alwaysShowTaskbarSwitch = requireViewById<Switch>(R.id.taskbar_pinning_switch)
        val navigationModeChangeOption =
            requireViewById<LinearLayout>(R.id.navigation_mode_switch_option)
        alwaysShowTaskbarSwitch.isChecked = alwaysShowTaskbarOn
        alwaysShowTaskbarSwitch.isChecked = alwaysShowTaskbarOn
        taskbarSwitchOption.setOnClickListener {
        taskbarSwitchOption.setOnClickListener {
            alwaysShowTaskbarSwitch.isClickable = true
            alwaysShowTaskbarSwitch.isClickable = true
            alwaysShowTaskbarSwitch.isChecked = !alwaysShowTaskbarOn
            alwaysShowTaskbarSwitch.isChecked = !alwaysShowTaskbarOn
            onClickAlwaysShowTaskbarSwitchOption()
            onClickAlwaysShowTaskbarSwitchOption()
        }
        }
        navigationModeChangeOption.setOnClickListener {
            context.startActivity(
                Intent(CHANGE_NAVIGATION_MODE_ACTION)
                    .setPackage(SETTINGS_PACKAGE_NAME)
                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            )
        }
    }
    }


    /** Orient object as usual and then center object horizontally. */
    /** Orient object as usual and then center object horizontally. */
+1 −4
Original line number Original line Diff line number Diff line
@@ -18,10 +18,7 @@
    <item android:id="@android:id/mask">
    <item android:id="@android:id/mask">
        <shape android:shape="rectangle">
        <shape android:shape="rectangle">
            <solid android:color="#FFFFFFFF"/>
            <solid android:color="#FFFFFFFF"/>
            <corners android:bottomLeftRadius="@dimen/dialogCornerRadius"
            <corners android:radius="@dimen/dialogCornerRadius" />
                android:bottomRightRadius="@dimen/dialogCornerRadius"
                android:topLeftRadius="0dp"
                android:topRightRadius="0dp"/>
        </shape>
        </shape>
    </item>
    </item>
</ripple>
</ripple>
 No newline at end of file
+0 −27
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 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.
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="?android:attr/colorControlHighlight">
    <item android:id="@android:id/mask">
        <shape android:shape="rectangle">
            <solid android:color="#FFFFFFFF"/>
            <corners android:bottomLeftRadius="0dp"
                android:bottomRightRadius="0dp"
                android:topLeftRadius="@dimen/dialogCornerRadius"
                android:topRightRadius="@dimen/dialogCornerRadius"/>
        </shape>
    </item>
</ripple>
 No newline at end of file