From 4ebc3d070ffa5ffda469aebcece20efda52d2028 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Fri, 5 Aug 2016 10:59:17 -0700 Subject: Change NavBar to transparent black b/30615471 Change-Id: I7885e8a7fd63ee10c9b0107087046730e8acfde9 --- res/layout/all_apps.xml | 3 +-- res/values/colors.xml | 1 + src/com/android/launcher3/BaseRecyclerViewFastScrollBar.java | 9 +++++---- src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java | 2 +- src/com/android/launcher3/allapps/AllAppsContainerView.java | 2 +- src/com/android/launcher3/allapps/AllAppsGridAdapter.java | 7 +++++-- src/com/android/launcher3/allapps/AllAppsRecyclerView.java | 7 +++++++ 7 files changed, 21 insertions(+), 10 deletions(-) diff --git a/res/layout/all_apps.xml b/res/layout/all_apps.xml index 5c2c4b869..4909eb38b 100644 --- a/res/layout/all_apps.xml +++ b/res/layout/all_apps.xml @@ -89,8 +89,7 @@ android:layout_width="match_parent" android:layout_height="0dp" android:layout_gravity="bottom" - android:background="@android:color/black" - android:elevation="16dp" + android:background="@color/all_apps_navbar_color" android:focusable="false" android:visibility="invisible" /> \ No newline at end of file diff --git a/res/values/colors.xml b/res/values/colors.xml index 21d9d5c93..d5ce78607 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -39,6 +39,7 @@ #FFFFFFFF #22000000 #FFF2F2F2 + #28000000 #40FFFFFF #FFF diff --git a/src/com/android/launcher3/BaseRecyclerViewFastScrollBar.java b/src/com/android/launcher3/BaseRecyclerViewFastScrollBar.java index 89f7286d1..3d71632ce 100644 --- a/src/com/android/launcher3/BaseRecyclerViewFastScrollBar.java +++ b/src/com/android/launcher3/BaseRecyclerViewFastScrollBar.java @@ -136,11 +136,11 @@ public class BaseRecyclerViewFastScrollBar { // Setter/getter for the track bar width for animations public void setTrackWidth(int width) { mInvalidateRect.set(mThumbOffset.x - mThumbCurvature, 0, mThumbOffset.x + mThumbWidth, - mRv.getHeight()); + mRv.getVisibleHeight()); mTrackWidth = width; updateThumbPath(); mInvalidateRect.union(mThumbOffset.x - mThumbCurvature, 0, mThumbOffset.x + mThumbWidth, - mRv.getHeight()); + mRv.getVisibleHeight()); mRv.invalidate(mInvalidateRect); } @@ -198,7 +198,7 @@ public class BaseRecyclerViewFastScrollBar { if (mIsDragging) { // Update the fastscroller section name at this touch position int top = mRv.getBackgroundPadding().top; - int bottom = mRv.getHeight() - mRv.getBackgroundPadding().bottom - mThumbHeight; + int bottom = top + mRv.getVisibleHeight() - mThumbHeight; float boundedY = (float) Math.max(top, Math.min(bottom, y - mTouchOffset)); String sectionName = mRv.scrollToPositionAtProgress((boundedY - top) / (bottom - top)); @@ -230,7 +230,8 @@ public class BaseRecyclerViewFastScrollBar { // Draw the scroll bar track and thumb if (mTrackPaint.getAlpha() > 0) { - canvas.drawRect(mThumbOffset.x, 0, mThumbOffset.x + mThumbWidth, mRv.getHeight(), mTrackPaint); + canvas.drawRect(mThumbOffset.x, 0, mThumbOffset.x + mThumbWidth, + mRv.getVisibleHeight(), mTrackPaint); } canvas.drawPath(mThumbPath, mThumbPaint); diff --git a/src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java b/src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java index b4567c53c..b9e627775 100644 --- a/src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java +++ b/src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java @@ -112,7 +112,7 @@ public class BaseRecyclerViewFastScrollPopup { } mBgBounds.top = lastTouchY - (int) (FAST_SCROLL_OVERLAY_Y_OFFSET_FACTOR * bgHeight); mBgBounds.top = Math.max(edgePadding, - Math.min(mBgBounds.top, mRv.getHeight() - edgePadding - bgHeight)); + Math.min(mBgBounds.top, mRv.getVisibleHeight() - edgePadding - bgHeight)); mBgBounds.bottom = mBgBounds.top + bgHeight; // Generate a bitmap for a shadow matching these bounds diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index d8601893e..505762a40 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -464,7 +464,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc MarginLayoutParams mlp = (MarginLayoutParams) mAppsRecyclerView.getLayoutParams(); Rect insets = mLauncher.getDragLayer().getInsets(); - getContentView().setPadding(0, 0, 0, insets.bottom); + getContentView().setPadding(0, 0, 0, 0); int height = insets.top + grid.hotseatCellHeightPx; mlp.topMargin = height; diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java index d8f9fb189..39ab58b8f 100644 --- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java +++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java @@ -38,7 +38,6 @@ import android.widget.TextView; import com.android.launcher3.AppInfo; import com.android.launcher3.BubbleTextView; -import com.android.launcher3.CellLayout; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.R; @@ -49,7 +48,6 @@ import com.android.launcher3.shortcuts.ShortcutsContainerListener; import java.util.HashMap; import java.util.List; - /** * The grid view adapter of all the apps. */ @@ -134,6 +132,11 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter