summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Launcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r--src/com/android/launcher2/Launcher.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index e6c25cbdc..d01de9c77 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -17,6 +17,8 @@
package com.android.launcher2;
+import android.accounts.Account;
+import android.accounts.AccountManager;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
@@ -1869,6 +1871,7 @@ public final class Launcher extends Activity
intent.setPackage(activityName.getPackageName());
}
startActivity(null, intent, "onClickVoiceButton");
+ overridePendingTransition(R.anim.fade_in_fast, R.anim.fade_out_fast);
} catch (ActivityNotFoundException e) {
Intent intent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
@@ -3466,6 +3469,7 @@ public final class Launcher extends Activity
cling.init(this, positionData);
cling.setVisibility(View.VISIBLE);
cling.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ cling.requestAccessibilityFocus();
if (animate) {
cling.buildLayer();
cling.setAlpha(0f);
@@ -3514,10 +3518,23 @@ public final class Launcher extends Activity
});
}
}
+
+ private boolean skipCustomClingIfNoAccounts() {
+ Cling cling = (Cling) findViewById(R.id.workspace_cling);
+ boolean customCling = cling.getDrawIdentifier().equals("workspace_custom");
+ if (customCling) {
+ AccountManager am = AccountManager.get(this);
+ Account[] accounts = am.getAccountsByType("com.google");
+ return accounts.length == 0;
+ }
+ return false;
+ }
+
public void showFirstRunWorkspaceCling() {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&
- !mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false)) {
+ !mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false) &&
+ !skipCustomClingIfNoAccounts() ) {
initCling(R.id.workspace_cling, null, false, 0);
} else {
removeCling(R.id.workspace_cling);