Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
90329a14
authored
Dec 10, 2019
by
olly
Committed by
Oliver Woodman
Dec 10, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Make DefaultTimeBar exclude itself for gestures
Issue: #6685 PiperOrigin-RevId: 284736041
parent
c027b4e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
RELEASENOTES.md
library/ui/src/main/java/com/google/android/exoplayer2/ui/DefaultTimeBar.java
RELEASENOTES.md
View file @
90329a14
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
*
Upgrade Truth dependency from 0.44 to 1.0.
*
Upgrade Truth dependency from 0.44 to 1.0.
*
Upgrade to JUnit 4.13-rc-2.
*
Upgrade to JUnit 4.13-rc-2.
*
Add support for attaching DRM sessions to clear content in the demo app.
*
Add support for attaching DRM sessions to clear content in the demo app.
*
UI: Exclude
`DefaultTimeBar`
region from system gesture detection
(
[
#6685
](
https://github.com/google/ExoPlayer/issues/6685
)
).
### 2.11.0 (2019-12-11) ###
### 2.11.0 (2019-12-11) ###
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/DefaultTimeBar.java
View file @
90329a14
...
@@ -36,12 +36,15 @@ import android.view.accessibility.AccessibilityNodeInfo;
...
@@ -36,12 +36,15 @@ import android.view.accessibility.AccessibilityNodeInfo;
import
android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction
;
import
android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction
;
import
androidx.annotation.ColorInt
;
import
androidx.annotation.ColorInt
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.RequiresApi
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
java.util.Collections
;
import
java.util.Formatter
;
import
java.util.Formatter
;
import
java.util.Locale
;
import
java.util.Locale
;
import
java.util.concurrent.CopyOnWriteArraySet
;
import
java.util.concurrent.CopyOnWriteArraySet
;
import
org.checkerframework.checker.nullness.qual.MonotonicNonNull
;
/**
/**
* A time bar that shows a current position, buffered position, duration and ad markers.
* A time bar that shows a current position, buffered position, duration and ad markers.
...
@@ -199,6 +202,7 @@ public class DefaultTimeBar extends View implements TimeBar {
...
@@ -199,6 +202,7 @@ public class DefaultTimeBar extends View implements TimeBar {
private
int
keyCountIncrement
;
private
int
keyCountIncrement
;
private
long
keyTimeIncrement
;
private
long
keyTimeIncrement
;
private
int
lastCoarseScrubXPosition
;
private
int
lastCoarseScrubXPosition
;
@MonotonicNonNull
private
Rect
lastExclusionRectangle
;
private
boolean
scrubbing
;
private
boolean
scrubbing
;
private
long
scrubPosition
;
private
long
scrubPosition
;
...
@@ -604,6 +608,9 @@ public class DefaultTimeBar extends View implements TimeBar {
...
@@ -604,6 +608,9 @@ public class DefaultTimeBar extends View implements TimeBar {
seekBounds
.
set
(
seekLeft
,
barY
,
seekRight
,
barY
+
touchTargetHeight
);
seekBounds
.
set
(
seekLeft
,
barY
,
seekRight
,
barY
+
touchTargetHeight
);
progressBar
.
set
(
seekBounds
.
left
+
scrubberPadding
,
progressY
,
progressBar
.
set
(
seekBounds
.
left
+
scrubberPadding
,
progressY
,
seekBounds
.
right
-
scrubberPadding
,
progressY
+
barHeight
);
seekBounds
.
right
-
scrubberPadding
,
progressY
+
barHeight
);
if
(
Util
.
SDK_INT
>=
29
)
{
setSystemGestureExclusionRectsV29
(
width
,
height
);
}
update
();
update
();
}
}
...
@@ -834,6 +841,18 @@ public class DefaultTimeBar extends View implements TimeBar {
...
@@ -834,6 +841,18 @@ public class DefaultTimeBar extends View implements TimeBar {
}
}
}
}
@RequiresApi
(
29
)
private
void
setSystemGestureExclusionRectsV29
(
int
width
,
int
height
)
{
if
(
lastExclusionRectangle
!=
null
&&
lastExclusionRectangle
.
width
()
==
width
&&
lastExclusionRectangle
.
height
()
==
height
)
{
// Allocating inside onLayout is considered a DrawAllocation lint error, so avoid if possible.
return
;
}
lastExclusionRectangle
=
new
Rect
(
/* left= */
0
,
/* top= */
0
,
width
,
height
);
setSystemGestureExclusionRects
(
Collections
.
singletonList
(
lastExclusionRectangle
));
}
private
String
getProgressText
()
{
private
String
getProgressText
()
{
return
Util
.
getStringForTime
(
formatBuilder
,
formatter
,
position
);
return
Util
.
getStringForTime
(
formatBuilder
,
formatter
,
position
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment