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