Adding support for requesting addition of shortcut/widget

on the workspace.

Bug: 33584624
Change-Id: I664366822fe8088742faff2cce006239ab0771bc
This commit is contained in:
Sunny Goyal
2017-01-13 12:15:53 -08:00
parent 627006eeb4
commit 278359539c
13 changed files with 451 additions and 28 deletions

View File

@@ -18,6 +18,7 @@ package com.android.launcher3;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.graphics.Point;
@@ -326,6 +327,11 @@ public class InvariantDeviceProfile {
return rank == getAllAppsButtonRank();
}
public DeviceProfile getDeviceProfile(Context context) {
return context.getResources().getConfiguration().orientation
== Configuration.ORIENTATION_LANDSCAPE ? landscapeProfile : portraitProfile;
}
private float weight(float x0, float y0, float x1, float y1, float pow) {
float d = dist(x0, y0, x1, y1);
if (Float.compare(d, 0f) == 0) {