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

Commit 651077bd authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Adding app widget restore support in Launcher3 for android L

When the app is restored, it displays placeholders for all pending widgets.
These placeholders can be moved and removed similar to a widget (size is fixed
to what defined in backup). Once the system notifies the launcher of the new
widget ids, the place holders are replaced with actual widgets.

issue: 10779035

Change-Id: I68cbe4da01e9ca2978cb4471a7c645d2aa592055
parent 82cc3fe6
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -188,6 +188,13 @@
            </intent-filter>
        </receiver>

        <!-- Intent received used to initialize a restored widget -->
        <receiver android:name="com.android.launcher3.AppWidgetsRestoredReceiver" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_HOST_RESTORED"/>
            </intent-filter>
        </receiver>

        <!-- New user initialization; set up initial wallpaper -->
        <receiver
            android:name="com.android.launcher3.UserInitializeReceiver"
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >

    <corners android:radius="5dp" />

    <solid android:color="@android:color/white" />

</shape>
 No newline at end of file
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 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.
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="20dip"
    android:paddingRight="20dip"
    android:layout_margin="10dip"
    android:gravity="center"
    android:background="@drawable/bg_appwidget_not_ready"
    android:textAppearance="?android:attr/textAppearanceMediumInverse"
    android:textColor="@color/appwidget_not_ready_color"
    android:text="@string/gadget_pending_text"
    />
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
    <color name="bubble_dark_background">#20000000</color>

    <color name="appwidget_error_color">#FCCC</color>
    <color name="appwidget_not_ready_color">#F48F</color>

    <color name="workspace_all_apps_and_delete_zone_text_color">#CCFFFFFF</color>
    <color name="workspace_all_apps_and_delete_zone_text_shadow_color">#A0000000</color>
+3 −0
Original line number Diff line number Diff line
@@ -190,6 +190,9 @@ s -->
    <!-- Text to show user in place of a gadget when we can't display it properly -->
    <string name="gadget_error_text">Problem loading widget</string>

    <!-- Text to show user in place of a gadget when it is not yet ready/initialized. -->
    <string name="gadget_pending_text" translatable="false">Widget not ready</string>

    <!-- Text to inform the user that they can't uninstall a system application -->
    <string name="uninstall_system_app_text">This is a system app and can\'t be uninstalled.</string>

Loading