summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/LauncherAppWidgetHostView.java14
-rw-r--r--src/com/android/launcher3/LauncherModel.java8
2 files changed, 16 insertions, 6 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetHostView.java b/src/com/android/launcher3/LauncherAppWidgetHostView.java
index 83aef1a2f..51a649a07 100644
--- a/src/com/android/launcher3/LauncherAppWidgetHostView.java
+++ b/src/com/android/launcher3/LauncherAppWidgetHostView.java
@@ -65,6 +65,12 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView implements Touc
}
public boolean onInterceptTouchEvent(MotionEvent ev) {
+ // Just in case the previous long press hasn't been cleared, we make sure to start fresh
+ // on touch down.
+ if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+ mLongPressHelper.cancelLongPress();
+ }
+
// Consume any touch events for ourselves after longpress is triggered
if (mLongPressHelper.hasPerformedLongPress()) {
mLongPressHelper.cancelLongPress();
@@ -110,13 +116,15 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView implements Touc
@Override
public void onTouchComplete() {
- mLongPressHelper.cancelLongPress();
+ if (!mLongPressHelper.hasPerformedLongPress()) {
+ // If a long press has been performed, we don't want to clear the record of that since
+ // we still may be receiving a touch up which we want to intercept
+ mLongPressHelper.cancelLongPress();
+ }
}
@Override
public int getDescendantFocusability() {
return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
}
-
-
}
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 7e1442dce..aad768d36 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -186,9 +186,6 @@ public class LauncherModel extends BroadcastReceiver {
mBgAllAppsList = new AllAppsList(iconCache, appFilter);
mIconCache = iconCache;
- mDefaultIcon = Utilities.createIconBitmap(
- mIconCache.getFullResDefaultActivityIcon(), context);
-
final Resources res = context.getResources();
Configuration config = res.getConfiguration();
mPreviousConfigMcc = config.mcc;
@@ -400,6 +397,11 @@ public class LauncherModel extends BroadcastReceiver {
}
public Bitmap getFallbackIcon() {
+ if (mDefaultIcon == null) {
+ final Context context = LauncherAppState.getInstance().getContext();
+ mDefaultIcon = Utilities.createIconBitmap(
+ mIconCache.getFullResDefaultActivityIcon(), context);
+ }
return Bitmap.createBitmap(mDefaultIcon);
}