Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit bd34ee90 authored by Rafael Tonholo's avatar Rafael Tonholo Committed by GitHub
Browse files

Merge pull request #9157 from rafaeltonholo/fix/9136/navigation-bar-overlaid

Fixes transparent navigation bar when 3 buttons system navigation
parents d8e78dd3 e0ebe050
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.SystemClock
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuItem
@@ -17,8 +18,11 @@ import androidx.appcompat.view.ActionMode
import androidx.core.os.BundleCompat
import androidx.core.os.bundleOf
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsCompat.Type.navigationBars
import androidx.core.view.WindowInsetsCompat.Type.systemBars
import androidx.core.view.insets.GradientProtection
import androidx.core.view.insets.ProtectionLayout
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.core.view.setPadding
@@ -273,7 +277,23 @@ class MessageListFragment :

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return if (error == null) {
            inflater.inflate(R.layout.message_list_fragment, container, false)
            inflater.inflate(R.layout.message_list_fragment, container, false).also { view ->
                val typedValued = TypedValue()
                requireContext().theme.resolveAttribute(
                    com.google.android.material.R.attr.colorSurface,
                    typedValued,
                    true,
                )
                view.findViewById<ProtectionLayout>(R.id.protection_layout)
                    .setProtections(
                        listOf(
                            GradientProtection(
                                WindowInsetsCompat.Side.BOTTOM,
                                typedValued.data,
                            ),
                        ),
                    )
            }
        } else {
            inflater.inflate(R.layout.message_list_error, container, false)
        }
+16 −9
Original line number Diff line number Diff line
@@ -26,6 +26,12 @@
        android:layout_height="match_parent"
        >

        <androidx.core.view.insets.ProtectionLayout
            android:id="@+id/protection_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            >

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/message_list"
                android:layout_width="match_parent"
@@ -37,6 +43,7 @@
                android:scrollbars="vertical"
                tools:listitem="@layout/message_list_item"
                />
        </androidx.core.view.insets.ProtectionLayout>

    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>