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

Commit 6c4e087c authored by Cosmin Băieș's avatar Cosmin Băieș
Browse files

Split IME Switcher menu header and item

This extracts the header (and divider) part of the IME Switcher menu
items from the actual item layout, enabling more granular control on
when and where headers should be added.

Flag: android.view.inputmethod.ime_switcher_revamp
Bug: 369120217
Test: atest InputMethodMenuControllerTest
Change-Id: Ia6b0f35be96f252ab97c380c5d8984210a15a936
parent f9491113
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2024 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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_marginHorizontal="16dp"
    android:layout_marginTop="8dp"
    android:layout_marginBottom="12dp">

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="?attr/materialColorSurfaceVariant"
        android:layout_marginStart="20dp"
        android:layout_marginEnd="24dp"
        android:importantForAccessibility="no"/>

</LinearLayout>
+37 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2024 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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_marginHorizontal="16dp"
    android:layout_marginVertical="8dp">

    <TextView
        android:id="@+id/header_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="8dp"
        android:ellipsize="end"
        android:singleLine="true"
        android:fontFamily="google-sans-text"
        android:textAppearance="?attr/textAppearance"
        android:accessibilityHeading="true"
        android:textColor="?attr/materialColorPrimary"/>

</LinearLayout>
+35 −66
Original line number Diff line number Diff line
@@ -16,43 +16,14 @@
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:paddingHorizontal="16dp"
    android:paddingBottom="8dp">

    <View
        android:id="@+id/divider"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="?attr/materialColorSurfaceVariant"
        android:layout_marginStart="20dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="24dp"
        android:layout_marginBottom="12dp"
        android:visibility="gone"
        android:importantForAccessibility="no"/>

    <TextView
        android:id="@+id/header_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="8dp"
        android:ellipsize="end"
        android:singleLine="true"
        android:fontFamily="google-sans-text"
        android:textAppearance="?attr/textAppearance"
        android:textColor="?attr/materialColorPrimary"
        android:visibility="gone"/>

    <LinearLayout
    android:id="@+id/list_item"
    android:layout_width="match_parent"
    android:layout_height="72dp"
    android:background="@drawable/input_method_switch_item_background"
    android:gravity="center_vertical"
    android:orientation="horizontal"
    android:layout_marginHorizontal="16dp"
    android:layout_marginBottom="8dp"
    android:paddingStart="20dp"
    android:paddingEnd="24dp">

@@ -87,5 +58,3 @@
        android:importantForAccessibility="no"/>

</LinearLayout>

</LinearLayout>
+2 −0
Original line number Diff line number Diff line
@@ -1580,6 +1580,8 @@
  <java-symbol type="layout" name="input_method" />
  <java-symbol type="layout" name="input_method_extract_view" />
  <java-symbol type="layout" name="input_method_switch_item" />
  <java-symbol type="layout" name="input_method_switch_item_divider" />
  <java-symbol type="layout" name="input_method_switch_item_header" />
  <java-symbol type="layout" name="input_method_switch_item_new" />
  <java-symbol type="layout" name="input_method_switch_dialog_new" />
  <java-symbol type="layout" name="input_method_switch_dialog_title" />
+246 −95

File changed.

Preview size limit exceeded, changes collapsed.

Loading