mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-02-07 14:58:24 +00:00
Fixed navigation status bar color for file viewer fragment
This commit is contained in:
parent
ed9df940af
commit
940a6b0577
1 changed files with 16 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ import androidx.navigation.fragment.findNavController
|
|||
import androidx.navigation.fragment.navArgs
|
||||
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
|
||||
import kotlinx.coroutines.launch
|
||||
import org.linphone.R
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.databinding.FileViewerFragmentBinding
|
||||
import org.linphone.ui.main.MainActivity
|
||||
|
|
@ -46,6 +47,8 @@ class FileViewerFragment : GenericFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
private var navBarDefaultColor: Int = -1
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
|
|
@ -63,6 +66,8 @@ class FileViewerFragment : GenericFragment() {
|
|||
postponeEnterTransition()
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
navBarDefaultColor = requireActivity().window.navigationBarColor
|
||||
|
||||
viewModel = ViewModelProvider(this)[FileViewModel::class.java]
|
||||
|
||||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
|
|
@ -172,7 +177,11 @@ class FileViewerFragment : GenericFragment() {
|
|||
}
|
||||
|
||||
override fun onResume() {
|
||||
// Force this navigation bar color
|
||||
requireActivity().window.navigationBarColor = requireContext().getColor(R.color.gray_900)
|
||||
|
||||
super.onResume()
|
||||
|
||||
updateScreenSize()
|
||||
binding.pdfViewPager.registerOnPageChangeCallback(pageChangedListener)
|
||||
}
|
||||
|
|
@ -194,6 +203,13 @@ class FileViewerFragment : GenericFragment() {
|
|||
super.onDestroyView()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
// Reset default navigation bar color
|
||||
requireActivity().window.navigationBarColor = navBarDefaultColor
|
||||
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (requestCode == EXPORT_PDF && resultCode == Activity.RESULT_OK) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue