summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherClings.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-09-14 21:55:16 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-14 21:55:16 +0000
commit54d17dff6db6847b33bf07e1af6fbaa2e3bbe19d (patch)
tree82db2e21449fd52665d7cff5f67b72ea655d185f /src/com/android/launcher3/LauncherClings.java
parentedd51ad30741098e2110e3d0533085b02cbe752c (diff)
parent00e827c70cb4213ee05140157006a37d12662448 (diff)
downloadandroid_packages_apps_Trebuchet-54d17dff6db6847b33bf07e1af6fbaa2e3bbe19d.tar.gz
android_packages_apps_Trebuchet-54d17dff6db6847b33bf07e1af6fbaa2e3bbe19d.tar.bz2
android_packages_apps_Trebuchet-54d17dff6db6847b33bf07e1af6fbaa2e3bbe19d.zip
am 00e827c7: am 5fcaab43: am ea9ad5ce: Merge remote-tracking branch \'origin/ub-launcher3-burnaby\' into mnc-dev
* commit '00e827c70cb4213ee05140157006a37d12662448': (76 commits) Restoring provider behavior for reloading app on old devices > For older devices, launcher will only reload in case of inserts with specific query parameters > For older devices, launcehr will notify content observers of any internal inserts > Chaning TAG for Launcher provider as max logging tag is only 23 characters Removing items which are on invalid screen Preventing null pointer crash when opening a folder Revert workaround for move to default screen on home intent. Fixing NPE in recycler view scroll bar. Adding workaround for regression caused by ag/752175 Adding gradle script for Android Studio Override the overscroll color for the widget rows. Adding graphic for all apps empty search screen. Using GET_UNINSTALLED_PACKAGES flag when getting packageInfo for a managed profile app Revert "Adding viewId for the QSB" Adding viewId for the QSB Fixing issue with missing scroll bar after fast-scrolling and searching. Fixing an issue where you would inadvertently start fastscrolling. Pending bind callbacks should be cleared before starting the loader, similar to startBinding Fixing widgets container inactive scroll bar color. Making the detached scrollbar catch up faster to the actual scroll position. Updating theme to use the light theme by default, instead of wallpaper theme > This allows us to use all the goodness of material theme > Cursor in folder edit text is no longer 1px wide Updating the target sdk to launcher Using the usermanager api to get creation time ...
Diffstat (limited to 'src/com/android/launcher3/LauncherClings.java')
-rw-r--r--src/com/android/launcher3/LauncherClings.java22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/com/android/launcher3/LauncherClings.java b/src/com/android/launcher3/LauncherClings.java
index c13752cb1..18fe8ef86 100644
--- a/src/com/android/launcher3/LauncherClings.java
+++ b/src/com/android/launcher3/LauncherClings.java
@@ -16,8 +16,6 @@
package com.android.launcher3;
-import android.accounts.Account;
-import android.accounts.AccountManager;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.annotation.TargetApi;
@@ -36,6 +34,7 @@ import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.accessibility.AccessibilityManager;
+
import com.android.launcher3.util.Thunk;
class LauncherClings implements OnClickListener {
@@ -44,8 +43,6 @@ class LauncherClings implements OnClickListener {
private static final String TAG_CROP_TOP_AND_SIDES = "crop_bg_top_and_sides";
- private static final boolean DISABLE_CLINGS = false;
-
private static final int SHOW_CLING_DURATION = 250;
private static final int DISMISS_CLING_DURATION = 200;
@@ -54,6 +51,7 @@ class LauncherClings implements OnClickListener {
@Thunk Launcher mLauncher;
private LayoutInflater mInflater;
+ @Thunk boolean mIsVisible;
/** Ctor */
public LauncherClings(Launcher launcher) {
@@ -94,6 +92,7 @@ class LauncherClings implements OnClickListener {
* package was not preinstalled and there exists a db to migrate from.
*/
public void showMigrationCling() {
+ mIsVisible = true;
mLauncher.hideWorkspaceSearchAndHotseat();
ViewGroup root = (ViewGroup) mLauncher.findViewById(R.id.launcher);
@@ -120,6 +119,7 @@ class LauncherClings implements OnClickListener {
}
public void showLongPressCling(boolean showWelcome) {
+ mIsVisible = true;
ViewGroup root = (ViewGroup) mLauncher.findViewById(R.id.launcher);
View cling = mInflater.inflate(R.layout.longpress_cling, root, false);
@@ -199,6 +199,7 @@ class LauncherClings implements OnClickListener {
mLauncher.getSharedPrefs().edit()
.putBoolean(flag, true)
.apply();
+ mIsVisible = false;
if (postAnimationCb != null) {
postAnimationCb.run();
}
@@ -212,13 +213,13 @@ class LauncherClings implements OnClickListener {
}
}
+ public boolean isVisible() {
+ return mIsVisible;
+ }
+
/** Returns whether the clings are enabled or should be shown */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
private boolean areClingsEnabled() {
- if (DISABLE_CLINGS) {
- return false;
- }
-
// disable clings when running in a test harness
if(ActivityManager.isRunningInTestHarness()) return false;
@@ -231,10 +232,7 @@ class LauncherClings implements OnClickListener {
// Restricted secondary users (child mode) will potentially have very few apps
// seeded when they start up for the first time. Clings won't work well with that
- boolean supportsLimitedUsers =
- android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2;
- Account[] accounts = AccountManager.get(mLauncher).getAccounts();
- if (supportsLimitedUsers && accounts.length == 0) {
+ if (Utilities.ATLEAST_JB_MR2) {
UserManager um = (UserManager) mLauncher.getSystemService(Context.USER_SERVICE);
Bundle restrictions = um.getUserRestrictions();
if (restrictions.getBoolean(UserManager.DISALLOW_MODIFY_ACCOUNTS, false)) {