-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: disabled backgesture in video seekbar view
- Loading branch information
gowtham.balamurugan
committed
Sep 5, 2023
1 parent
1e7ed74
commit de8c5f4
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
library/src/main/java/com/gowtham/library/utils/ViewUtil.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.gowtham.library.utils | ||
|
||
import android.content.res.Resources | ||
import android.graphics.Rect | ||
import android.os.Build | ||
import android.util.TypedValue | ||
import android.view.View | ||
import androidx.core.view.doOnLayout | ||
|
||
object ViewUtil { | ||
|
||
val Number.toPx get() = TypedValue.applyDimension( | ||
TypedValue.COMPLEX_UNIT_DIP, | ||
this.toFloat(), | ||
Resources.getSystem().displayMetrics).toInt() | ||
|
||
@JvmStatic | ||
fun systemGestureExclusionRects(viewRoot: View) { | ||
viewRoot.post { | ||
viewRoot.apply { | ||
doOnLayout { | ||
// updating exclusion rect | ||
val rects = mutableListOf<Rect>() | ||
rects.add(Rect(0,resources.displayMetrics.heightPixels-(120.toPx),width,resources.displayMetrics.heightPixels-(55.toPx))) | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { | ||
systemGestureExclusionRects = rects | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters