I have a fragment. There is an ImageView on the top of this fragment. I need to place this ImageView under status bar and make it transparent like on this screenshot:
My fragment screenshot:
Code from fragment:
<androidx.constraintlayout.motion.widget.MotionLayout 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:background="@color/background"
app:layoutDescription="@xml/fragment_description_scene"
tools:context=".description.DescriptionFragment">
<ImageView
android:id="@+id/ivAttraction"
android:layout_width="match_parent"
android:layout_height="420dp"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.motion.widget.MotionLayout>
Code from styles.xml:
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.TravelManager" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/main_color</item>
<item name="colorPrimaryVariant">@color/background</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/main_color</item>
<item name="colorSecondaryVariant">@color/main_color</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<item name="android:windowLightStatusBar">true</item>
<!-- Customize your theme here. -->
</style>