Search in sources :

Example 1 with UserManagerCompat

use of com.android.launcher3.compat.UserManagerCompat in project Neo-Launcher by NeoApplications.

the class AppSearchProvider method listToCursor.

private Cursor listToCursor(final List<AppInfo> list) {
    final MatrixCursor matrixCursor = new MatrixCursor(AppSearchProvider.eK, list.size());
    final UserManagerCompat instance = UserManagerCompat.getInstance(this.getContext());
    int n = 0;
    for (AppInfo appInfo : list) {
        final String uri = buildUri(appInfo, instance).toString();
        final MatrixCursor.RowBuilder row = matrixCursor.newRow();
        row.add(n++).add(appInfo.title.toString()).add(uri).add("com.google.android.apps.nexuslauncher.search.APP_LAUNCH").add(uri);
    }
    return matrixCursor;
}
Also used : UserManagerCompat(com.android.launcher3.compat.UserManagerCompat) MatrixCursor(android.database.MatrixCursor) AppInfo(com.android.launcher3.AppInfo)

Example 2 with UserManagerCompat

use of com.android.launcher3.compat.UserManagerCompat in project Neo-Launcher by NeoApplications.

the class WorkModeSwitch method refresh.

public void refresh() {
    UserManagerCompat userManager = UserManagerCompat.getInstance(getContext());
    setCheckedInternal(!userManager.isAnyProfileQuietModeEnabled());
    setEnabled(true);
}
Also used : UserManagerCompat(com.android.launcher3.compat.UserManagerCompat)

Example 3 with UserManagerCompat

use of com.android.launcher3.compat.UserManagerCompat in project Neo-Launcher by NeoApplications.

the class LauncherProvider method getDefaultLayoutParser.

private DefaultLayoutParser getDefaultLayoutParser(AppWidgetHost widgetHost) {
    InvariantDeviceProfile idp = LauncherAppState.getIDP(getContext());
    int defaultLayout = idp.defaultLayoutId;
    UserManagerCompat um = UserManagerCompat.getInstance(getContext());
    if (um.isDemoUser() && idp.demoModeLayoutId != 0) {
        defaultLayout = idp.demoModeLayoutId;
    }
    return new DefaultLayoutParser(getContext(), widgetHost, mOpenHelper, getContext().getResources(), defaultLayout);
}
Also used : UserManagerCompat(com.android.launcher3.compat.UserManagerCompat)

Aggregations

UserManagerCompat (com.android.launcher3.compat.UserManagerCompat)3 MatrixCursor (android.database.MatrixCursor)1 AppInfo (com.android.launcher3.AppInfo)1