Status Update
Comments
[Deleted User] <[Deleted User]> #3
I'm going to leave this here as well, for reference: http://stackoverflow.com/questions/40171801/bottomnavigationview-hides-when-scrolling-up-instead-of-down
In my use case, the BottomNavigationView is inside a fragment, inside a FrameLayout which is contained in a CoordinatorLayout and the scroll to hide technique works, but in reverse compared to how it's supposed to work. Using the BottomNavigationView directly inside the CoordinatorLayout doesn't have any scroll behavior though.
In my use case, the BottomNavigationView is inside a fragment, inside a FrameLayout which is contained in a CoordinatorLayout and the scroll to hide technique works, but in reverse compared to how it's supposed to work. Using the BottomNavigationView directly inside the CoordinatorLayout doesn't have any scroll behavior though.
re...@gmail.com <re...@gmail.com> #4
I'm having the same issue. There is an estimation when this issue will be fixed?
re...@gmail.com <re...@gmail.com> #5
This has been released in support library 25.0.1.
ch...@gmail.com <ch...@gmail.com> #6
Scroll behavior is still missing. For those that are looking for one, sample project archive contains it.
ar...@idealo.de <ar...@idealo.de> #7
Elevation part was fixed. Still working on the behavior.
ju...@gmail.com <ju...@gmail.com> #8
Elevation is broken if you use app:itemBackground rather than android:background since it's setting the elevation on itself rather than mMenuView. Why is itemBackground exposed? Should I not just use android:background?
ro...@gmail.com <ro...@gmail.com> #9
[Comment deleted]
re...@gmail.com <re...@gmail.com> #10
Set transparent color for app:itemBackground and use solid color on the BottomNavigationView background. That would be the only way to see the elevation, otherwise the top most parent (BNV) will not draw the elevation onto which you are applying elevation, since it doesnt have solid background.
If android:background is used on < 21, shadow is overlaid over the background. Elevation does not cast upward shadow, does it? So the method addCompatibilityTopDivider() in current 25.0.1 should be available for all versions.
If android:background is used on < 21, shadow is overlaid over the background. Elevation does not cast upward shadow, does it? So the method addCompatibilityTopDivider() in current 25.0.1 should be available for all versions.
al...@android.com <al...@android.com>
ju...@gmail.com <ju...@gmail.com> #11
app:itemBackground is meant to be used for adding ripples/pressed state. By default it just has a round ripple. To set the background color for you should use android:background, once you do so you will see the shadow on API 21+ above BottomNavigationView (just using elevation) and for pre API 21 we add a simple 1dp divider to separate it from the background as elevation does not exist in these platforms.
Am I missing something?
Am I missing something?
ju...@gmail.com <ju...@gmail.com> #12
You can't cast shadow to the top. I tried to add android:elevation="40dp" and android:elevation="8dp" on a solid background but still I was unable to see the shadow cast on the top, shadow is cast only below the BNV (this is perfectly normal). Given this, I said that top divider should be available for all version to achieve top shadow.
ch...@google.com <ch...@google.com>
yh...@gmail.com <yh...@gmail.com> #14
When is the scrolling behavior planned to be released?
pa...@gmail.com <pa...@gmail.com> #15
I have updated to the new Support Library version (25.1.0) and I still see no shadow above the BNV, see attached screenshot.
<android.support.design.widget.BottomNavigationView
android:elevation="40dp"
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/darkestGray"
app:itemIconTint="@drawable/nav_item_color_state"
app:itemTextColor="@drawable/nav_item_color_state"
app:menu="@menu/bottom_navigation_widget" />
<android.support.design.widget.BottomNavigationView
android:elevation="40dp"
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/darkestGray"
app:itemIconTint="@drawable/nav_item_color_state"
app:itemTextColor="@drawable/nav_item_color_state"
app:menu="@menu/bottom_navigation_widget" />
th...@gmail.com <th...@gmail.com> #16
Updated to 25.1.0. Shadow doesn't displayed.
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/colorPrimary"
android:elevation="8dp"
app:elevation="8dp"
app:itemIconTint="@drawable/bottom_nav_color_state"
app:itemTextColor="@drawable/bottom_nav_color_state"
app:menu="@menu/bottom_navigation_main"/>
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/colorPrimary"
android:elevation="8dp"
app:elevation="8dp"
app:itemIconTint="@drawable/bottom_nav_color_state"
app:itemTextColor="@drawable/bottom_nav_color_state"
app:menu="@menu/bottom_navigation_main"/>
th...@gmail.com <th...@gmail.com> #17
is the shadow and scrolling behavior has been added?
ja...@gmail.com <ja...@gmail.com> #18
wait for shadow and scrolling behavior...
mr...@gmail.com <mr...@gmail.com> #19
The target release was 25.0.1 and we're now at 26.0.0-beta2. Could you guys at least put an actual, realistic target on this issue?
li...@gmail.com <li...@gmail.com> #24
Scrolling behavior has been added. You can use it by setting a HideBottomViewOnScrollBehavior on the BottomNavigationView: app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior".
See class documentation for BottomNavigationView:https://developer.android.com/reference/com/google/android/material/bottomnavigation/BottomNavigationView .
And for HideBottomViewOnScrollBehavior:https://developer.android.com/reference/com/google/android/material/behavior/HideBottomViewOnScrollBehavior .
This is available in our 28.0.0-alpha1 release or the 1.0.0-alpha1 release or later.
See class documentation for BottomNavigationView:
And for HideBottomViewOnScrollBehavior:
This is available in our 28.0.0-alpha1 release or the 1.0.0-alpha1 release or later.
ro...@gmail.com <ro...@gmail.com> #25
When the bottom bar is partly visible (eg user scrolled just a bit and stopped scrolling), does the bottom bar snaps automatically to either be fully visible or hidden like
a CollapsingToolbarLayout would do with app:layout_scrollFlags="scroll|snap" ?
a CollapsingToolbarLayout would do with app:layout_scrollFlags="scroll|snap" ?
pr...@gmail.com <pr...@gmail.com> #26
Im on 28.0.0 and the bottom shadow still doesnt show up at the top when i set the app:elevation in BNV.
is it yet to be fixed ? Here is my layout
<android.support.design.widget.BottomNavigationView
android:id="@+id/landing_bottom_nav"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/white"
app:elevation="4dp"
android:elevation="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:menu="@menu/landing_menu"/>
is it yet to be fixed ? Here is my layout
<android.support.design.widget.BottomNavigationView
android:id="@+id/landing_bottom_nav"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/white"
app:elevation="4dp"
android:elevation="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:menu="@menu/landing_menu"/>
ro...@gmail.com <ro...@gmail.com> #27
With this HideBottomViewOnScrollBehavior , Scrolling behavior working fine but, Showing white space occupying the size of that bottom view.
ml...@gmail.com <ml...@gmail.com> #28
@srinivasmakkena058 Could you please provide a video showing the scrolling whitespace issue? And could you file a separate issue, since the scroll behavior doesn't appear to be missing, which is the issue described in the title of this bug?
@pujos.michael Please file a separate bug about elevation concerns. I looked into bottom navigation elevation a couple years back, and I believe it's actually sort of WAI that the shadow hardly shows -- the light source is at the top of the screen which would make the shadow show at the bottom of the bar. Happy to discuss and address in a separate issue, but let's keep this one focused on scroll behavior.
[Deleted User] <[Deleted User]> #30
I can confirm this has been fixed with the recent release of 24.2.1
ch...@google.com <ch...@google.com> #31
Fixed in the 24.2.1 of the support library
hy...@gmail.com <hy...@gmail.com> #32
I have same issue in support libraries 24.2.1 and 25.0.1.
FAB shows fine only when anchor set to direct child of coordinator layout.
FAB shows fine only when anchor set to direct child of coordinator layout.
hy...@gmail.com <hy...@gmail.com> #33
Issue is happened only on first inflate UI, after that behaviour and gravity of FAB is OK.
di...@gmail.com <di...@gmail.com> #34
da...@googlemail.com <da...@googlemail.com> #35
Got the same issue since upgrade from support libraries 23.1.1 up to 25.0.1.
Seems like #35 is my current working, preferred solution.
Often my FAB was displayed at the top left cornor instead bottom right on it's anchor (like described inhttp://stackoverflow.com/a/40935790/2358687 ). I simply have a CoordninatorLayout with a RecyclerView and the FAB within.
Initially I wanted to align the FAB via anchor definition in XML:
app:layout_anchor="@id/recyclerView"
app:layout_anchorGravity="bottom|end"
I replaced the app:layout_anchor* attributes by
android:layout_gravity="bottom|end"
Thanks dingenen!
Seems like #35 is my current working, preferred solution.
Often my FAB was displayed at the top left cornor instead bottom right on it's anchor (like described in
Initially I wanted to align the FAB via anchor definition in XML:
app:layout_anchor="@id/recyclerView"
app:layout_anchorGravity="bottom|end"
I replaced the app:layout_anchor* attributes by
android:layout_gravity="bottom|end"
Thanks dingenen!
pe...@gmail.com <pe...@gmail.com> #36
I am having the same issue with #34.
I have a recyclerview list item containing a FAB that is anchored to an imageView all in a CardView. On view inflation some of the FAB doesn't seem to anchor to the view. But after scrolling down and up, the fab corrects its position.
I have a recyclerview list item containing a FAB that is anchored to an imageView all in a CardView. On view inflation some of the FAB doesn't seem to anchor to the view. But after scrolling down and up, the fab corrects its position.
Description
Version used: 24.2.0
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on: Android 6.0 Emulator
Prior to support library version 24.2.0, a FAB could be anchored to a nested child of a CoordinatorLayout.
For example, with the following view hierarchy:
<CoordinatorLayout>
<LinearLayout>
<LinearLayout>
<View>
</LinearLayout>
<LinearLayout>
<Fab>
</CoordinatorLayout>
The FAB could be anchored to View.
With 24.2.0, the app now crashes with the exception:
android.widget.LinearLayout$LayoutParams cannot be cast to android.support.design.widget.CoordinatorLayout$LayoutParams
This is due to the isBottomSheet() method in the FloatingActionButton class. It assumes that the view has CoordinatorLayout LayoutParams.
Attached is a project demonstrating this issue. The example works if the compiled support library version is changed to 24.0.0.