@ -13,6 +13,8 @@ import android.view.Gravity
import android.view.LayoutInflater
import android.view.LayoutInflater
import android.view.View
import android.view.View
import android.view.ViewGroup
import android.view.ViewGroup
import android.view.Window
import android.view.WindowManager
import android.widget.Button
import android.widget.Button
import android.widget.LinearLayout
import android.widget.LinearLayout
import android.widget.PopupWindow
import android.widget.PopupWindow
@ -210,9 +212,28 @@ class HomeFragment : Fragment() {
activity . themeManager . applyStatusBarTheme ( activity )
activity . themeManager . applyStatusBarTheme ( activity )
setFragmentFullScreen ( this . activity ?. window , view . homeLayout )
return view
return view
}
}
private fun setFragmentFullScreen ( window : Window ? , homeScreen : View ) {
window ?. decorView ?. setOnApplyWindowInsetsListener { _ , insets ->
homeScreen . setPadding (
homeScreen . paddingLeft ,
homeScreen . paddingTop + insets . stableInsetTop ,
homeScreen . paddingRight ,
homeScreen . paddingBottom + insets . stableInsetBottom
)
window . decorView . setOnApplyWindowInsetsListener ( null )
insets . consumeSystemWindowInsets ( )
}
}
@ExperimentalCoroutinesApi
@ExperimentalCoroutinesApi
@SuppressWarnings ( " LongMethod " )
@SuppressWarnings ( " LongMethod " )
override fun onViewCreated ( view : View , savedInstanceState : Bundle ? ) {
override fun onViewCreated ( view : View , savedInstanceState : Bundle ? ) {
@ -249,7 +270,7 @@ class HomeFragment : Fragment() {
if ( menu == null ) {
if ( menu == null ) {
menu = homeMenu ?. menuBuilder ?. build ( requireContext ( ) ) ?. show (
menu = homeMenu ?. menuBuilder ?. build ( requireContext ( ) ) ?. show (
anchor = it ,
anchor = it ,
orientation = BrowserMenu . Orientation . DOWN ,
orientation = BrowserMenu . Orientation . UP ,
onDismiss = { menu = null }
onDismiss = { menu = null }
)
)
} else {
} else {
@ -438,6 +459,8 @@ class HomeFragment : Fragment() {
override fun onResume ( ) {
override fun onResume ( ) {
super . onResume ( )
super . onResume ( )
this . activity ?. window ?. setFlags ( WindowManager . LayoutParams . FLAG _LAYOUT _NO _LIMITS ,
WindowManager . LayoutParams . FLAG _LAYOUT _NO _LIMITS )
hideToolbar ( )
hideToolbar ( )
}
}
@ -773,6 +796,11 @@ class HomeFragment : Fragment() {
}
}
}
}
override fun onPause ( ) {
this . activity ?. window ?. clearFlags ( WindowManager . LayoutParams . FLAG _LAYOUT _NO _LIMITS )
super . onPause ( )
}
companion object {
companion object {
private const val NON _TAB _ITEM _NUM = 3
private const val NON _TAB _ITEM _NUM = 3
private const val ANIM _SCROLL _DELAY = 100L
private const val ANIM _SCROLL _DELAY = 100L