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

Commit f0e11cbb authored by Alina Zaidi's avatar Alina Zaidi Committed by Android (Google) Code Review
Browse files

Merge "Modify pin widget dialog open-close animation." into sc-dev

parents a0cb9b86 d80cec62
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@
                       android:value="true" />

        <activity android:name="com.android.launcher3.dragndrop.AddItemActivity"
            android:theme="@style/AppItemActivityTheme"
            android:theme="@style/AddItemActivityTheme"
            android:excludeFromRecents="true"
            android:autoRemoveFromRecents="true"
            android:exported="true">
+10 −10
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ import java.util.List;
 * User education dialog for hybrid hotseat. Allows user to migrate hotseat items to a new page in
 * the workspace and shows predictions on the whole hotseat
 */
public class HotseatEduDialog extends AbstractSlideInView implements Insettable {
public class HotseatEduDialog extends AbstractSlideInView<Launcher> implements Insettable {

    private static final int DEFAULT_CLOSE_DURATION = 200;
    protected static final int FINAL_SCRIM_BG_COLOR = 0x88000000;
@@ -84,7 +84,7 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable
        mHotseatWrapper = findViewById(R.id.hotseat_wrapper);
        mSampleHotseat = findViewById(R.id.sample_prediction);

        DeviceProfile grid = mLauncher.getDeviceProfile();
        DeviceProfile grid = mActivityContext.getDeviceProfile();
        Rect padding = grid.getHotseatLayoutPadding();

        mSampleHotseat.getLayoutParams().height = grid.cellHeightPx;
@@ -110,13 +110,13 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable

        mHotseatEduController.moveHotseatItems();
        mHotseatEduController.finishOnboarding();
        mLauncher.getStatsLogManager().logger().log(LAUNCHER_HOTSEAT_EDU_ACCEPT);
        mActivityContext.getStatsLogManager().logger().log(LAUNCHER_HOTSEAT_EDU_ACCEPT);
    }

    private void onDismiss(View v) {
        mHotseatEduController.showDimissTip();
        mHotseatEduController.finishOnboarding();
        mLauncher.getStatsLogManager().logger().log(LAUNCHER_HOTSEAT_EDU_DENY);
        mActivityContext.getStatsLogManager().logger().log(LAUNCHER_HOTSEAT_EDU_DENY);
        handleClose(true);
    }

@@ -131,12 +131,12 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable
        int rightInset = insets.right - mInsets.right;
        int bottomInset = insets.bottom - mInsets.bottom;
        mInsets.set(insets);
        if (mLauncher.getOrientation() == Configuration.ORIENTATION_PORTRAIT) {
        if (mActivityContext.getOrientation() == Configuration.ORIENTATION_PORTRAIT) {
            setPadding(leftInset, getPaddingTop(), rightInset, 0);
            mHotseatWrapper.setPadding(mHotseatWrapper.getPaddingLeft(), getPaddingTop(),
                    mHotseatWrapper.getPaddingRight(), bottomInset);
            mHotseatWrapper.getLayoutParams().height =
                    mLauncher.getDeviceProfile().hotseatBarSizePx + insets.bottom;
                    mActivityContext.getDeviceProfile().hotseatBarSizePx + insets.bottom;

        } else {
            setPadding(0, getPaddingTop(), 0, 0);
@@ -178,7 +178,7 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable
    }

    private void populatePreview(List<WorkspaceItemInfo> predictions) {
        for (int i = 0; i < mLauncher.getDeviceProfile().numShownHotseatIcons; i++) {
        for (int i = 0; i < mActivityContext.getDeviceProfile().numShownHotseatIcons; i++) {
            WorkspaceItemInfo info = predictions.get(i);
            PredictedAppIcon icon = PredictedAppIcon.createIcon(mSampleHotseat, info);
            icon.setEnabled(false);
@@ -194,13 +194,13 @@ public class HotseatEduDialog extends AbstractSlideInView implements Insettable
     */
    public void show(List<WorkspaceItemInfo> predictions) {
        if (getParent() != null
                || predictions.size() < mLauncher.getDeviceProfile().numShownHotseatIcons
                || predictions.size() < mActivityContext.getDeviceProfile().numShownHotseatIcons
                || mHotseatEduController == null) {
            return;
        }
        AbstractFloatingView.closeAllOpenViews(mLauncher);
        AbstractFloatingView.closeAllOpenViews(mActivityContext);
        attachToContainer();
        mLauncher.getStatsLogManager().logger().log(LAUNCHER_HOTSEAT_EDU_SEEN);
        mActivityContext.getStatsLogManager().logger().log(LAUNCHER_HOTSEAT_EDU_SEEN);
        animateOpen();
        populatePreview(predictions);
    }
+71 −55
Original line number Diff line number Diff line
@@ -16,12 +16,24 @@
** limitations under the License.
*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/add_item_confirmation"
<com.android.launcher3.dragndrop.AddItemDragLayer
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/add_item_drag_layer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:importantForAccessibility="no">

    <com.android.launcher3.widget.AddItemWidgetsBottomSheet
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/add_item_bottom_sheet"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/add_item_dialog_background"
        android:padding="24dp"
        android:theme="?attr/widgetsTheme"
        android:layout_gravity="bottom"
        android:orientation="vertical">

        <TextView
@@ -81,4 +93,8 @@
                android:onClick="onPlaceAutomaticallyClick"
                android:text="@string/add_to_home_screen"/>
        </LinearLayout>
</LinearLayout>
    </com.android.launcher3.widget.AddItemWidgetsBottomSheet>

</com.android.launcher3.dragndrop.AddItemDragLayer>

+3 −7
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* Copyright (C) 2018 The Android Open Source Project
* Copyright (C) 2008 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.
@@ -18,11 +18,7 @@
-->

<resources>

    <style name="AppItemActivityTheme" parent="@android:style/Theme.DeviceDefault.Dialog.Alert">
    <style name="AddItemActivityTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
        <item name="widgetsTheme">@style/WidgetContainerTheme.Dark</item>
        <item name="android:windowBackground">@drawable/add_item_dialog_background</item>
        <item name="android:windowNoTitle">true</item>
    </style>

</resources>
+4 −6
Original line number Diff line number Diff line
@@ -149,12 +149,6 @@
    <style name="AppTheme.Dark.DarkMainColor" parent="@style/LauncherTheme.Dark.DarkMainColor" />
    <style name="AppTheme.Dark.DarkText" parent="@style/LauncherTheme.Dark.DarkText" />

    <style name="AppItemActivityTheme" parent="@android:style/Theme.DeviceDefault.Light.Dialog.Alert">
        <item name="widgetsTheme">@style/WidgetContainerTheme</item>
        <item name="android:windowBackground">@drawable/add_item_dialog_background</item>
        <item name="android:windowNoTitle">true</item>
    </style>

    <style name="HomeSettingsTheme" parent="@android:style/Theme.DeviceDefault.Settings">
        <item name="android:navigationBarColor">?android:colorPrimaryDark</item>
        <item name="preferenceTheme">@style/HomeSettingsPreferenceTheme</item>
@@ -291,4 +285,8 @@
    <style name="Widget.DeviceDefault.Button.Rounded.Colored" parent="@android:style/Widget.DeviceDefault.Button.Colored">
        <item name="android:background">@drawable/add_item_dialog_button_background</item>
    </style>

    <style name="AddItemActivityTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
        <item name="widgetsTheme">@style/WidgetContainerTheme</item>
    </style>
</resources>
Loading