diff options
author | Cristina Stancu <crstn@google.com> | 2013-08-07 17:20:14 +0100 |
---|---|---|
committer | Cristina Stancu <crstn@google.com> | 2013-08-22 11:41:11 +0100 |
commit | 476493bcc3b2d6cf32db62bf78714aa0f2747108 (patch) | |
tree | 9c2a5a14ea0488d9ba80e492d6694b4f0c97054f /src/com/android/launcher3/SearchDropTargetBar.java | |
parent | 2b931429dbf29633657f060151e5451522b44f15 (diff) | |
download | android_packages_apps_Trebuchet-476493bcc3b2d6cf32db62bf78714aa0f2747108.tar.gz android_packages_apps_Trebuchet-476493bcc3b2d6cf32db62bf78714aa0f2747108.tar.bz2 android_packages_apps_Trebuchet-476493bcc3b2d6cf32db62bf78714aa0f2747108.zip |
Get the view to be used as qsb bar from the launcher directly.
This will allow more control over the qsb visuals and behaviour in GEL.
Depends on ag/339203
Future changes:
- revert ag/344333 since we won't need the normal qsb to support hotword
anymore
- Dragging icons over the Drop target bar (to remove/uninstall them or
get App info) doesn't currently work in GEL. There might be future
changes needed to fix that.
Change-Id: Ic498f0abee5ad99ef1644ff94f174b61f8e1f5f0
Diffstat (limited to 'src/com/android/launcher3/SearchDropTargetBar.java')
-rw-r--r-- | src/com/android/launcher3/SearchDropTargetBar.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/launcher3/SearchDropTargetBar.java b/src/com/android/launcher3/SearchDropTargetBar.java index 8f1b5d2d2..0a0861f47 100644 --- a/src/com/android/launcher3/SearchDropTargetBar.java +++ b/src/com/android/launcher3/SearchDropTargetBar.java @@ -23,6 +23,7 @@ import android.content.Context; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.util.AttributeSet; +import android.view.LayoutInflater; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.widget.FrameLayout; @@ -71,6 +72,14 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D dragController.setFlingToDeleteDropTarget(mDeleteDropTarget); mInfoDropTarget.setLauncher(launcher); mDeleteDropTarget.setLauncher(launcher); + mQSBSearchBar = launcher.getQsbBar(); + if (mEnableDropDownDropTargets) { + mQSBSearchBarAnim = LauncherAnimUtils.ofFloat(mQSBSearchBar, "translationY", 0, + -mBarHeight); + } else { + mQSBSearchBarAnim = LauncherAnimUtils.ofFloat(mQSBSearchBar, "alpha", 1f, 0f); + } + setupAnimation(mQSBSearchBarAnim, mQSBSearchBar); } private void prepareStartAnimation(View v) { @@ -95,7 +104,6 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D super.onFinishInflate(); // Get the individual components - mQSBSearchBar = findViewById(R.id.qsb_search_bar); mDropTargetBar = findViewById(R.id.drag_target_bar); mInfoDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.info_target_text); mDeleteDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.delete_target_text); @@ -114,15 +122,12 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D mDropTargetBar.setTranslationY(-mBarHeight); mDropTargetBarAnim = LauncherAnimUtils.ofFloat(mDropTargetBar, "translationY", -mBarHeight, 0f); - mQSBSearchBarAnim = LauncherAnimUtils.ofFloat(mQSBSearchBar, "translationY", 0, - -mBarHeight); + } else { mDropTargetBar.setAlpha(0f); mDropTargetBarAnim = LauncherAnimUtils.ofFloat(mDropTargetBar, "alpha", 0f, 1f); - mQSBSearchBarAnim = LauncherAnimUtils.ofFloat(mQSBSearchBar, "alpha", 1f, 0f); } setupAnimation(mDropTargetBarAnim, mDropTargetBar); - setupAnimation(mQSBSearchBarAnim, mQSBSearchBar); } public void finishAnimations() { |