Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.core.view.doOnNextLayout
import androidx.fragment.app.Fragment
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.distinctUntilChanged
import androidx.lifecycle.observe
import androidx.navigation.NavOptions
import androidx.navigation.fragment.findNavController
Expand Down Expand Up @@ -44,6 +45,7 @@ import io.github.droidkaigi.confsched2020.session.ui.widget.SessionDetailItemDec
import io.github.droidkaigi.confsched2020.system.ui.viewmodel.SystemViewModel
import io.github.droidkaigi.confsched2020.ui.animation.MEDIUM_EXPAND_DURATION
import io.github.droidkaigi.confsched2020.ui.transition.fadeThrough
import io.github.droidkaigi.confsched2020.ui.widget.SystemUiManager
import javax.inject.Inject
import javax.inject.Provider

Expand Down Expand Up @@ -83,11 +85,20 @@ class SessionDetailFragment : Fragment(R.layout.fragment_session_detail), Inject
@Inject
lateinit var sessionDetailMaterialItemFactory: SessionDetailMaterialItem.Factory

private val navigationBarColors: SystemUiManager by lazy {
SystemUiManager(context!!)
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
sharedElementEnterTransition = fadeThrough().apply {
duration = MEDIUM_EXPAND_DURATION
}

navigationBarColors.systemUiVisibility.distinctUntilChanged().observe(this) {
activity?.window?.decorView?.systemUiVisibility =
Copy link
Copy Markdown
Member

@takahirom takahirom Jan 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
We are using SystemUiManager class. can you check it? 🙏

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@takahirom
sorry. I was busy working and couldn't help.
Unfortunately I couldn't call SystemUiManager.
Could you give me any advice?

Copy link
Copy Markdown
Member

@takahirom takahirom Feb 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course!
How about moving SystemUiManager to corecomponet?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@takahirom
This is solved using SystemUiManager! Thank you for the advice!
commit a08be2a

View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Field requires API level 23 (current min is 21): android.view.View#SYSTEM_UI_FLAG_LIGHT_STATUS_BAR

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Field requires API level 26 (current min is 21): android.view.View#SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR

}
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
Expand Down