Skip to content
This repository was archived by the owner on Aug 10, 2020. It is now read-only.

Conversation

@pavsidhu
Copy link
Member

Works fine but doesn't seem to allow views to sit behind the status bar to change its colour. This current implantation though is a step in the right direction.

@pavsidhu pavsidhu requested a review from adamjhc September 10, 2019 10:42
val menuLayoutParams = this.layoutParams as ViewGroup.MarginLayoutParams
menuLayoutParams.setMargins(0, marginTop, 0, 0)
this.layoutParams = menuLayoutParams
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}
}

}
this.makeStatusBarTransparent()


Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change

import android.view.WindowManager

fun Activity.makeStatusBarTransparent() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

there's no compat way of doing this? I really dislike the look of this. Also why can't this just be a private function in the activity?


fun Activity.makeStatusBarTransparent() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.apply {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
window.apply {
with(window) {

It should be this unless window is what you're returning

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants