Search in sources :

Example 46 with LauncherModelHelper

use of com.android.launcher3.util.LauncherModelHelper in project android_packages_apps_Launcher3 by crdroidandroid.

the class SDWorkModeTest method setup.

@Before
public void setup() throws Exception {
    mModelHelper = new LauncherModelHelper();
    mTargetContext = RuntimeEnvironment.application;
    mIdp = InvariantDeviceProfile.INSTANCE.get(mTargetContext);
    Settings.Global.putFloat(mTargetContext.getContentResolver(), Settings.Global.WINDOW_ANIMATION_SCALE, 0);
    mModelHelper.installApp(TEST_PACKAGE);
}
Also used : LauncherModelHelper(com.android.launcher3.util.LauncherModelHelper) Before(org.junit.Before)

Example 47 with LauncherModelHelper

use of com.android.launcher3.util.LauncherModelHelper in project android_packages_apps_Launcher3 by crdroidandroid.

the class LauncherUIScrollTest method setup.

@Before
public void setup() throws Exception {
    mModelHelper = new LauncherModelHelper();
    mTargetContext = RuntimeEnvironment.application;
    mIdp = InvariantDeviceProfile.INSTANCE.get(mTargetContext);
    Settings.Global.putFloat(mTargetContext.getContentResolver(), Settings.Global.WINDOW_ANIMATION_SCALE, 0);
    mModelHelper.installApp(TEST_PACKAGE);
    // LayoutBuilder with 3 workspace pages
    mLayoutBuilder = new LauncherLayoutBuilder().atWorkspace(0, mIdp.numRows - 1, 0).putApp(TEST_PACKAGE, TEST_PACKAGE).atWorkspace(0, mIdp.numRows - 1, 1).putApp(TEST_PACKAGE, TEST_PACKAGE).atWorkspace(0, mIdp.numRows - 1, 2).putApp(TEST_PACKAGE, TEST_PACKAGE);
}
Also used : LauncherLayoutBuilder(com.android.launcher3.util.LauncherLayoutBuilder) LauncherModelHelper(com.android.launcher3.util.LauncherModelHelper) Before(org.junit.Before)

Example 48 with LauncherModelHelper

use of com.android.launcher3.util.LauncherModelHelper in project android_packages_apps_Trebuchet by LineageOS.

the class AddWorkspaceItemsTaskTest method setup.

@Before
public void setup() {
    mModelHelper = new LauncherModelHelper();
    mTargetContext = RuntimeEnvironment.application;
    mIdp = InvariantDeviceProfile.INSTANCE.get(mTargetContext);
    mIdp.numColumns = mIdp.numRows = 5;
    mAppState = LauncherAppState.getInstance(mTargetContext);
    mExistingScreens = new IntArray();
    mScreenOccupancy = new IntSparseArrayMap<>();
    mNewScreens = new IntArray();
}
Also used : IntArray(com.android.launcher3.util.IntArray) LauncherModelHelper(com.android.launcher3.util.LauncherModelHelper) Before(org.junit.Before)

Example 49 with LauncherModelHelper

use of com.android.launcher3.util.LauncherModelHelper in project android_packages_apps_Trebuchet by LineageOS.

the class DefaultLayoutProviderTest method setUp.

@Before
public void setUp() {
    mModelHelper = new LauncherModelHelper();
    mTargetContext = RuntimeEnvironment.application;
    shadowOf(mTargetContext.getPackageManager()).addActivityIfNotPresent(new ComponentName(TEST_PACKAGE, TEST_PACKAGE));
}
Also used : LauncherModelHelper(com.android.launcher3.util.LauncherModelHelper) ComponentName(android.content.ComponentName) Before(org.junit.Before)

Example 50 with LauncherModelHelper

use of com.android.launcher3.util.LauncherModelHelper in project android_packages_apps_Trebuchet by LineageOS.

the class GridSizeMigrationTaskTest method setUp.

@Before
public void setUp() {
    mModelHelper = new LauncherModelHelper();
    mContext = RuntimeEnvironment.application;
    mDb = mModelHelper.provider.getDb();
    mValidPackages = new HashSet<>();
    mValidPackages.add(TEST_PACKAGE);
    mIdp = InvariantDeviceProfile.INSTANCE.get(mContext);
}
Also used : LauncherModelHelper(com.android.launcher3.util.LauncherModelHelper) Before(org.junit.Before)

Aggregations

LauncherModelHelper (com.android.launcher3.util.LauncherModelHelper)55 Before (org.junit.Before)55 Context (android.content.Context)8 InvariantDeviceProfile (com.android.launcher3.InvariantDeviceProfile)7 PackageInfo (android.content.pm.PackageInfo)6 Uri (android.net.Uri)6 UserManager (android.os.UserManager)6 IconCache (com.android.launcher3.icons.IconCache)6 CachingLogic (com.android.launcher3.icons.cache.CachingLogic)6 ItemInfo (com.android.launcher3.model.data.ItemInfo)6 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)6 IntArray (com.android.launcher3.util.IntArray)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)6 OutputStreamWriter (java.io.OutputStreamWriter)6 AppWidgetManager (android.appwidget.AppWidgetManager)5 ComponentWithLabel (com.android.launcher3.icons.ComponentWithLabel)5 ComponentName (android.content.ComponentName)4 ContentProvider (android.content.ContentProvider)4 MatrixCursor (android.database.MatrixCursor)4 ParcelFileDescriptor (android.os.ParcelFileDescriptor)4