我目前的应用程序有两个片段,在
FragmentA
中我在工具栏中有一个搜索视图,当点击搜索视图时,我必须使用我的框架布局在
fragmentA
的上面显示另一个片段,
FragmentB
,透明的视图,这样
FragmentA
中的内容就可以被看成是模糊的。新打开的透明背景的片段必须在回收器视图中显示一些内容。我们怎样才能在布局中实现透明和回收器视图。
布局代码。
<androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<LinearLayout
android:id="@+id/dot_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/drawer_layout"
android:elevation="50dp"
android:gravity="center"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/palate_survey_bg"
app:ignore="NamespaceTypo"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<androidx.appcompat.widget.SearchView
android:id="@+id/Advance_search"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/filter_search_bar_bg_lyt"
app:iconifiedByDefault="false"
app:queryHint="Search">
</androidx.appcompat.widget.SearchView>
</androidx.appcompat.widget.Toolbar >
<FrameLayout
android:id="@+id/search_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar">
</FrameLayout>
</LinearLayout>
</androidx.drawerlayout.widget.DrawerLayout