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

Commit 936749e8 authored by Ats Jenk's avatar Ats Jenk
Browse files

Create a shortcut to open bubbles

Allow launching bubbles via a shortcut that is pinned to the home
screen.
When there are no bubbles open, open the bubbles overflow view.
When there are bubbles, open and select the first bubble.
Create an activity in wmshell to handle creating the shortcut and
handling clicking on the shortcut.

Flag: com.android.wm.shell.enable_retrievable_bubbles
Bug: 340337839
Test: manual
Change-Id: If5e2941f265945f78c73fa163f306f1d9bc4d274
parent d24a0c2c
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -30,5 +30,29 @@
            android:excludeFromRecents="true"
            android:launchMode="singleInstance"
            android:theme="@style/DesktopWallpaperTheme" />

        <activity
            android:name=".bubbles.shortcut.CreateBubbleShortcutActivity"
            android:exported="true"
            android:excludeFromRecents="true"
            android:theme="@android:style/Theme.NoDisplay"
            android:label="Bubbles"
            android:icon="@drawable/ic_bubbles_shortcut_widget">
            <intent-filter>
                <action android:name="android.intent.action.CREATE_SHORTCUT" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity
            android:name=".bubbles.shortcut.ShowBubblesActivity"
            android:exported="true"
            android:excludeFromRecents="true"
            android:theme="@android:style/Theme.NoDisplay" >
            <intent-filter>
                <action android:name="com.android.wm.shell.bubbles.action.SHOW_BUBBLES"/>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
</manifest>
+19 −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.
  -->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_bubbles_shortcut_widget_background" />
    <foreground android:drawable="@drawable/ic_bubbles_shortcut_widget_foreground" />
</adaptive-icon>
+24 −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.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="108"
    android:viewportHeight="108">
  <path
      android:pathData="M0,0h108v108h-108z"
      android:fillColor="#FFC20C"/>
</vector>
+36 −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.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="24"
    android:viewportHeight="24"
    android:tint="@android:color/white">
  <group android:scaleX="0.58"
      android:scaleY="0.58"
      android:translateX="5.04"
      android:translateY="5.04">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M7.2,14.4m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0"/>
    <path
        android:fillColor="@android:color/white"
        android:pathData="M14.8,18m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"/>
    <path
        android:fillColor="@android:color/white"
        android:pathData="M15.2,8.8m-4.8,0a4.8,4.8 0,1 1,9.6 0a4.8,4.8 0,1 1,-9.6 0"/>
  </group>
</vector>
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
@@ -182,6 +182,12 @@
    <!-- Content description to tell the user a bubble has been dismissed. -->
    <string name="accessibility_bubble_dismissed">Bubble dismissed.</string>

    <!-- Label used to for bubbles shortcut [CHAR_LIMIT=10] -->
    <string name="bubble_shortcut_label">Bubbles</string>

    <!-- Longer label used to for bubbles shortcut, shown if there is enough space [CHAR_LIMIT=25] -->
    <string name="bubble_shortcut_long_label">Show Bubbles</string>

    <!-- Description of the restart button in the hint of size compatibility mode. [CHAR LIMIT=NONE] -->
    <string name="restart_button_description">Tap to restart this app for a better view</string>

Loading