1
0
Fork 0
fenix/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt

37 lines
1.3 KiB
Kotlin
Raw Normal View History

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.tabtray
2020-05-21 05:20:29 +02:00
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatDialogFragment
2020-05-21 05:20:29 +02:00
import androidx.core.view.updatePadding
import kotlinx.android.synthetic.main.fragment_tab_tray_dialog.view.*
import org.mozilla.fenix.R
class TabTrayDialogFragment : AppCompatDialogFragment() {
2020-05-21 05:20:29 +02:00
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(STYLE_NO_TITLE, R.style.TabTrayDialogStyle)
}
2020-05-21 05:20:29 +02:00
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? = inflater.inflate(R.layout.fragment_tab_tray_dialog, container, false)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.tabLayout.setOnApplyWindowInsetsListener { v, insets ->
v.updatePadding(
bottom = v.paddingBottom + insets.systemWindowInsetBottom
)
insets
}
}
}