Merge "[1/n] Move Letterbox education dialog classes" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
812e329173
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 The Android Open Source Project
|
~ Copyright (C) 2023 The Android Open Source Project
|
||||||
~
|
~
|
||||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
~ you may not use this file except in compliance with the License.
|
~ you may not use this file except in compliance with the License.
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
~ See the License for the specific language governing permissions and
|
~ See the License for the specific language governing permissions and
|
||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
<com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogLayout
|
<com.android.wm.shell.compatui.LetterboxEduDialogLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
style="@style/LetterboxDialog">
|
style="@style/LetterboxDialog">
|
||||||
@@ -78,13 +78,13 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="48dp">
|
android:paddingTop="48dp">
|
||||||
|
|
||||||
<com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogActionLayout
|
<com.android.wm.shell.compatui.LetterboxEduDialogActionLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:icon="@drawable/letterbox_education_ic_reposition"
|
app:icon="@drawable/letterbox_education_ic_reposition"
|
||||||
app:text="@string/letterbox_education_reposition_text"/>
|
app:text="@string/letterbox_education_reposition_text"/>
|
||||||
|
|
||||||
<com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogActionLayout
|
<com.android.wm.shell.compatui.LetterboxEduDialogActionLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart=
|
android:layout_marginStart=
|
||||||
@@ -118,4 +118,4 @@
|
|||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
</com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogLayout>
|
</com.android.wm.shell.compatui.LetterboxEduDialogLayout>
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ import com.android.wm.shell.common.DockStateReader;
|
|||||||
import com.android.wm.shell.common.ShellExecutor;
|
import com.android.wm.shell.common.ShellExecutor;
|
||||||
import com.android.wm.shell.common.SyncTransactionQueue;
|
import com.android.wm.shell.common.SyncTransactionQueue;
|
||||||
import com.android.wm.shell.compatui.CompatUIWindowManager.CompatUIHintsState;
|
import com.android.wm.shell.compatui.CompatUIWindowManager.CompatUIHintsState;
|
||||||
import com.android.wm.shell.compatui.letterboxedu.LetterboxEduWindowManager;
|
|
||||||
import com.android.wm.shell.sysui.KeyguardChangeListener;
|
import com.android.wm.shell.sysui.KeyguardChangeListener;
|
||||||
import com.android.wm.shell.sysui.ShellController;
|
import com.android.wm.shell.sysui.ShellController;
|
||||||
import com.android.wm.shell.sysui.ShellInit;
|
import com.android.wm.shell.sysui.ShellInit;
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ import com.android.wm.shell.ShellTaskOrganizer;
|
|||||||
import com.android.wm.shell.common.DisplayLayout;
|
import com.android.wm.shell.common.DisplayLayout;
|
||||||
import com.android.wm.shell.common.SyncTransactionQueue;
|
import com.android.wm.shell.common.SyncTransactionQueue;
|
||||||
import com.android.wm.shell.compatui.CompatUIController.CompatUICallback;
|
import com.android.wm.shell.compatui.CompatUIController.CompatUICallback;
|
||||||
import com.android.wm.shell.compatui.letterboxedu.LetterboxEduWindowManager;
|
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 The Android Open Source Project
|
* Copyright (C) 2023 The Android Open Source Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.android.wm.shell.compatui.letterboxedu;
|
package com.android.wm.shell.compatui;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 The Android Open Source Project
|
* Copyright (C) 2023 The Android Open Source Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.android.wm.shell.compatui.letterboxedu;
|
package com.android.wm.shell.compatui;
|
||||||
|
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -26,7 +26,6 @@ import android.widget.TextView;
|
|||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
|
||||||
import com.android.wm.shell.R;
|
import com.android.wm.shell.R;
|
||||||
import com.android.wm.shell.compatui.DialogContainerSupplier;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Container for Letterbox Education Dialog and background dim.
|
* Container for Letterbox Education Dialog and background dim.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 The Android Open Source Project
|
* Copyright (C) 2023 The Android Open Source Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.android.wm.shell.compatui.letterboxedu;
|
package com.android.wm.shell.compatui;
|
||||||
|
|
||||||
import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING;
|
import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING;
|
||||||
|
|
||||||
@@ -36,8 +36,6 @@ import com.android.wm.shell.ShellTaskOrganizer;
|
|||||||
import com.android.wm.shell.common.DisplayLayout;
|
import com.android.wm.shell.common.DisplayLayout;
|
||||||
import com.android.wm.shell.common.DockStateReader;
|
import com.android.wm.shell.common.DockStateReader;
|
||||||
import com.android.wm.shell.common.SyncTransactionQueue;
|
import com.android.wm.shell.common.SyncTransactionQueue;
|
||||||
import com.android.wm.shell.compatui.CompatUIWindowManagerAbstract;
|
|
||||||
import com.android.wm.shell.compatui.DialogAnimationController;
|
|
||||||
import com.android.wm.shell.transition.Transitions;
|
import com.android.wm.shell.transition.Transitions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,7 +54,6 @@ import com.android.wm.shell.common.DisplayLayout;
|
|||||||
import com.android.wm.shell.common.DockStateReader;
|
import com.android.wm.shell.common.DockStateReader;
|
||||||
import com.android.wm.shell.common.ShellExecutor;
|
import com.android.wm.shell.common.ShellExecutor;
|
||||||
import com.android.wm.shell.common.SyncTransactionQueue;
|
import com.android.wm.shell.common.SyncTransactionQueue;
|
||||||
import com.android.wm.shell.compatui.letterboxedu.LetterboxEduWindowManager;
|
|
||||||
import com.android.wm.shell.sysui.ShellController;
|
import com.android.wm.shell.sysui.ShellController;
|
||||||
import com.android.wm.shell.sysui.ShellInit;
|
import com.android.wm.shell.sysui.ShellInit;
|
||||||
import com.android.wm.shell.transition.Transitions;
|
import com.android.wm.shell.transition.Transitions;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 The Android Open Source Project
|
* Copyright (C) 2023 The Android Open Source Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.android.wm.shell.compatui.letterboxedu;
|
package com.android.wm.shell.compatui;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
@@ -58,9 +58,8 @@ public class LetterboxEduDialogLayoutTest extends ShellTestCase {
|
|||||||
public void setUp() {
|
public void setUp() {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
|
|
||||||
mLayout = (LetterboxEduDialogLayout)
|
mLayout = (LetterboxEduDialogLayout) LayoutInflater.from(mContext)
|
||||||
LayoutInflater.from(mContext).inflate(R.layout.letterbox_education_dialog_layout,
|
.inflate(R.layout.letterbox_education_dialog_layout, null);
|
||||||
null);
|
|
||||||
mDismissButton = mLayout.findViewById(R.id.letterbox_education_dialog_dismiss_button);
|
mDismissButton = mLayout.findViewById(R.id.letterbox_education_dialog_dismiss_button);
|
||||||
mDialogContainer = mLayout.findViewById(R.id.letterbox_education_dialog_container);
|
mDialogContainer = mLayout.findViewById(R.id.letterbox_education_dialog_container);
|
||||||
mLayout.setDismissOnClickListener(mDismissCallback);
|
mLayout.setDismissOnClickListener(mDismissCallback);
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 The Android Open Source Project
|
* Copyright (C) 2023 The Android Open Source Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.android.wm.shell.compatui.letterboxedu;
|
package com.android.wm.shell.compatui;
|
||||||
|
|
||||||
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
|
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
|
||||||
|
|
||||||
@@ -56,7 +56,6 @@ import com.android.wm.shell.ShellTestCase;
|
|||||||
import com.android.wm.shell.common.DisplayLayout;
|
import com.android.wm.shell.common.DisplayLayout;
|
||||||
import com.android.wm.shell.common.DockStateReader;
|
import com.android.wm.shell.common.DockStateReader;
|
||||||
import com.android.wm.shell.common.SyncTransactionQueue;
|
import com.android.wm.shell.common.SyncTransactionQueue;
|
||||||
import com.android.wm.shell.compatui.DialogAnimationController;
|
|
||||||
import com.android.wm.shell.transition.Transitions;
|
import com.android.wm.shell.transition.Transitions;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
@@ -400,15 +399,16 @@ public class LetterboxEduWindowManagerTest extends ShellTestCase {
|
|||||||
false, isDocked);
|
false, isDocked);
|
||||||
}
|
}
|
||||||
|
|
||||||
private LetterboxEduWindowManager createWindowManager(boolean eligible,
|
private LetterboxEduWindowManager createWindowManager(boolean eligible, int userId,
|
||||||
int userId, boolean isTaskbarEduShowing) {
|
boolean isTaskbarEduShowing) {
|
||||||
return createWindowManager(eligible, userId, isTaskbarEduShowing, /* isDocked */false);
|
return createWindowManager(eligible, userId, isTaskbarEduShowing, /* isDocked */false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private LetterboxEduWindowManager createWindowManager(boolean eligible,
|
private LetterboxEduWindowManager createWindowManager(boolean eligible, int userId,
|
||||||
int userId, boolean isTaskbarEduShowing, boolean isDocked) {
|
boolean isTaskbarEduShowing, boolean isDocked) {
|
||||||
doReturn(isDocked).when(mDockStateReader).isDocked();
|
doReturn(isDocked).when(mDockStateReader).isDocked();
|
||||||
LetterboxEduWindowManager windowManager = new LetterboxEduWindowManager(mContext,
|
LetterboxEduWindowManager
|
||||||
|
windowManager = new LetterboxEduWindowManager(mContext,
|
||||||
createTaskInfo(eligible, userId), mSyncTransactionQueue, mTaskListener,
|
createTaskInfo(eligible, userId), mSyncTransactionQueue, mTaskListener,
|
||||||
createDisplayLayout(), mTransitions, mOnDismissCallback,
|
createDisplayLayout(), mTransitions, mOnDismissCallback,
|
||||||
mAnimationController, mDockStateReader);
|
mAnimationController, mDockStateReader);
|
||||||
Reference in New Issue
Block a user