mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
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
This commit is contained in:
@@ -20,6 +20,8 @@ import android.app.Activity;
|
||||
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 @@ public abstract class BaseActivity extends Activity {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user