diff options
-rw-r--r-- | res/layout-land/first_run_cling.xml | 24 | ||||
-rw-r--r-- | res/layout-port/first_run_cling.xml | 11 | ||||
-rw-r--r-- | res/values/colors.xml | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/Cling.java | 7 | ||||
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 45 |
5 files changed, 68 insertions, 21 deletions
diff --git a/res/layout-land/first_run_cling.xml b/res/layout-land/first_run_cling.xml index f82738096..3b21e14f6 100644 --- a/res/layout-land/first_run_cling.xml +++ b/res/layout-land/first_run_cling.xml @@ -34,9 +34,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" + android:layout_marginBottom="10dp" android:text="@string/first_run_cling_title" - android:textColor="#49C0EC" - android:textSize="32sp" /> + android:textColor="#FFFFFFFF" + android:textSize="30sp" /> <TextView style="@style/ClingAltTitleText" android:layout_width="wrap_content" @@ -47,22 +48,28 @@ </LinearLayout> <TextView style="@style/ClingHintText" + android:id="@+id/search_bar_hint" android:layout_width="160dp" android:layout_height="wrap_content" android:layout_gravity="top|end" android:layout_marginEnd="10dp" android:layout_marginTop="80dp" - android:text="@string/first_run_cling_search_bar_hint" - android:visibility="gone" /> + android:visibility="gone" + android:drawableTop="@drawable/cling_arrow_up" + android:drawablePadding="5dp" + android:text="@string/first_run_cling_search_bar_hint" /> <TextView style="@style/ClingHintText" + android:id="@+id/custom_content_hint" android:layout_width="160dp" android:layout_height="wrap_content" android:layout_gravity="top" android:layout_marginStart="10dp" android:layout_marginTop="100dp" - android:text="@string/first_run_cling_custom_content_hint" - android:visibility="gone" /> + android:visibility="gone" + android:drawableStart="@drawable/cling_arrow_left" + android:drawablePadding="10dp" + android:text="@string/first_run_cling_custom_content_hint" /> <TextView style="@style/ClingHintText" android:layout_width="160dp" @@ -70,8 +77,9 @@ android:layout_gravity="bottom|end" android:layout_marginEnd="10dp" android:layout_marginBottom="100dp" - android:text="@string/first_run_cling_create_screens_hint" - android:visibility="gone" /> + android:drawableEnd="@drawable/cling_arrow_right" + android:drawablePadding="5dp" + android:text="@string/first_run_cling_create_screens_hint" /> </FrameLayout> <Button style="@style/ClingButton" diff --git a/res/layout-port/first_run_cling.xml b/res/layout-port/first_run_cling.xml index cdc49b9cb..3b21e14f6 100644 --- a/res/layout-port/first_run_cling.xml +++ b/res/layout-port/first_run_cling.xml @@ -36,7 +36,7 @@ android:layout_gravity="center_horizontal" android:layout_marginBottom="10dp" android:text="@string/first_run_cling_title" - android:textColor="#49C0EC" + android:textColor="#FFFFFFFF" android:textSize="30sp" /> <TextView style="@style/ClingAltTitleText" @@ -48,19 +48,27 @@ </LinearLayout> <TextView style="@style/ClingHintText" + android:id="@+id/search_bar_hint" android:layout_width="160dp" android:layout_height="wrap_content" android:layout_gravity="top|end" android:layout_marginEnd="10dp" android:layout_marginTop="80dp" + android:visibility="gone" + android:drawableTop="@drawable/cling_arrow_up" + android:drawablePadding="5dp" android:text="@string/first_run_cling_search_bar_hint" /> <TextView style="@style/ClingHintText" + android:id="@+id/custom_content_hint" android:layout_width="160dp" android:layout_height="wrap_content" android:layout_gravity="top" android:layout_marginStart="10dp" android:layout_marginTop="100dp" + android:visibility="gone" + android:drawableStart="@drawable/cling_arrow_left" + android:drawablePadding="10dp" android:text="@string/first_run_cling_custom_content_hint" /> <TextView style="@style/ClingHintText" @@ -70,6 +78,7 @@ android:layout_marginEnd="10dp" android:layout_marginBottom="100dp" android:drawableEnd="@drawable/cling_arrow_right" + android:drawablePadding="5dp" android:text="@string/first_run_cling_create_screens_hint" /> </FrameLayout> <Button diff --git a/res/values/colors.xml b/res/values/colors.xml index 48a06fc7d..43a856d9f 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -35,4 +35,6 @@ <color name="wallpaper_picker_translucent_gray">#66000000</color> <color name="folder_items_text_color">#FF333333</color> <color name="outline_color">#FFFFFFFF</color> + + <color name="first_run_cling_circle_background_color">#FF83AEE8</color> </resources> 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() && |