Skip to content

Commit 831a0fa

Browse files
committed
fix: Toast with application context
1 parent ba3d6eb commit 831a0fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

library/src/main/java/cn/jailedbird/edgeutils/EdgeControl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ internal object EdgeControl {
141141
val res = ViewCompat.getRootWindowInsets(this.decorView)
142142
if (res == null) {
143143
Toast.makeText(
144-
context,
144+
context.applicationContext,
145145
"ViewCompat.getRootWindowInsets(this.decorView) is null, please use View.post{ called_api } to ensure View has Attached",
146146
Toast.LENGTH_SHORT
147147
).show()

library/src/main/java/cn/jailedbird/edgeutils/EdgeUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ import cn.jailedbird.edgeutils.EdgeControl.showSystemBar
3838
* */
3939
object EdgeUtils {
4040
@JvmStatic
41-
fun setEdgeToEdge(activity: Activity, withScrim: Boolean = false) =
41+
fun setEdgeToEdge(activity: Activity, withScrim: Boolean = true) =
4242
activity.edgeToEdge(withScrim)
4343

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

0 commit comments

Comments
 (0)