diff options
author | Abhisek Devkota <ciwrl@cyanogenmod.com> | 2014-06-04 17:53:41 +0000 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2014-06-05 23:03:27 -0700 |
commit | d90bcfe751dc99b4712a883206bf2a164af8f6c4 (patch) | |
tree | 5dbb5df14c93f76d7129e214b586857654aed9c1 | |
parent | 129b7163fc3d3df45e2ba76794d6184454431963 (diff) | |
download | android_packages_apps_Trebuchet-d90bcfe751dc99b4712a883206bf2a164af8f6c4.tar.gz android_packages_apps_Trebuchet-d90bcfe751dc99b4712a883206bf2a164af8f6c4.tar.bz2 android_packages_apps_Trebuchet-d90bcfe751dc99b4712a883206bf2a164af8f6c4.zip |
Revert "Trebuchet : Show cling for allapps overview"
This reverts commit 20109c489eed6e97803ed5e5745c8c377b0446cb.
Change-Id: I025c038d85256e2aa8500e098646a57a2fb41d5c
-rw-r--r-- | res/layout-land/all_apps_cling.xml | 42 | ||||
-rw-r--r-- | res/layout-land/launcher.xml | 6 | ||||
-rw-r--r-- | res/layout-port/all_apps_cling.xml | 51 | ||||
-rw-r--r-- | res/layout-port/launcher.xml | 6 | ||||
-rw-r--r-- | res/layout-sw600dp-port/all_apps_cling.xml | 50 | ||||
-rw-r--r-- | res/layout-sw720dp/all_apps_cling.xml | 46 | ||||
-rw-r--r-- | res/layout-sw720dp/launcher.xml | 6 | ||||
-rw-r--r-- | res/values/cm_strings.xml | 5 | ||||
-rw-r--r-- | src/com/android/launcher3/Cling.java | 41 | ||||
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 33 |
10 files changed, 135 insertions, 151 deletions
diff --git a/res/layout-land/all_apps_cling.xml b/res/layout-land/all_apps_cling.xml index 19a93a5f3..820f00a6d 100644 --- a/res/layout-land/all_apps_cling.xml +++ b/res/layout-land/all_apps_cling.xml @@ -16,49 +16,33 @@ <com.android.launcher3.Cling xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3" - android:layout_width="match_parent" - android:layout_height="match_parent" - launcher:drawIdentifier="all_apps"> + launcher:drawIdentifier="all_apps_landscape"> <FrameLayout - android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginStart="25dp" - android:layout_marginEnd="25dp" - android:layout_marginTop="310dp"> + android:layout_marginStart="40dp" + android:layout_marginTop="40dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="top" android:orientation="vertical"> - <LinearLayout - android:paddingLeft="20dp" - android:paddingRight="20dp" - android:paddingTop="20dp" - android:paddingBottom="20dp" + <TextView + style="@style/ClingTitleText" + android:id="@+id/all_apps_cling_title" + android:text="@string/all_apps_cling_title" /> + <TextView + style="@style/ClingText" + android:id="@+id/all_apps_cling_add_item" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical" - android:background="@drawable/cling"> - <TextView - style="@style/ClingTitleText" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/all_apps_cling_cm" /> - <TextView - style="@style/ClingText" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/all_apps_cling_summary" /> - </LinearLayout> + android:text="@string/all_apps_cling_add_item" /> </LinearLayout> </FrameLayout> <Button style="@style/ClingButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:id="@+id/cling_dismiss" android:layout_marginBottom="15dp" - android:layout_marginEnd="20dp" + android:layout_marginEnd="10dp" android:layout_gravity="bottom|end" android:onClick="dismissAllAppsCling" /> </com.android.launcher3.Cling> diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml index 2f64efe39..3666b5986 100644 --- a/res/layout-land/launcher.xml +++ b/res/layout-land/launcher.xml @@ -94,12 +94,6 @@ android:layout_height="match_parent" android:visibility="invisible" /> - <include layout="@layout/all_apps_cling" - android:id="@+id/all_apps_cling" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="gone" /> - <include layout="@layout/overview_panel" android:id="@+id/overview_panel" android:visibility="gone" /> diff --git a/res/layout-port/all_apps_cling.xml b/res/layout-port/all_apps_cling.xml index ed99d78a0..62284ec73 100644 --- a/res/layout-port/all_apps_cling.xml +++ b/res/layout-port/all_apps_cling.xml @@ -16,50 +16,33 @@ <com.android.launcher3.Cling xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3" - android:layout_width="match_parent" - android:layout_height="match_parent" - launcher:drawIdentifier="all_apps"> + launcher:drawIdentifier="all_apps_portrait"> <FrameLayout - android:id="@+id/content" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:layout_marginStart="20dp" + android:layout_marginTop="20dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="top" - android:layout_marginStart="25dp" - android:layout_marginEnd="25dp" - android:layout_marginTop="30dp" android:orientation="vertical"> - <LinearLayout - android:paddingLeft="20dp" - android:paddingRight="20dp" - android:paddingTop="20dp" - android:paddingBottom="20dp" - android:layout_width="match_parent" + <TextView + style="@style/ClingTitleText" + android:id="@+id/all_apps_cling_title" + android:text="@string/all_apps_cling_title" /> + <TextView + style="@style/ClingText" + android:id="@+id/all_apps_cling_add_item" + android:layout_width="285dp" android:layout_height="wrap_content" - android:orientation="vertical" - android:background="@drawable/cling"> - <TextView - style="@style/ClingTitleText" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/all_apps_cling_cm" /> - <TextView - style="@style/ClingText" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/all_apps_cling_summary" /> - </LinearLayout> + android:text="@string/all_apps_cling_add_item" /> </LinearLayout> </FrameLayout> - <Button style="@style/ClingButton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="60dp" - android:layout_marginRight="20dp" - android:layout_gravity="bottom|right" + android:id="@+id/cling_dismiss" + android:layout_marginBottom="15dp" + android:layout_marginEnd="10dp" + android:layout_gravity="bottom|end" android:onClick="dismissAllAppsCling" /> </com.android.launcher3.Cling> diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml index 98cd0f3b6..11f74ba1d 100644 --- a/res/layout-port/launcher.xml +++ b/res/layout-port/launcher.xml @@ -99,12 +99,6 @@ android:layout_height="match_parent" android:visibility="invisible" /> - <include layout="@layout/all_apps_cling" - android:id="@+id/all_apps_cling" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="gone" /> - <include layout="@layout/overview_panel" android:id="@+id/overview_panel" android:visibility="gone" /> diff --git a/res/layout-sw600dp-port/all_apps_cling.xml b/res/layout-sw600dp-port/all_apps_cling.xml new file mode 100644 index 000000000..cf65e410d --- /dev/null +++ b/res/layout-sw600dp-port/all_apps_cling.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<com.android.launcher3.Cling + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3" + launcher:drawIdentifier="all_apps_portrait"> + <FrameLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginStart="20dp" + android:layout_marginTop="20dp"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + <TextView + style="@style/ClingTitleText" + android:id="@+id/all_apps_cling_title" + android:text="@string/all_apps_cling_title" /> + <TextView + style="@style/ClingText" + android:id="@+id/all_apps_cling_add_item" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/all_apps_cling_add_item" /> + </LinearLayout> + </FrameLayout> + <Button + style="@style/ClingButton" + android:id="@+id/cling_dismiss" + android:minWidth="168dp" + android:textSize="24sp" + android:layout_marginTop="235dp" + android:layout_marginEnd="36dp" + android:layout_gravity="top|end" + android:onClick="dismissAllAppsCling" /> +</com.android.launcher3.Cling> diff --git a/res/layout-sw720dp/all_apps_cling.xml b/res/layout-sw720dp/all_apps_cling.xml new file mode 100644 index 000000000..824d84f0d --- /dev/null +++ b/res/layout-sw720dp/all_apps_cling.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<com.android.launcher3.Cling + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3" + launcher:drawIdentifier="all_apps_large"> + <FrameLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginStart="@dimen/cling_text_block_offset_x" + android:layout_marginTop="@dimen/cling_text_block_offset_y"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + <TextView + style="@style/ClingTitleText" + android:id="@+id/all_apps_cling_title" + android:text="@string/all_apps_cling_title" /> + <TextView + style="@style/ClingText" + android:id="@+id/all_apps_cling_add_item" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/all_apps_cling_add_item" /> + <Button + style="@style/ClingButton" + android:id="@+id/cling_dismiss" + android:layout_marginTop="15dp" + android:onClick="dismissAllAppsCling" /> + </LinearLayout> + </FrameLayout> +</com.android.launcher3.Cling> diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml index 7b0d770ec..4f6aaf503 100644 --- a/res/layout-sw720dp/launcher.xml +++ b/res/layout-sw720dp/launcher.xml @@ -94,12 +94,6 @@ android:layout_height="match_parent" android:visibility="invisible" /> - <include layout="@layout/all_apps_cling" - android:id="@+id/all_apps_cling" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="gone" /> - <include layout="@layout/overview_panel" android:id="@+id/overview_panel" android:visibility="gone" /> diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index b3cdc4289..1d8034e3f 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -86,11 +86,6 @@ <!-- Folder titles --> <string name="google_title" translatable="false">Google</string> - <!-- The title text for the all apps cling [CHAR_LIMIT=60] --> - <string name="all_apps_cling_cm">Customize your drawer</string> - <!-- The description of how to access Trebuchet settings [CHAR_LIMIT=160] --> - <string name="all_apps_cling_summary">Tap the page indicator to view additional configuration settings</string> - <!-- Noun, menu item used to reset hidden apps list --> <string name="menu_hidden_apps_delete">Reset</string> diff --git a/src/com/android/launcher3/Cling.java b/src/com/android/launcher3/Cling.java index 01a54b4e1..338b722ab 100644 --- a/src/com/android/launcher3/Cling.java +++ b/src/com/android/launcher3/Cling.java @@ -18,6 +18,7 @@ package com.android.launcher3; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; +import android.app.ActivityOptions; import android.content.Context; import android.content.ComponentName; import android.content.Intent; @@ -40,7 +41,6 @@ public class Cling extends FrameLayout implements Insettable, View.OnClickListen static final String FIRST_RUN_CLING_DISMISSED_KEY = "cling_gel.first_run.dismissed"; static final String WORKSPACE_CLING_DISMISSED_KEY = "cling_gel.workspace.dismissed"; static final String FOLDER_CLING_DISMISSED_KEY = "cling_gel.folder.dismissed"; - static final String ALL_APPS_CLING_DISMISSED_KEY = "cling_gel.all_apps.dismissed"; private static String FIRST_RUN_PORTRAIT = "first_run_portrait"; private static String FIRST_RUN_LANDSCAPE = "first_run_landscape"; @@ -54,8 +54,6 @@ public class Cling extends FrameLayout implements Insettable, View.OnClickListen private static String FOLDER_LANDSCAPE = "folder_landscape"; private static String FOLDER_LARGE = "folder_large"; - private static String ALL_APPS = "all_apps"; - 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; @@ -80,7 +78,6 @@ public class Cling extends FrameLayout implements Insettable, View.OnClickListen private int mBackgroundColor; private final Rect mInsets = new Rect(); - private int[] mPosition; public Cling(Context context) { this(context, null, 0); @@ -130,13 +127,6 @@ public class Cling extends FrameLayout implements Insettable, View.OnClickListen } } - void setPunchThroughForView(View view) { - mPosition = new int[2]; - view.getLocationOnScreen(mPosition); - mPosition[0] += view.getWidth() / 2; - mPosition[1] += view.getHeight() / 2; - } - void setFocusedHotseatApp(int drawableId, int appRank, ComponentName cn, String title, String description) { // Get the app to draw @@ -183,8 +173,7 @@ public class Cling extends FrameLayout implements Insettable, View.OnClickListen if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) || mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) || mDrawIdentifier.equals(WORKSPACE_LARGE) || - mDrawIdentifier.equals(WORKSPACE_CUSTOM) || - mDrawIdentifier.equals(ALL_APPS)) { + mDrawIdentifier.equals(WORKSPACE_CUSTOM)) { View content = getContent(); content.setAlpha(0f); content.animate() @@ -311,8 +300,7 @@ public class Cling extends FrameLayout implements Insettable, View.OnClickListen return (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) || mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) || mDrawIdentifier.equals(WORKSPACE_LARGE) - || mDrawIdentifier.equals(WORKSPACE_CUSTOM) - || mDrawIdentifier.equals(ALL_APPS)); + || mDrawIdentifier.equals(WORKSPACE_CUSTOM)); } @Override @@ -365,9 +353,6 @@ public class Cling extends FrameLayout implements Insettable, View.OnClickListen mDrawIdentifier.equals(WORKSPACE_LARGE)) { mLauncher.dismissWorkspaceCling(null); return true; - } else if (mDrawIdentifier.equals(ALL_APPS)) { - mLauncher.dismissAllAppsCling(null); - return true; } return false; } @@ -394,8 +379,7 @@ public class Cling extends FrameLayout implements Insettable, View.OnClickListen mBackground.draw(canvas); } else if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) || mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) || - mDrawIdentifier.equals(WORKSPACE_LARGE) || - mDrawIdentifier.equals(ALL_APPS)) { + mDrawIdentifier.equals(WORKSPACE_LARGE)) { // Initialize the draw buffer (to allow punching through) eraseBg = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(), Bitmap.Config.ARGB_8888); @@ -427,23 +411,16 @@ public class Cling extends FrameLayout implements Insettable, View.OnClickListen mBubblePaint); } else if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) || mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) || - mDrawIdentifier.equals(WORKSPACE_LARGE) || - mDrawIdentifier.equals(ALL_APPS)) { + mDrawIdentifier.equals(WORKSPACE_LARGE)) { int offset = DynamicGrid.pxFromDp(WORKSPACE_CIRCLE_Y_OFFSET_DPS, metrics); mErasePaint.setAlpha((int) (128)); - int punchX = metrics.widthPixels / 2; - int punchY = metrics.heightPixels / 2 - offset; - if (mPosition != null) { - punchX = mPosition[0]; - punchY = mPosition[1]; - } - eraseCanvas.drawCircle(punchX, - punchY, + eraseCanvas.drawCircle(metrics.widthPixels / 2, + metrics.heightPixels / 2 - offset, DynamicGrid.pxFromDp(WORKSPACE_OUTER_CIRCLE_RADIUS_DPS, metrics), mErasePaint); mErasePaint.setAlpha(0); - eraseCanvas.drawCircle(punchX, - punchY, + eraseCanvas.drawCircle(metrics.widthPixels / 2, + metrics.heightPixels / 2 - offset, DynamicGrid.pxFromDp(WORKSPACE_INNER_CIRCLE_RADIUS_DPS, metrics), mErasePaint); canvas.drawBitmap(eraseBg, 0, 0, null); diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 4c63b9c83..0ed481cfd 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2067,10 +2067,6 @@ public class Launcher extends Activity return false; } - void enterAllAppsOverviewMode() { - mAppsCustomizeContent.enterOverviewMode(); - } - @Override public boolean onSearchRequested() { startSearch(null, false, null, true); @@ -2295,9 +2291,6 @@ public class Launcher extends Activity @Override public void onBackPressed() { if (isAllAppsVisible()) { - if (isClingsEnabled()) { - dismissAllAppsCling(null); - } if (mAppsCustomizeContent.isInOverviewMode()) { mAppsCustomizeContent.exitOverviewMode(true); } else { @@ -2992,23 +2985,6 @@ public class Launcher extends Activity AppsCustomizePagedView.ContentType contentType = mAppsCustomizeContent.getContentType(); showAppsCustomizeHelper(animated, springLoaded, contentType); } - - public void showAllAppsCling() { - if (isClingsEnabled() && - !mSharedPrefs.getBoolean(Cling.ALL_APPS_CLING_DISMISSED_KEY, false) && - !skipCustomClingIfNoAccounts() ) { - Cling cling = (Cling) findViewById(R.id.all_apps_cling); - View pageIndicator = mAppsCustomizeLayout.findViewById(R.id.page_indicator); - cling.setPunchThroughForView(pageIndicator); - if (cling != null) { - cling.bringToFront(); - } - initCling(R.id.all_apps_cling, 0, true, true); - } else { - removeCling(R.id.all_apps_cling); - } - } - private void showAppsCustomizeHelper(final boolean animated, final boolean springLoaded, final AppsCustomizePagedView.ContentType contentType) { if (mStateAnimation != null) { @@ -3088,10 +3064,6 @@ public class Launcher extends Activity if (mSearchDropTargetBar != null) { mSearchDropTargetBar.hideSearchBar(false); } - - if (contentType == AppsCustomizePagedView.ContentType.Applications) { - showAllAppsCling(); - } } }); @@ -4571,11 +4543,6 @@ public class Launcher extends Activity dismissCling(cling, null, Cling.FOLDER_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION, true); } - public void dismissAllAppsCling(View v) { - Cling cling = (Cling) findViewById(R.id.all_apps_cling); - dismissCling(cling, null, Cling.ALL_APPS_CLING_DISMISSED_KEY, - DISMISS_CLING_DURATION, true); - } /** * To avoid managing preference change listeners for various parts of the |