summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-10-16 11:46:41 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-10-17 12:42:08 -0700
commitaeb1643ec61af93453c862e84b158d3b0ebcb1c7 (patch)
treeb57dcdc0892a153cb83333a2dab55547e7d87665 /src/com/android/launcher3/widget
parent1797af41d162413dc98c33fab8ba19f96b63874b (diff)
downloadandroid_packages_apps_Trebuchet-aeb1643ec61af93453c862e84b158d3b0ebcb1c7.tar.gz
android_packages_apps_Trebuchet-aeb1643ec61af93453c862e84b158d3b0ebcb1c7.tar.bz2
android_packages_apps_Trebuchet-aeb1643ec61af93453c862e84b158d3b0ebcb1c7.zip
Launcher state management cleanup
> Removing Widgets and related states > Fixing different durations being used when opening/closing all-apps > Removing some unnecessary object allocations when changing state without animation > Differentiating widget bootm sheel and full sheet in logs Bug: 67678570 Change-Id: Ic169528736d04ee0b38564b4f96595ba066eabda
Diffstat (limited to 'src/com/android/launcher3/widget')
-rw-r--r--src/com/android/launcher3/widget/BaseWidgetSheet.java13
-rw-r--r--src/com/android/launcher3/widget/WidgetsBottomSheet.java5
-rw-r--r--src/com/android/launcher3/widget/WidgetsFullSheet.java5
3 files changed, 19 insertions, 4 deletions
diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java
index b6b3089b0..61a733338 100644
--- a/src/com/android/launcher3/widget/BaseWidgetSheet.java
+++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.widget;
+import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
+
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
@@ -32,7 +34,6 @@ import android.view.animation.DecelerateInterpolator;
import android.widget.Toast;
import com.android.launcher3.AbstractFloatingView;
-import com.android.launcher3.DeleteDropTarget;
import com.android.launcher3.DragSource;
import com.android.launcher3.DropTarget.DragObject;
import com.android.launcher3.ItemInfo;
@@ -41,7 +42,6 @@ import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.dragndrop.DragOptions;
-import com.android.launcher3.folder.Folder;
import com.android.launcher3.graphics.GradientView;
import com.android.launcher3.touch.SwipeDetector;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
@@ -264,11 +264,16 @@ abstract class BaseWidgetSheet extends AbstractFloatingView
@Override
public void fillInLogContainerData(View v, ItemInfo info, Target target, Target targetParent) {
targetParent.containerType = ContainerType.WIDGETS;
+ targetParent.cardinality = getElementsRowCount();
}
@Override
public final void logActionCommand(int command) {
- // TODO: be more specific
- mLauncher.getUserEventDispatcher().logActionCommand(command, ContainerType.WIDGETS);
+ Target target = newContainerTarget(ContainerType.WIDGETS);
+ target.cardinality = getElementsRowCount();
+ mLauncher.getUserEventDispatcher().logActionCommand(command, target);
}
+
+ protected abstract int getElementsRowCount();
+
}
diff --git a/src/com/android/launcher3/widget/WidgetsBottomSheet.java b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
index 201bd1c9c..3bb3fcb98 100644
--- a/src/com/android/launcher3/widget/WidgetsBottomSheet.java
+++ b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
@@ -181,4 +181,9 @@ public class WidgetsBottomSheet extends BaseWidgetSheet implements Insettable {
setPadding(getPaddingLeft() + leftInset, getPaddingTop(),
getPaddingRight() + rightInset, getPaddingBottom() + bottomInset);
}
+
+ @Override
+ protected int getElementsRowCount() {
+ return 1;
+ }
}
diff --git a/src/com/android/launcher3/widget/WidgetsFullSheet.java b/src/com/android/launcher3/widget/WidgetsFullSheet.java
index 72277a253..a40ea1b64 100644
--- a/src/com/android/launcher3/widget/WidgetsFullSheet.java
+++ b/src/com/android/launcher3/widget/WidgetsFullSheet.java
@@ -219,4 +219,9 @@ public class WidgetsFullSheet extends BaseWidgetSheet
sheet.open(animate);
return sheet;
}
+
+ @Override
+ protected int getElementsRowCount() {
+ return mAdapter.getItemCount();
+ }
}