<...">

Blending Content to BottomNavigationView

I am using BottomNavigationView

in my application. how

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="wormhole.musicx.activity.Artist_Details">
<android.support.design.widget.AppBarLayout
    android:id="@+id/app_bar"
    android:layout_width="match_parent"
    android:layout_height="@dimen/app_bar_height"
    android:fitsSystemWindows="true"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/toolbar_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        app:contentScrim="@android:color/transparent"
        app:layout_scrollFlags="scroll|exitUntilCollapsed">



        <ImageView
            android:id="@+id/artistArt"
            android:layout_width="match_parent"
            android:layout_height="280dp"
            android:scaleType="centerCrop"
            android:src="@drawable/album"
            android:transitionName="@string/albumInageTransition"
            app:layout_collapseMode="parallax" />


        <View
            android:layout_width="match_parent"
            android:layout_height="80dp"
            android:layout_alignBottom="@+id/image"
            android:layout_gravity="bottom"
            android:background="@drawable/scrim_bottom" />

        <TextView
            android:id="@+id/albumDetails"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:layout_marginBottom="5dp"
            android:layout_marginLeft="35dp"
            android:layout_marginTop="10dp"
            android:text="fwefbwe"
            android:textSize="17sp"
            app:layout_anchor="@id/toolbar_layout"
            app:layout_anchorGravity="bottom|end"
            app:layout_collapseMode="parallax"
            app:layout_scrollFlags="scroll|exitUntilCollapsed|snap" />


        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_collapseMode="pin"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

    </android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_artist__details" />

<android.support.design.widget.BottomNavigationView
    android:id="@+id/navigation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:background="?android:attr/windowBackground"
    app:menu="@menu/navigation"
    />


<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="@dimen/fab_margin"
    app:layout_anchor="@id/app_bar"
    app:layout_anchorGravity="bottom|end"
    app:srcCompat="@drawable/ic_favourite" />

      

and content_artist__details

 <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="wormhole.musicx.activity.Artist_Details"
    tools:showIn="@layout/activity_artist__details"
    android:layout_marginBottom="20dp">

<android.support.v7.widget.RecyclerView
    android:visibility="visible"
    android:id="@+id/songListArtistRec"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

</android.support.v7.widget.RecyclerView>

      

The problem I am retrieving for content included layout

is under BottomNavigationView

. I can't figure out what to do.

I want the content content_artist__details

just above BottomNavigationView

.

+3


source to share


1 answer


Can you try using layout_marginBottom = "@dimen/app_bar_height"

And since you only have the RecyclerView in the nested layout, you can update your code with something like this:



<android.support.v7.widget.RecyclerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:visibility="visible"
    android:id="@+id/songListArtistRec"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="wormhole.musicx.activity.Artist_Details"
    tools:showIn="@layout/activity_artist__details"
    android:layout_marginBottom="@dimen/app_bar_height"/>

      

0


source







All Articles