summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/shortcuts
diff options
context:
space:
mode:
authorTony <twickham@google.com>2017-05-10 13:05:32 -0500
committerTony <twickham@google.com>2017-05-31 15:11:43 -0700
commitacaf5b3a37af11b40166c10e856175bb96cb1476 (patch)
treeb2e91e84ecad5863266da8dea058eea56779b037 /src/com/android/launcher3/shortcuts
parentd5645d406bf50bd9c8004a597e29908b26d09925 (diff)
downloadandroid_packages_apps_Trebuchet-acaf5b3a37af11b40166c10e856175bb96cb1476.tar.gz
android_packages_apps_Trebuchet-acaf5b3a37af11b40166c10e856175bb96cb1476.tar.bz2
android_packages_apps_Trebuchet-acaf5b3a37af11b40166c10e856175bb96cb1476.zip
Remove gap between popup items
- Unround interior corners - Update colors (shortcuts are gray when next to notifications, notifications always white) - Clean up animation to animate entire popup with simple reveal instead of individual items animating with reveal and icon scale Bug: 35766387 Bug: 36110804 Change-Id: I33685d53e2db3904731676123dc230be4dabb5d4
Diffstat (limited to 'src/com/android/launcher3/shortcuts')
-rw-r--r--src/com/android/launcher3/shortcuts/ShortcutsItemView.java63
1 files changed, 12 insertions, 51 deletions
diff --git a/src/com/android/launcher3/shortcuts/ShortcutsItemView.java b/src/com/android/launcher3/shortcuts/ShortcutsItemView.java
index 5b3b02eac..340a6f000 100644
--- a/src/com/android/launcher3/shortcuts/ShortcutsItemView.java
+++ b/src/com/android/launcher3/shortcuts/ShortcutsItemView.java
@@ -16,12 +16,10 @@
package com.android.launcher3.shortcuts;
-import android.animation.Animator;
-import android.animation.AnimatorSet;
import android.content.Context;
import android.graphics.Point;
-import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
+import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
@@ -30,9 +28,7 @@ import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
-import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.R;
-import com.android.launcher3.anim.PropertyListBuilder;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.logging.UserEventDispatcher.LogContainerProvider;
@@ -135,7 +131,17 @@ public class ShortcutsItemView extends PopupItemView implements View.OnLongClick
if (mSystemShortcutIcons == null) {
mSystemShortcutIcons = (LinearLayout) mLauncher.getLayoutInflater().inflate(
R.layout.system_shortcut_icons, mShortcutsLayout, false);
- mShortcutsLayout.addView(mSystemShortcutIcons, 0);
+
+ View divider = LayoutInflater.from(getContext()).inflate(
+ R.layout.horizontal_divider, this, false);
+
+ if (mShortcutsLayout.getChildCount() > 0) {
+ mShortcutsLayout.addView(divider);
+ }
+ mShortcutsLayout.addView(mSystemShortcutIcons);
+ if (mShortcutsLayout.getChildCount() == 1) {
+ mShortcutsLayout.addView(divider);
+ }
}
mSystemShortcutIcons.addView(shortcutView, index);
} else {
@@ -210,51 +216,6 @@ public class ShortcutsItemView extends PopupItemView implements View.OnLongClick
}
@Override
- public Animator createOpenAnimation(boolean isContainerAboveIcon, boolean pivotLeft) {
- AnimatorSet openAnimation = LauncherAnimUtils.createAnimatorSet();
- openAnimation.play(super.createOpenAnimation(isContainerAboveIcon, pivotLeft));
- for (int i = 0; i < mShortcutsLayout.getChildCount(); i++) {
- if (!(mShortcutsLayout.getChildAt(i) instanceof DeepShortcutView)) {
- continue;
- }
- DeepShortcutView shortcutView = ((DeepShortcutView) mShortcutsLayout.getChildAt(i));
- View deepShortcutIcon = shortcutView.getIconView();
- deepShortcutIcon.setScaleX(0);
- deepShortcutIcon.setScaleY(0);
- openAnimation.play(LauncherAnimUtils.ofPropertyValuesHolder(
- deepShortcutIcon, new PropertyListBuilder().scale(1).build()));
- }
- return openAnimation;
- }
-
- @Override
- public Animator createCloseAnimation(boolean isContainerAboveIcon, boolean pivotLeft,
- long duration) {
- AnimatorSet closeAnimation = LauncherAnimUtils.createAnimatorSet();
- closeAnimation.play(super.createCloseAnimation(isContainerAboveIcon, pivotLeft, duration));
- for (int i = 0; i < mShortcutsLayout.getChildCount(); i++) {
- if (!(mShortcutsLayout.getChildAt(i) instanceof DeepShortcutView)) {
- continue;
- }
- DeepShortcutView shortcutView = ((DeepShortcutView) mShortcutsLayout.getChildAt(i));
- View deepShortcutIcon = shortcutView.getIconView();
- deepShortcutIcon.setScaleX(1);
- deepShortcutIcon.setScaleY(1);
- closeAnimation.play(LauncherAnimUtils.ofPropertyValuesHolder(
- deepShortcutIcon, new PropertyListBuilder().scale(0).build()));
- }
- return closeAnimation;
- }
-
- @Override
- public int getArrowColor(boolean isArrowAttachedToBottom) {
- return ContextCompat.getColor(getContext(),
- isArrowAttachedToBottom || mSystemShortcutIcons == null
- ? R.color.popup_background_color
- : R.color.popup_header_background_color);
- }
-
- @Override
public void fillInLogContainerData(View v, ItemInfo info, LauncherLogProto.Target target,
LauncherLogProto.Target targetParent) {
target.itemType = LauncherLogProto.ItemType.DEEPSHORTCUT;