Loading res/layout/apps_customize_application.xml +1 −3 Original line number Diff line number Diff line Loading @@ -14,10 +14,8 @@ limitations under the License. --> <com.android.launcher3.PagedViewIcon <com.android.launcher3.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3" style="@style/WorkspaceIcon.AppsCustomize" android:id="@+id/application_icon" android:focusable="true" /> res/values/attrs.xml +0 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,6 @@ <declare-styleable name="BubbleTextView"> <!-- A spacing override for the icons within a page --> <attr name="customShadows" format="boolean" /> <attr name="glowColor" format="color" /> </declare-styleable> <!-- AppsCustomizePagedView specific attributes. These attributes are used to Loading res/values/colors.xml +0 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ <color name="quantum_panel_text_color">#FF666666</color> <color name="quantum_panel_text_shadow_color">#FFC4C4C4</color> <color name="folder_items_glow_color">#FFCCCCCC</color> <color name="outline_color">#FFFFFFFF</color> <color name="widget_text_panel">#FF374248</color> Loading res/values/styles.xml +2 −2 Original line number Diff line number Diff line Loading @@ -91,7 +91,8 @@ <item name="android:shadowRadius">2.0</item> <item name="android:shadowDx">0</item> <item name="android:shadowDy">2</item> <item name="android:shadowColor">#FFC4C4C4</item> <item name="android:shadowColor">@color/quantum_panel_text_shadow_color</item> <item name="customShadows">false</item> </style> <style name="WorkspaceIcon.Folder"> Loading @@ -103,7 +104,6 @@ <item name="android:shadowDy">2</item> <item name="customShadows">false</item> <item name="glowColor">@color/folder_items_glow_color</item> </style> <style name="SearchDropTargetBar"> Loading src/com/android/launcher3/AppsCustomizePagedView.java +26 −60 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.widget.GridLayout; import android.widget.ImageView; import android.widget.Toast; Loading Loading @@ -144,8 +143,7 @@ class AppsCustomizeAsyncTask extends AsyncTask<AsyncTaskPageData, Void, AsyncTas */ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implements View.OnClickListener, View.OnKeyListener, DragSource, PagedViewIcon.PressedCallback, PagedViewWidget.ShortPressListener, LauncherTransitionable { PagedViewWidget.ShortPressListener, LauncherTransitionable { static final String TAG = "AppsCustomizePagedView"; private static Rect sTmpRect = new Rect(); Loading @@ -167,7 +165,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen // Save and Restore private int mSaveInstanceStateItemIndex = -1; private PagedViewIcon mPressedIcon; // Content private ArrayList<AppInfo> mApps; Loading Loading @@ -444,19 +441,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen @Override public void onClick(View v) { // When we have exited all apps or are in transition, disregard clicks if (!mLauncher.isAllAppsVisible() || mLauncher.getWorkspace().isSwitchingState()) return; if (!mLauncher.isAllAppsVisible() || mLauncher.getWorkspace().isSwitchingState() || !(v instanceof PagedViewWidget)) return; if (v instanceof PagedViewIcon) { // Animate some feedback to the click final AppInfo appInfo = (AppInfo) v.getTag(); // Lock the drawable state to pressed until we return to Launcher if (mPressedIcon != null) { mPressedIcon.lockDrawableState(); } mLauncher.onClickPagedViewIcon(v, appInfo); } else if (v instanceof PagedViewWidget) { // Let the user know that they have to long press to add a widget if (mWidgetInstructionToast != null) { mWidgetInstructionToast.cancel(); Loading @@ -477,7 +465,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen bounce.setInterpolator(new AccelerateInterpolator()); bounce.start(); } } public boolean onKey(View v, int keyCode, KeyEvent event) { return FocusHelper.handleAppsCustomizeKeyEvent(v, keyCode, event); Loading @@ -492,7 +479,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen } private void beginDraggingApplication(View v) { mLauncher.getWorkspace().onDragStartedWithItem(v); mLauncher.getWorkspace().beginDragShared(v, this); } Loading Loading @@ -726,7 +712,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen protected boolean beginDragging(final View v) { if (!super.beginDragging(v)) return false; if (v instanceof PagedViewIcon) { if (v instanceof BubbleTextView) { beginDraggingApplication(v); } else if (v instanceof PagedViewWidget) { if (!beginDraggingWidget(v)) { Loading @@ -741,9 +727,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen public void run() { // We don't enter spring-loaded mode if the drag has been cancelled if (mLauncher.getDragController().isDragging()) { // Reset the alpha on the dragged icon before we drag resetDrawableState(); // Go into spring loaded mode (must happen before we startDrag()) mLauncher.enterSpringLoadedDragMode(); } Loading Loading @@ -992,10 +975,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen ArrayList<Bitmap> images = new ArrayList<Bitmap>(); for (int i = startIndex; i < endIndex; ++i) { AppInfo info = mApps.get(i); PagedViewIcon icon = (PagedViewIcon) mLayoutInflater.inflate( BubbleTextView icon = (BubbleTextView) mLayoutInflater.inflate( R.layout.apps_customize_application, layout, false); icon.applyFromApplicationInfo(info, true, this); icon.setOnClickListener(this); icon.applyFromApplicationInfo(info); icon.setOnClickListener(mLauncher); icon.setOnLongClickListener(this); icon.setOnTouchListener(this); icon.setOnKeyListener(this); Loading Loading @@ -1559,23 +1542,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen cancelAllTasks(); } @Override public void iconPressed(PagedViewIcon icon) { // Reset the previously pressed icon and store a reference to the pressed icon so that // we can reset it on return to Launcher (in Launcher.onResume()) if (mPressedIcon != null) { mPressedIcon.resetDrawableState(); } mPressedIcon = icon; } public void resetDrawableState() { if (mPressedIcon != null) { mPressedIcon.resetDrawableState(); mPressedIcon = null; } } /* * We load an extra page on each side to prevent flashes from scrolling and loading of the * widget previews in the background with the AsyncTasks. Loading Loading
res/layout/apps_customize_application.xml +1 −3 Original line number Diff line number Diff line Loading @@ -14,10 +14,8 @@ limitations under the License. --> <com.android.launcher3.PagedViewIcon <com.android.launcher3.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3" style="@style/WorkspaceIcon.AppsCustomize" android:id="@+id/application_icon" android:focusable="true" />
res/values/attrs.xml +0 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,6 @@ <declare-styleable name="BubbleTextView"> <!-- A spacing override for the icons within a page --> <attr name="customShadows" format="boolean" /> <attr name="glowColor" format="color" /> </declare-styleable> <!-- AppsCustomizePagedView specific attributes. These attributes are used to Loading
res/values/colors.xml +0 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ <color name="quantum_panel_text_color">#FF666666</color> <color name="quantum_panel_text_shadow_color">#FFC4C4C4</color> <color name="folder_items_glow_color">#FFCCCCCC</color> <color name="outline_color">#FFFFFFFF</color> <color name="widget_text_panel">#FF374248</color> Loading
res/values/styles.xml +2 −2 Original line number Diff line number Diff line Loading @@ -91,7 +91,8 @@ <item name="android:shadowRadius">2.0</item> <item name="android:shadowDx">0</item> <item name="android:shadowDy">2</item> <item name="android:shadowColor">#FFC4C4C4</item> <item name="android:shadowColor">@color/quantum_panel_text_shadow_color</item> <item name="customShadows">false</item> </style> <style name="WorkspaceIcon.Folder"> Loading @@ -103,7 +104,6 @@ <item name="android:shadowDy">2</item> <item name="customShadows">false</item> <item name="glowColor">@color/folder_items_glow_color</item> </style> <style name="SearchDropTargetBar"> Loading
src/com/android/launcher3/AppsCustomizePagedView.java +26 −60 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.widget.GridLayout; import android.widget.ImageView; import android.widget.Toast; Loading Loading @@ -144,8 +143,7 @@ class AppsCustomizeAsyncTask extends AsyncTask<AsyncTaskPageData, Void, AsyncTas */ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implements View.OnClickListener, View.OnKeyListener, DragSource, PagedViewIcon.PressedCallback, PagedViewWidget.ShortPressListener, LauncherTransitionable { PagedViewWidget.ShortPressListener, LauncherTransitionable { static final String TAG = "AppsCustomizePagedView"; private static Rect sTmpRect = new Rect(); Loading @@ -167,7 +165,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen // Save and Restore private int mSaveInstanceStateItemIndex = -1; private PagedViewIcon mPressedIcon; // Content private ArrayList<AppInfo> mApps; Loading Loading @@ -444,19 +441,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen @Override public void onClick(View v) { // When we have exited all apps or are in transition, disregard clicks if (!mLauncher.isAllAppsVisible() || mLauncher.getWorkspace().isSwitchingState()) return; if (!mLauncher.isAllAppsVisible() || mLauncher.getWorkspace().isSwitchingState() || !(v instanceof PagedViewWidget)) return; if (v instanceof PagedViewIcon) { // Animate some feedback to the click final AppInfo appInfo = (AppInfo) v.getTag(); // Lock the drawable state to pressed until we return to Launcher if (mPressedIcon != null) { mPressedIcon.lockDrawableState(); } mLauncher.onClickPagedViewIcon(v, appInfo); } else if (v instanceof PagedViewWidget) { // Let the user know that they have to long press to add a widget if (mWidgetInstructionToast != null) { mWidgetInstructionToast.cancel(); Loading @@ -477,7 +465,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen bounce.setInterpolator(new AccelerateInterpolator()); bounce.start(); } } public boolean onKey(View v, int keyCode, KeyEvent event) { return FocusHelper.handleAppsCustomizeKeyEvent(v, keyCode, event); Loading @@ -492,7 +479,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen } private void beginDraggingApplication(View v) { mLauncher.getWorkspace().onDragStartedWithItem(v); mLauncher.getWorkspace().beginDragShared(v, this); } Loading Loading @@ -726,7 +712,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen protected boolean beginDragging(final View v) { if (!super.beginDragging(v)) return false; if (v instanceof PagedViewIcon) { if (v instanceof BubbleTextView) { beginDraggingApplication(v); } else if (v instanceof PagedViewWidget) { if (!beginDraggingWidget(v)) { Loading @@ -741,9 +727,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen public void run() { // We don't enter spring-loaded mode if the drag has been cancelled if (mLauncher.getDragController().isDragging()) { // Reset the alpha on the dragged icon before we drag resetDrawableState(); // Go into spring loaded mode (must happen before we startDrag()) mLauncher.enterSpringLoadedDragMode(); } Loading Loading @@ -992,10 +975,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen ArrayList<Bitmap> images = new ArrayList<Bitmap>(); for (int i = startIndex; i < endIndex; ++i) { AppInfo info = mApps.get(i); PagedViewIcon icon = (PagedViewIcon) mLayoutInflater.inflate( BubbleTextView icon = (BubbleTextView) mLayoutInflater.inflate( R.layout.apps_customize_application, layout, false); icon.applyFromApplicationInfo(info, true, this); icon.setOnClickListener(this); icon.applyFromApplicationInfo(info); icon.setOnClickListener(mLauncher); icon.setOnLongClickListener(this); icon.setOnTouchListener(this); icon.setOnKeyListener(this); Loading Loading @@ -1559,23 +1542,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen cancelAllTasks(); } @Override public void iconPressed(PagedViewIcon icon) { // Reset the previously pressed icon and store a reference to the pressed icon so that // we can reset it on return to Launcher (in Launcher.onResume()) if (mPressedIcon != null) { mPressedIcon.resetDrawableState(); } mPressedIcon = icon; } public void resetDrawableState() { if (mPressedIcon != null) { mPressedIcon.resetDrawableState(); mPressedIcon = null; } } /* * We load an extra page on each side to prevent flashes from scrolling and loading of the * widget previews in the background with the AsyncTasks. Loading