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

Commit 26b17465 authored by Tony Wickham's avatar Tony Wickham Committed by Tony
Browse files

Add support for system shortcuts in popup container

- Currently the system shortcuts are just widgets and app info
- As shortcuts, they live in ShortcutsItemView
- They are populated either as icons only (if there are deep
  shortcuts) or as icons + text
- Widgets are disabled until binding them is complete (we request for
  them to be bound on long-press now). We should revisit this.

Bug: 34940468
Change-Id: Ia51d002c3b3ede87658bdab57abfc3eeca1ed242
parent 4a907d0f
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@

    <com.android.launcher3.shortcuts.DeepShortcutTextView
        style="@style/BaseIcon"
        android:id="@+id/deep_shortcut"
        android:id="@+id/bubble_text"
        android:background="?android:attr/selectableItemBackground"
        android:gravity="start|center_vertical"
        android:textAlignment="viewStart"
@@ -34,8 +34,7 @@
        android:fontFamily="sans-serif"
        launcher:layoutHorizontal="true"
        launcher:iconDisplay="shortcut_popup"
        launcher:iconSizeOverride="@dimen/deep_shortcut_icon_size"
        android:elevation="@dimen/deep_shortcuts_elevation" />
        launcher:iconSizeOverride="@dimen/deep_shortcut_icon_size" />

    <View
        android:id="@+id/icon"
+50 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->

<com.android.launcher3.shortcuts.DeepShortcutView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:launcher="http://schemas.android.com/apk/res-auto"
    android:layout_width="@dimen/bg_popup_item_width"
    android:layout_height="@dimen/bg_popup_item_height" >

    <com.android.launcher3.BubbleTextView
        style="@style/BaseIcon"
        android:id="@+id/bubble_text"
        android:background="?android:attr/selectableItemBackground"
        android:gravity="start|center_vertical"
        android:textAlignment="viewStart"
        android:paddingStart="@dimen/bg_popup_item_height"
        android:paddingEnd="@dimen/deep_shortcut_padding_end"
        android:textSize="14sp"
        android:fontFamily="sans-serif"
        launcher:layoutHorizontal="true" />

    <View
        android:id="@+id/icon"
        android:layout_width="@dimen/system_shortcut_icon_size"
        android:layout_height="@dimen/system_shortcut_icon_size"
        android:layout_margin="@dimen/system_shortcut_padding_start"
        android:layout_gravity="start" />

    <View
        android:id="@+id/divider"
        android:layout_width="@dimen/deep_shortcuts_divider_width"
        android:layout_height="@dimen/popup_item_divider_height"
        android:layout_gravity="end|bottom"
        android:visibility="gone"
        android:background="?android:attr/listDivider" />

</com.android.launcher3.shortcuts.DeepShortcutView>
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->

<ImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="@dimen/deep_shortcut_icon_size"
    android:layout_height="@dimen/deep_shortcut_icon_size"
    android:background="?android:attr/selectableItemBackground"
    android:layout_marginEnd="@dimen/deep_shortcut_padding_start"
    android:padding="4dp" />
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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:id="@+id/system_shortcut_icons"
    android:layout_width="match_parent"
    android:layout_height="@dimen/bg_popup_item_height"
    android:paddingEnd="@dimen/deep_shortcut_padding_start"
    android:orientation="horizontal"
    android:gravity="end|center_vertical"
    android:background="@color/notification_header_background_color" />
+1 −15
Original line number Diff line number Diff line
@@ -47,19 +47,5 @@
        launcher:iconSizeOverride="@dimen/widget_section_icon_size"
        launcher:layoutHorizontal="true" />

    <HorizontalScrollView
        android:id="@+id/widgets_scroll_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?android:attr/colorPrimaryDark"
        android:scrollbars="none">
        <LinearLayout
            android:id="@+id/widgets_cell_list"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingStart="@dimen/widget_row_padding"
            android:paddingEnd="0dp"
            android:orientation="horizontal"
            android:showDividers="none"/>
    </HorizontalScrollView>
    <include layout="@layout/widgets_scroll_container" />
</LinearLayout>
Loading