0

As you can see in the pictures, when the subpage dialog is opened, the places outside the subpage are not blurred. How do I fix this? I tried many methods but without success. I am using material theme as theme.

By the way, I also used the normal bottom sheet dialog other than the material bottom sheet, but I got the same result.

bottomsheet closed

bottomsheet opened

bottom_sheet_layout:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/bottom_sheet"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/white"
    android:clickable="true"
    android:focusable="true"
    style="@style/CustomBottomSheetDialogTheme"
    app:behavior_hideable="true"
    app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">


    <com.google.android.material.progressindicator.LinearProgressIndicator
        android:id="@+id/linearProgressIndicator"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        android:visibility="gone"
        app:indicatorColor="@color/primaryColor"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <EditText
        android:id="@+id/bottom_sheet_food_name_edittext"
        android:layout_width="220dp"
        android:layout_height="40dp"
        android:textSize="13sp"
        android:layout_marginStart="32dp"
        android:layout_marginTop="32dp"
        android:hint="Besin adı giriniz"
        android:paddingStart="12dp"
        android:maxLength="15"
        android:inputType="text"
        android:background="@drawable/add_food_manually_edittext_background"
        android:textColor="@color/black"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <EditText
        android:id="@+id/bottom_sheet_food_protein_edittext"
        android:layout_width="150dp"
        android:layout_height="40dp"
        android:textSize="13sp"
        android:layout_marginTop="8dp"
        android:hint="Protein(gr)"
        android:paddingStart="12dp"
        android:background="@drawable/add_food_manually_edittext_background"
        android:inputType="number"
        android:maxLength="4"
        android:textColor="@color/black"
        app:layout_constraintStart_toStartOf="@+id/bottom_sheet_food_name_edittext"
        app:layout_constraintTop_toBottomOf="@+id/bottom_sheet_food_name_edittext" />

    <EditText
        android:id="@+id/bottom_sheet_food_fat_edittext"
        android:layout_width="150dp"
        android:layout_height="40dp"
        android:layout_marginTop="8dp"
        android:background="@drawable/add_food_manually_edittext_background"
        android:hint="Yağ(gr)"
        android:inputType="number"
        android:maxLength="4"
        android:paddingStart="12dp"
        android:textColor="@color/black"
        android:textSize="13sp"
        app:layout_constraintStart_toStartOf="@+id/bottom_sheet_food_protein_edittext"
        app:layout_constraintTop_toBottomOf="@+id/bottom_sheet_food_protein_edittext" />

    <EditText
        android:id="@+id/bottom_sheet_food_carb_edittext"
        android:layout_width="150dp"
        android:layout_height="40dp"
        android:layout_marginTop="8dp"
        android:background="@drawable/add_food_manually_edittext_background"
        android:hint="Karbonhidrat(gr)"
        android:inputType="number"
        android:maxLength="4"
        android:paddingStart="12dp"
        android:textColor="@color/black"
        android:textSize="13sp"
        app:layout_constraintStart_toStartOf="@+id/bottom_sheet_food_fat_edittext"
        app:layout_constraintTop_toBottomOf="@+id/bottom_sheet_food_fat_edittext" />

    <EditText
        android:id="@+id/bottom_sheet_food_gram_edittext"
        android:layout_width="150dp"
        android:layout_height="40dp"
        android:layout_marginTop="8dp"
        android:background="@drawable/add_food_manually_edittext_background"
        android:hint="Gram"
        android:inputType="number"
        android:maxLength="4"
        android:paddingStart="12dp"
        android:textColor="@color/black"
        android:textSize="13sp"
        app:layout_constraintStart_toStartOf="@+id/bottom_sheet_food_carb_edittext"
        app:layout_constraintTop_toBottomOf="@+id/bottom_sheet_food_carb_edittext" />

    <Button
        android:id="@+id/bottom_sheet_addFoodBtn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:text="Ekle"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/bottom_sheet_food_gram_edittext" />

</androidx.constraintlayout.widget.ConstraintLayout>

styles.xml:

<resources xmlns:tools="http://schemas.android.com/tools">
    <!-- Base application theme.

     -->
    <style name="MaterialTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/primaryColor</item>
        <item name="colorPrimaryVariant">@color/primaryDarkColor</item>
        <item name="colorPrimaryDark">@color/primaryDarkColor</item>
        <item name="colorOnPrimary">@color/white</item>

        <item name="colorSecondary">@color/secondaryColor</item>
        <item name="colorSecondaryVariant">@color/secondaryDarkColor</item>
        <item name="colorOnSecondary">@color/white</item><!--Butonlar içindeki iconların rengi-->

        <item name="colorAccent">@color/colorAccent</item>

        <item name="android:textColorPrimary">@color/primaryTextColor</item>
        <item name="android:textColorSecondary">@color/secondaryTextColor</item>

        <item name="colorControlHighlight">@color/primaryLightColor</item><!--Ripple efect-->

        <item name="android:windowBackground">@color/activityBackgroundColor</item>

        <item name="materialButtonStyle">@style/standartButton</item>

        <item name="bottomSheetStyle">@style/CustomBottomSheetDialogTheme</item>
    </style>

    <style name="standartButton" parent="Widget.MaterialComponents.Button">
        <item name="backgroundTint">@color/colorAccent</item>
        <item name="android:textColor">@color/white</item>
        <item name="cornerRadius">5dp</item>
        <item name="fontFamily">@font/open_sans_bold</item>
        <item name="android:gravity">center</item>
    </style>

    <style name="whiteButton" parent="Widget.MaterialComponents.Button">
        <item name="backgroundTint">@color/white</item>
        <item name="android:textColor">@color/black</item>
        <item name="cornerRadius">5dp</item>
        <item name="textAllCaps">false</item>
        <item name="android:gravity">center</item>
    </style>

    <style name="MyCustomTabTextAppearance" parent="TextAppearance.Design.Tab"><!--Tablayout theme-->
        <item name="fontFamily">@font/open_sans_bold</item>

        <item name="textAllCaps">false</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert"><!-- progresdialog teması (google girişindeki ve diğer...) rengi. -->
        <item name="colorAccent">@android:color/holo_red_dark</item>
        <item name="android:textColorPrimary">@android:color/white</item>
    </style>

    <style name="popupStyle" parent="Theme.MaterialComponents.Dialog"><!-- Dialog penceresi teması -->
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowCloseOnTouchOutside">true</item>
    </style>

    <style name="ResultDialogTheme" parent="Theme.AppCompat.Light.DialogWhenLarge"><!-- Dialog fragment teması -->
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">true</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowEnterAnimation">@anim/anim_slide_up
        </item><!-- Dialog açılırken uygulanan animasyon -->
        <item name="android:windowExitAnimation">@anim/anim_slide_down
        </item><!-- Dialog kapanırken uygulanan animasyon -->
    </style>


    <style name="CustomBottomSheetDialogTheme" parent="Theme.Design.Light.BottomSheetDialog">
        <item name="bottomSheetStyle">@style/CustomBottomSheetStyle</item>
    </style>

    <style name="CustomBottomSheetStyle" parent="Widget.Design.BottomSheet.Modal">
        <item name="android:background">@android:color/transparent</item>
    </style>

</resources>
safauludogan
  • 61
  • 1
  • 7

0 Answers0