MaterialSearchView icon indicating copy to clipboard operation
MaterialSearchView copied to clipboard

MaterialSearchView on Navigation Drawer Activity

Open githeyj opened this issue 6 years ago • 2 comments

I tried this library on a navigation drawer activity. It blocks the fragment to be loaded on initiating the activity.

githeyj avatar Dec 11 '18 08:12 githeyj

I am facing the same issue

anandtripathi5 avatar Sep 15 '19 17:09 anandtripathi5

If you don't want search option for all fragments then you can add below code in your fragment.xml file,

<?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.mypackagename.FirstFragment">
    <FrameLayout
        android:id="@+id/frameLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/toolbar_container">
        <ExpandableListView
            android:id="@+id/elv_list"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </FrameLayout>
    <FrameLayout
        android:id="@+id/toolbar_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"/>

        <com.miguelcatalan.materialsearchview.MaterialSearchView
            android:id="@+id/search_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
    </FrameLayout>
</RelativeLayout>

nikhiltari25 avatar Oct 19 '20 16:10 nikhiltari25