Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ahmad Hamwi Ahmad-Hamwi

🎯
Focusing
View GitHub Profile
View Item.kt
class Item(val content: String) {
}
@Ahmad-Hamwi
Ahmad-Hamwi / setDecorFitSystemWindow.kt
Created Jul 28, 2021
A useful binding adapter that stretch the views boundaries to draw behind the system bar insets (aka going edge-to-edge)
View setDecorFitSystemWindow.kt
/**
* example:
*
* <!--parent container (that's expanded to fullscreen)-->
* <androidx.constraintlayout.widget.ConstraintLayout
* android:layout_width="match_parent"
* android:layout_height="match_parent"
* ...
* app:setDecorFitSystemWindow="@{true}">
* ...
@Ahmad-Hamwi
Ahmad-Hamwi / applySystemBarsInsetOnPadding.kt
Created Jul 28, 2021
A useful binding adapter that will update the view's padding according to the system bar insets.
View applySystemBarsInsetOnPadding.kt
/**
* Example:
*
* <!--parent container (that's expanded to fullscreen)-->
* <androidx.constraintlayout.widget.ConstraintLayout
* android:layout_width="match_parent"
* android:layout_height="match_parent"
* ...
* app:applySystemBarsInsetOnPadding="@{true}">
* ...