summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-09-24 11:01:23 -0700
committerWinson Chung <winsonc@google.com>2013-09-24 11:09:57 -0700
commite6eabffd39c85b4cdb022c5e803ed561d87bd88b (patch)
tree2963c135f937e99205fc29b0f5c7b8d02bec5fd8 /src/com
parent1e4e6ddb38d0b867d0564be834f3425ed53d46e1 (diff)
downloadandroid_packages_apps_Trebuchet-e6eabffd39c85b4cdb022c5e803ed561d87bd88b.tar.gz
android_packages_apps_Trebuchet-e6eabffd39c85b4cdb022c5e803ed561d87bd88b.tar.bz2
android_packages_apps_Trebuchet-e6eabffd39c85b4cdb022c5e803ed561d87bd88b.zip
Launcher changes to support custom cling hints.
Change-Id: Ic381f43b96fb15a7a485b139635795e89564cc3b
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher3/Cling.java7
-rw-r--r--src/com/android/launcher3/Launcher.java45
2 files changed, 40 insertions, 12 deletions
diff --git a/src/com/android/launcher3/Cling.java b/src/com/android/launcher3/Cling.java
index 963702ae2..7ca699030 100644
--- a/src/com/android/launcher3/Cling.java
+++ b/src/com/android/launcher3/Cling.java
@@ -24,6 +24,7 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
@@ -55,7 +56,7 @@ public class Cling extends FrameLayout implements Insettable, View.OnLongClickLi
private static String FOLDER_LANDSCAPE = "folder_landscape";
private static String FOLDER_LARGE = "folder_large";
- private static float FIRST_RUN_CIRCLE_BUFFER_DPS = 40;
+ private static float FIRST_RUN_CIRCLE_BUFFER_DPS = 60;
private static float WORKSPACE_INNER_CIRCLE_RADIUS_DPS = 50;
private static float WORKSPACE_OUTER_CIRCLE_RADIUS_DPS = 60;
private static float WORKSPACE_CIRCLE_Y_OFFSET_DPS = 30;
@@ -101,8 +102,10 @@ public class Cling extends FrameLayout implements Insettable, View.OnLongClickLi
mErasePaint.setAlpha(0);
mErasePaint.setAntiAlias(true);
+ int circleColor = getResources().getColor(
+ R.color.first_run_cling_circle_background_color);
mBubblePaint = new Paint();
- mBubblePaint.setColor(0xFFFFFF);
+ mBubblePaint.setColor(circleColor);
mBubblePaint.setAntiAlias(true);
mDotPaint = new Paint();
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 3bbb39ee3..cde36120d 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -274,6 +274,7 @@ public class Launcher extends Activity
private boolean mVisible = false;
private boolean mAttached = false;
private static final boolean DISABLE_CLINGS = true;
+ private static final boolean DISABLE_CUSTOM_CLINGS = true;
private static LocaleConfiguration sLocaleConfiguration = null;
@@ -4166,16 +4167,33 @@ public class Launcher extends Activity
// If we're not using the default workspace layout, replace workspace cling
// with a custom workspace cling (usually specified in an overlay)
// For now, only do this on tablets
- if (mSharedPrefs.getInt(LauncherProvider.DEFAULT_WORKSPACE_RESOURCE_ID, 0) != 0 &&
- getResources().getBoolean(R.bool.config_useCustomClings)) {
- // Use a custom cling
- View cling = findViewById(R.id.workspace_cling);
- ViewGroup clingParent = (ViewGroup) cling.getParent();
- int clingIndex = clingParent.indexOfChild(cling);
- clingParent.removeViewAt(clingIndex);
- View customCling = mInflater.inflate(R.layout.custom_workspace_cling, clingParent, false);
- clingParent.addView(customCling, clingIndex);
- customCling.setId(R.id.workspace_cling);
+ if (!DISABLE_CUSTOM_CLINGS) {
+ if (mSharedPrefs.getInt(LauncherProvider.DEFAULT_WORKSPACE_RESOURCE_ID, 0) != 0 &&
+ getResources().getBoolean(R.bool.config_useCustomClings)) {
+ // Use a custom cling
+ View cling = findViewById(R.id.workspace_cling);
+ ViewGroup clingParent = (ViewGroup) cling.getParent();
+ int clingIndex = clingParent.indexOfChild(cling);
+ clingParent.removeViewAt(clingIndex);
+ View customCling = mInflater.inflate(R.layout.custom_workspace_cling, clingParent, false);
+ clingParent.addView(customCling, clingIndex);
+ customCling.setId(R.id.workspace_cling);
+ }
+ }
+ Cling cling = (Cling) findViewById(R.id.first_run_cling);
+ if (cling != null) {
+ String sbHintStr = getFirstRunClingSearchBarHint();
+ String ccHintStr = getFirstRunCustomContentHint();
+ if (!sbHintStr.isEmpty()) {
+ TextView sbHint = (TextView) cling.findViewById(R.id.search_bar_hint);
+ sbHint.setText(sbHintStr);
+ sbHint.setVisibility(View.VISIBLE);
+ }
+ if (!ccHintStr.isEmpty()) {
+ TextView ccHint = (TextView) cling.findViewById(R.id.custom_content_hint);
+ ccHint.setText(ccHintStr);
+ ccHint.setVisibility(View.VISIBLE);
+ }
}
initCling(R.id.first_run_cling, null, false, true);
} else {
@@ -4183,6 +4201,13 @@ public class Launcher extends Activity
}
}
+ protected String getFirstRunClingSearchBarHint() {
+ return "";
+ }
+ protected String getFirstRunCustomContentHint() {
+ return "";
+ }
+
public void showFirstRunWorkspaceCling() {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&