本文整理汇总了Java中com.android.launcher3.Utilities.ATLEAST_LOLLIPOP属性的典型用法代码示例。如果您正苦于以下问题:Java Utilities.ATLEAST_LOLLIPOP属性的具体用法?Java Utilities.ATLEAST_LOLLIPOP怎么用?Java Utilities.ATLEAST_LOLLIPOP使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.android.launcher3.Utilities
的用法示例。
在下文中一共展示了Utilities.ATLEAST_LOLLIPOP属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInstance
public static UserManagerCompat getInstance(Context context) {
synchronized (sInstanceLock) {
if (sInstance == null) {
if (Utilities.isNycMR1OrAbove()) {
sInstance = new UserManagerCompatVNMr1(context.getApplicationContext());
} else if (Utilities.isNycOrAbove()) {
sInstance = new UserManagerCompatVN(context.getApplicationContext());
} else if (Utilities.ATLEAST_MARSHMALLOW) {
sInstance = new UserManagerCompatVM(context.getApplicationContext());
} else if (Utilities.ATLEAST_LOLLIPOP) {
sInstance = new UserManagerCompatVL(context.getApplicationContext());
} else if (Utilities.ATLEAST_JB_MR1) {
sInstance = new UserManagerCompatV17(context.getApplicationContext());
} else {
sInstance = new UserManagerCompatV16();
}
}
return sInstance;
}
}
示例2: processAllUsers
/**
* Verifies that entries corresponding to {@param users} exist and removes all invalid entries.
*/
public static void processAllUsers(List<UserHandleCompat> users, Context context) {
if (!Utilities.ATLEAST_LOLLIPOP) {
return;
}
UserManagerCompat userManager = UserManagerCompat.getInstance(context);
HashSet<String> validKeys = new HashSet<String>();
for (UserHandleCompat user : users) {
addAllUserKeys(userManager.getSerialNumberForUser(user), validKeys);
}
SharedPreferences prefs = context.getSharedPreferences(
LauncherFiles.MANAGED_USER_PREFERENCES_KEY,
Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
for (String key : prefs.getAll().keySet()) {
if (!validKeys.contains(key)) {
editor.remove(key);
}
}
editor.apply();
}
示例3: fromIntent
public static UserHandleCompat fromIntent(Intent intent) {
if (Utilities.ATLEAST_LOLLIPOP) {
UserHandle user = intent.getParcelableExtra(Intent.EXTRA_USER);
if (user != null) {
return UserHandleCompat.fromUser(user);
}
}
return null;
}
示例4: getInstance
public static PackageInstallerCompat getInstance(Context context) {
synchronized (sInstanceLock) {
if (sInstance == null) {
if (Utilities.ATLEAST_LOLLIPOP) {
sInstance = new PackageInstallerCompatVL(context);
} else {
sInstance = new PackageInstallerCompatV16();
}
}
return sInstance;
}
}
示例5: getInstance
public static LauncherAppsCompat getInstance(Context context) {
synchronized (sInstanceLock) {
if (sInstance == null) {
if (Utilities.ATLEAST_LOLLIPOP) {
sInstance = new LauncherAppsCompatVL(context.getApplicationContext());
} else {
sInstance = new LauncherAppsCompatV16(context.getApplicationContext());
}
}
return sInstance;
}
}
示例6: getInstance
public static AppWidgetManagerCompat getInstance(Context context) {
synchronized (sInstanceLock) {
if (sInstance == null) {
if (Utilities.ATLEAST_LOLLIPOP) {
sInstance = new AppWidgetManagerCompatVL(context.getApplicationContext());
} else {
sInstance = new AppWidgetManagerCompatV16(context.getApplicationContext());
}
}
return sInstance;
}
}
示例7: addToIntent
/**
* Adds {@link UserHandle} to the intent in for L or above.
* Pre-L the launcher doesn't support showing apps for multiple
* profiles so this is a no-op.
*/
public void addToIntent(Intent intent, String name) {
if (Utilities.ATLEAST_LOLLIPOP && mUser != null) {
intent.putExtra(name, mUser);
}
}
示例8: onFinishInflate
@Override
protected void onFinishInflate() {
super.onFinishInflate();
// This is a focus listener that proxies focus from a view into the list view. This is to
// work around the search box from getting first focus and showing the cursor.
getContentView().setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
mAppsRecyclerView.requestFocus();
}
}
});
mSearchContainer = findViewById(R.id.search_container);
if(Utilities.isAllowNightModePrefEnabled(getContext())) {
mSearchContainer.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.night_color));
}else{
if(Utilities.getDrawerBackgroundPrefEnabled(getContext()) != -1){
mSearchContainer.setBackgroundColor(Utilities.getDrawerBackgroundPrefEnabled(getContext()));
}else {
mSearchContainer.setBackgroundColor(ContextCompat.getColor(getContext(), android.R.color.white));
}
}
mSearchInput = (ExtendedEditText) findViewById(R.id.search_box_input);
// Update the hint to contain the icon.
// Prefix the original hint with two spaces. The first space gets replaced by the icon
// using span. The second space is used for a singe space character between the hint
// and the icon.
SpannableString spanned = new SpannableString(" " + mSearchInput.getHint());
spanned.setSpan(new TintedDrawableSpan(getContext(), R.drawable.ic_allapps_search),
0, 1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
mSearchInput.setHint(spanned);
mSearchContainerOffsetTop = getResources().getDimensionPixelSize(
R.dimen.all_apps_search_bar_margin_top);
mElevationController = Utilities.ATLEAST_LOLLIPOP
? new HeaderElevationController.ControllerVL(mSearchContainer)
: new HeaderElevationController.ControllerV16(mSearchContainer);
// Load the all apps recycler view
mAppsRecyclerView = (AllAppsRecyclerView) findViewById(R.id.apps_list_view);
mAppsRecyclerView.setApps(mApps);
mAppsRecyclerView.setLayoutManager(mLayoutManager);
mAppsRecyclerView.setAdapter(mAdapter);
mAppsRecyclerView.setHasFixedSize(true);
mAppsRecyclerView.addOnScrollListener(mElevationController);
mAppsRecyclerView.setElevationController(mElevationController);
if (mItemDecoration != null) {
mAppsRecyclerView.addItemDecoration(mItemDecoration);
}
FocusedItemDecorator focusedItemDecorator = new FocusedItemDecorator(mAppsRecyclerView);
mAppsRecyclerView.addItemDecoration(focusedItemDecorator);
mAppsRecyclerView.preMeasureViews(mAdapter);
mAdapter.setIconFocusListener(focusedItemDecorator.getFocusListener());
if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) {
getRevealView().setVisibility(View.VISIBLE);
getContentView().setVisibility(View.VISIBLE);
getContentView().setBackground(null);
}
}
示例9: get
public static ManagedProfileHeuristic get(Context context, UserHandleCompat user) {
if (Utilities.ATLEAST_LOLLIPOP && !UserHandleCompat.myUserHandle().equals(user)) {
return new ManagedProfileHeuristic(context, user);
}
return null;
}
示例10: onFinishInflate
@Override
protected void onFinishInflate() {
super.onFinishInflate();
// This is a focus listener that proxies focus from a view into the list view. This is to
// work around the search box from getting first focus and showing the cursor.
getContentView().setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
mAppsRecyclerView.requestFocus();
}
}
});
mSearchContainer = findViewById(R.id.search_container);
mSearchInput = (ExtendedEditText) findViewById(R.id.search_box_input);
// Update the hint to contain the icon.
// Prefix the original hint with two spaces. The first space gets replaced by the icon
// using span. The second space is used for a singe space character between the hint
// and the icon.
SpannableString spanned = new SpannableString(" " + mSearchInput.getHint());
spanned.setSpan(new TintedDrawableSpan(getContext(), R.drawable.ic_allapps_search),
0, 1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
mSearchInput.setHint(spanned);
mSearchContainerOffsetTop = getResources().getDimensionPixelSize(
R.dimen.all_apps_search_bar_margin_top);
mElevationController = Utilities.ATLEAST_LOLLIPOP
? new HeaderElevationController.ControllerVL(mSearchContainer)
: new HeaderElevationController.ControllerV16(mSearchContainer);
// Load the all apps recycler view
mAppsRecyclerView = (AllAppsRecyclerView) findViewById(R.id.apps_list_view);
mAppsRecyclerView.setApps(mApps);
mAppsRecyclerView.setLayoutManager(mLayoutManager);
mAppsRecyclerView.setAdapter(mAdapter);
mAppsRecyclerView.setHasFixedSize(true);
mAppsRecyclerView.addOnScrollListener(mElevationController);
mAppsRecyclerView.setElevationController(mElevationController);
if (mItemDecoration != null) {
mAppsRecyclerView.addItemDecoration(mItemDecoration);
}
FocusedItemDecorator focusedItemDecorator = new FocusedItemDecorator(mAppsRecyclerView);
mAppsRecyclerView.addItemDecoration(focusedItemDecorator);
mAppsRecyclerView.preMeasureViews(mAdapter);
mAdapter.setIconFocusListener(focusedItemDecorator.getFocusListener());
if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) {
getRevealView().setVisibility(View.VISIBLE);
getContentView().setVisibility(View.VISIBLE);
getContentView().setBackground(null);
}
}