Skip to content

Commit

Permalink
fix: Toast with application context
Browse files Browse the repository at this point in the history
  • Loading branch information
JailedBird committed Dec 3, 2022
1 parent ba3d6eb commit 831a0fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ internal object EdgeControl {
val res = ViewCompat.getRootWindowInsets(this.decorView)
if (res == null) {
Toast.makeText(
context,
context.applicationContext,
"ViewCompat.getRootWindowInsets(this.decorView) is null, please use View.post{ called_api } to ensure View has Attached",
Toast.LENGTH_SHORT
).show()
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/java/cn/jailedbird/edgeutils/EdgeUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ import cn.jailedbird.edgeutils.EdgeControl.showSystemBar
* */
object EdgeUtils {
@JvmStatic
fun setEdgeToEdge(activity: Activity, withScrim: Boolean = false) =
fun setEdgeToEdge(activity: Activity, withScrim: Boolean = true) =
activity.edgeToEdge(withScrim)

/**
* Make activity implement edge-to-edge layout--> first step
*
* [withScrim] if true, set background as TRANSPARENT(alpha=0) else TRANSPARENT(alpha=1)
* */
fun Activity.edgeToEdge(withScrim: Boolean = false) {
fun Activity.edgeToEdge(withScrim: Boolean = true) {
/**
* To fix [hide status bar cause black background] please reference this video
* [youtube course](https://www.youtube.com/watch?v=yukwno2GBoI)
Expand Down

0 comments on commit 831a0fa

Please sign in to comment.