Merge changes from topic "am-9e348ca4-cd08-4961-920a-21d62dd2dd15" into ub-launcher3-master

* changes:
  [automerger] Using surface rotation instead of insets to determine seascape configuration am: 59d086c3ce
  Using surface rotation instead of insets to determine seascape configuration
This commit is contained in:
android-build-team Robot
2018-05-09 16:00:43 +00:00
committed by Android (Google) Code Review
9 changed files with 151 additions and 19 deletions
Binary file not shown.
@@ -0,0 +1,48 @@
/*
* Copyright (C) 2018 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.
*/
package com.android.launcher3.uioverrides;
import android.content.Context;
import android.os.Handler;
import com.android.systemui.shared.system.RotationWatcher;
/**
* Utility class for listening for rotation changes
*/
public class DisplayRotationListener extends RotationWatcher {
private final Runnable mCallback;
private Handler mHandler;
public DisplayRotationListener(Context context, Runnable callback) {
super(context);
mCallback = callback;
}
@Override
public void enable() {
if (mHandler == null) {
mHandler = new Handler();
}
super.enable();
}
@Override
protected void onRotationChanged(int i) {
mHandler.post(mCallback);
}
}
@@ -121,6 +121,11 @@ public class RecentsActivity extends BaseDraggingActivity {
dispatchDeviceProfileChanged();
mRecentsRootView.setup();
reapplyUi();
}
@Override
protected void reapplyUi() {
mRecentsRootView.dispatchInsets();
}
@@ -140,6 +145,7 @@ public class RecentsActivity extends BaseDraggingActivity {
? new InvariantDeviceProfile(this).getDeviceProfile(this)
: appState.getInvariantDeviceProfile().getDeviceProfile(this).copy(this);
}
onDeviceProfileInitiated();
}
@Override
@@ -43,6 +43,7 @@ import android.support.annotation.WorkerThread;
import android.util.Log;
import android.view.View;
import android.view.ViewTreeObserver.OnDrawListener;
import android.view.WindowManager;
import android.view.animation.Interpolator;
import com.android.launcher3.AbstractFloatingView;
@@ -541,6 +542,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
dp = dp.copy(mContext);
dp.updateInsets(insets);
}
dp.updateIsSeascape(mContext.getSystemService(WindowManager.class));
if (runningTaskTarget != null) {
mClipAnimationHelper.updateSource(overviewStackBounds, runningTaskTarget);