android - Custom MaterialSearchView Displayed Under Toolbar in a Fragment -
i'm using custom materialsearchview, , project following :
layouts:
mainlayout fragmentsection layout
codes :
mainactivity sectionfragment
in mainactivity there's drawer library, have 6 sections, 1 of fragments has search icon, here's problem .
in main layout have toolbar , fragment :
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" tools:context="com.abohani.ramadantime.mainactivity"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="?attr/colorprimary" app:layout_scrollflags="scroll|enteralways|snap" android:minheight="@dimen/abc_action_bar_default_height_material" android:theme="@style/themeoverlay.appcompat.dark.actionbar" app:popuptheme="@style/themeoverlay.appcompat.light" /> <framelayout android:id="@+id/fragment" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentbottom="true" android:layout_below="@+id/toolbar" /> </relativelayout>
as can see, fragment under toolbar, when transaction made, search shows under toolbar, why ?
because i'm adding searchview in fragment layout, , i'm repalcing mainlayout @id/fragment fragment layout, , fragment view under toolbar => searchview shows under .
what need ? i'd fix this, different logic on ?
here's fragment layout :
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/rel" android:orientation="vertical"> <com.lapism.searchview.searchview android:id="@+id/searchview" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.v7.widget.recyclerview android:id="@+id/fav_rv" android:layout_width="match_parent" android:layout_height="match_parent" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/no_match" android:visibility="invisible" android:layout_centervertical="true" android:layout_centerhorizontal="true" /> <include android:id="@+id/loading_layout" layout="@layout/loading_progress"/> </relativelayout>
Comments
Post a Comment