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:
Sunny Goyal
2018-03-13 09:57:05 -07:00
parent 87dd782e40
commit f633ef5f43
29 changed files with 391 additions and 251 deletions

View File

@@ -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);
}
}
}