Commit 127391e9 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

upgrade hide/show status bar flow

parent b80e5724
...@@ -38,18 +38,6 @@ class ChooseResolutionDialogController : Controller { ...@@ -38,18 +38,6 @@ class ChooseResolutionDialogController : Controller {
lateinit var recyclerView : RecyclerView lateinit var recyclerView : RecyclerView
// override fun onAttach(view: View) {
// tempSystemUiFlag = activity?.window?.decorView?.systemUiVisibility
// activity?.window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
// super.onAttach(view)
// }
//
// private var tempSystemUiFlag : Int? = null
// override fun onDetach(view: View) {
// activity?.window?.decorView?.systemUiVisibility = tempSystemUiFlag?:View.SYSTEM_UI_FLAG_LAYOUT_STABLE
// super.onDetach(view)
// }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View {
val view = inflater.inflate(getLayoutId(), container, false) val view = inflater.inflate(getLayoutId(), container, false)
...@@ -69,17 +57,16 @@ class ChooseResolutionDialogController : Controller { ...@@ -69,17 +57,16 @@ class ChooseResolutionDialogController : Controller {
(recyclerView.adapter as PhotoSizeAdapter).notifyDataSetChanged() (recyclerView.adapter as PhotoSizeAdapter).notifyDataSetChanged()
} }
view.findViewById<View>(R.id.cancel_button).setOnClickListener { handleBack() }
return view return view
} }
@LayoutRes @LayoutRes
fun getLayoutId() = R.layout.choose_size_modal_screen fun getLayoutId() = R.layout.choose_size_modal_screen
var dismissActionDelegate = { override fun handleBack(): Boolean {
router.popCurrentController() return router.popCurrentController()
Unit
// args.putParcelableArrayList("sdsd", arrayListOf<PhotoModel>())
} }
......
...@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.photo ...@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.photo
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.WindowManager
import android.widget.ImageView import android.widget.ImageView
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import androidx.viewpager2.widget.ViewPager2 import androidx.viewpager2.widget.ViewPager2
...@@ -62,12 +63,11 @@ class PhotoScreenController : ...@@ -62,12 +63,11 @@ class PhotoScreenController :
} }
override fun onAttach(view: View) { override fun onAttach(view: View) {
tempSystemUiFlag = activity?.window?.decorView?.systemUiVisibility // tempSystemUiFlag = activity?.window?.decorView?.systemUiVisibility
activity?.window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
super.onAttach(view) super.onAttach(view)
} }
private var tempSystemUiFlag : Int? = null private var tempSystemUiFlag : Int? = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
override fun onDetach(view: View) { override fun onDetach(view: View) {
// activity?.window?.decorView?.systemUiVisibility = tempSystemUiFlag?:View.SYSTEM_UI_FLAG_LAYOUT_STABLE // activity?.window?.decorView?.systemUiVisibility = tempSystemUiFlag?:View.SYSTEM_UI_FLAG_LAYOUT_STABLE
super.onDetach(view) super.onDetach(view)
...@@ -95,6 +95,9 @@ class PhotoScreenController : ...@@ -95,6 +95,9 @@ class PhotoScreenController :
toolBar.setToolbar() toolBar.setToolbar()
bottomNavigationController.hide() bottomNavigationController.hide()
bindRecycler() bindRecycler()
// activity?.window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
activity?.window?.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
} }
override fun injectDependencies() { override fun injectDependencies() {
...@@ -159,7 +162,12 @@ class PhotoScreenController : ...@@ -159,7 +162,12 @@ class PhotoScreenController :
// (photoViewPager.adapter as PhotoViewerAdapter).setItems(arrayListOf(viewState.model)) // (photoViewPager.adapter as PhotoViewerAdapter).setItems(arrayListOf(viewState.model))
} }
override fun handleBack(): Boolean {router.popController(this); return true} override fun handleBack(): Boolean {
activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
// activity?.window?.decorView?.systemUiVisibility = tempSystemUiFlag?:View.SYSTEM_UI_FLAG_LAYOUT_STABLE
router.popController(this)
return true
}
override fun getLayoutId(): Int = R.layout.photo_view_screen override fun getLayoutId(): Int = R.layout.photo_view_screen
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout7" android:id="@+id/linearLayout7"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:background="@color/colorPrimary">
<FrameLayout <FrameLayout
android:id="@+id/frameLayout2" android:id="@+id/frameLayout2"
...@@ -26,7 +25,8 @@ ...@@ -26,7 +25,8 @@
style="@style/Header_TextView.Main_Header" style="@style/Header_TextView.Main_Header"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:background="@color/colorPrimary"
android:paddingStart="16dp"
android:text="ОТКРЫТЬ\nВ ДРУГОМ РАЗМЕРЕ" android:text="ОТКРЫТЬ\nВ ДРУГОМ РАЗМЕРЕ"
android:textAlignment="viewStart" android:textAlignment="viewStart"
app:layout_constraintBottom_toTopOf="@+id/include4" app:layout_constraintBottom_toTopOf="@+id/include4"
...@@ -47,16 +47,19 @@ ...@@ -47,16 +47,19 @@
android:id="@+id/photoSizesRecyclerView" android:id="@+id/photoSizesRecyclerView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:background="@color/colorPrimary"
app:layout_constraintBottom_toTopOf="@+id/materialTextView" android:paddingStart="16dp"
app:layout_constraintBottom_toTopOf="@+id/cancel_button"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/materialTextView" android:id="@+id/cancel_button"
style="@style/Default_TextView.Cancel_Text" style="@style/Default_TextView.Cancel_Text"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:clickable="true"
android:gravity="center" android:gravity="center"
android:paddingTop="32dp" android:paddingTop="32dp"
android:paddingBottom="64dp" android:paddingBottom="64dp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment