У меня есть приложение, которое имеет повторный просмотр изображений в FragmentA, и когда пользователь нажимает на изображение, я бы хотел, чтобы изображение развернулось во FragmentB поверх FragmentA и отобразило FragmentA в фоновом режиме следующим образом:
Как мне добиться этого тонированного, полупрозрачного фона? Кроме того, есть ли название для панели инструментов, которая появляется в нижней части экрана при нажатии на желтую часть обведенной области?
Вот что у меня сейчас:
fragment_A.xml:
<?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"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_main"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_scrollFlags="scroll|enterAlways" />
</android.support.design.widget.AppBarLayout>
<!-- main recycler content-->
<include layout="@layout/recycler_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
fragment_B.xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/colorPrimaryDark"
android:clickable="true">
<!-- Place where image will be displayed-->
<com.github.chrisbanes.photoview.PhotoView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/view_media_viewer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
</FrameLayout>