Adding fallback recents activity
> Refactoring RecentsView to a common base class
> Moving some dependency form Launcher to BaseActivity
> Using the Recents view in RecentsActivity
Change-Id: Ie0e6741d356291e77420798c140c999121de3a0d
diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java
index 12db3b6..77a430b 100644
--- a/src/com/android/launcher3/BaseActivity.java
+++ b/src/com/android/launcher3/BaseActivity.java
@@ -20,6 +20,8 @@
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
+import android.graphics.Point;
+import android.view.Display;
import android.view.View.AccessibilityDelegate;
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
@@ -102,4 +104,17 @@
mDPChangeListeners.get(i).onDeviceProfileChanged(mDeviceProfile);
}
}
+
+ /**
+ * Sets the device profile, adjusting it accordingly in case of multi-window
+ */
+ protected void setDeviceProfile(DeviceProfile dp) {
+ mDeviceProfile = dp;
+ if (isInMultiWindowModeCompat()) {
+ Display display = getWindowManager().getDefaultDisplay();
+ Point mwSize = new Point();
+ display.getSize(mwSize);
+ mDeviceProfile = mDeviceProfile.getMultiWindowProfile(this, mwSize);
+ }
+ }
}