Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Improvements in Insetter #16

Closed
SteinerOk opened this issue Oct 17, 2019 · 6 comments
Closed

Improvements in Insetter #16

SteinerOk opened this issue Oct 17, 2019 · 6 comments

Comments

@SteinerOk
Copy link
Contributor

  1. Very often with applying insets via doOnApplyWindowInsets using set content edge-to-edge. It would be nice to add a function like this:
inline fun View.setEdgeToEdgeContent() {
    if (ViewCompat.getFitsSystemWindows(this)) {
        systemUiVisibility =
                // Tells the system that you wish to be laid out
                // as if the navigation bar was hidden
            View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
                    // Optional, if we want you be laid out fullscreen,
                    // behind the status bar
                    View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
                    // Tells the system that you wish to be laid out at
                    // the most extreme scenario of any other flags
                    View.SYSTEM_UI_FLAG_LAYOUT_STABLE
    }
}
  1. Also it would be nice make constructors in ViewState and ViewDimensions public to allow usage in customs options, like where need return consumed or modified insets.

  2. And also it would be nice provide opportunities to return modified insets, like this usecase:
    https://github.com/google/iosched/blob/4054aa3f8934b8b1208d5823fdbf531a8eb367af/mobile/src/main/java/com/google/samples/apps/iosched/ui/MainActivity.kt#L154

@chrisbanes
Copy link
Owner

Thanks!

The first is now done and will be out in v0.2.0. We now have:
View.setEdgeToEdgeSystemUiFlags(...) in ktx, app:layout_edgeToEdge in dbx and a method on Insetter

I need to think more about the second and third option request. I've split this out into #23 for now.

@ghost
Copy link

ghost commented Nov 11, 2019

Hi @chrisbanes. Thanks for insetter library. I've just tested your InsetterConstraintLayout and it's edge to edge functionality. Have a question about android:windowSoftInputMode="adjustResize"
after applying edge to edge functionality. Seems like it does't work because of View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN. Is there any way to make it work together?

@chrisbanes
Copy link
Owner

@ramanbranavitski this is a better question for StackOverflow, or a similar forum. It's not specific to Insetter.

@ghost
Copy link

ghost commented Nov 12, 2019

Hm, it's strange that library function breaks another built in Android functionality. But anyway thanks for reply.

@chrisbanes
Copy link
Owner

Just because a library calls a framework API, doesn't mean it's responsible for any bugs or behavior changes in that underlying framework.

@ghost
Copy link

ghost commented Nov 12, 2019

That's also true. Thanks one more time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants