Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Casanowow Life for love
VLC-Android
Commits
e32c364e
Commit
e32c364e
authored
Aug 14, 2012
by
Sébastien Toque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Seek gesture : factorize usage of getWindowManager().getDefaultDisplay()
parent
8f164505
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
...d/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+4
-8
No files found.
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
View file @
e32c364e
...
...
@@ -637,14 +637,13 @@ public class VideoPlayerActivity extends Activity {
* show/hide the overlay
*/
@SuppressWarnings
(
"deprecation"
)
@Override
public
boolean
onTouchEvent
(
MotionEvent
event
)
{
DisplayMetrics
screen
=
new
DisplayMetrics
();
getWindowManager
().
getDefaultDisplay
().
getMetrics
(
screen
);
if
(
mAudioDisplayRange
==
0
)
mAudioDisplayRange
=
Math
.
min
(
getWindowManager
().
getDefaultDisplay
().
getWidth
(),
getWindowManager
().
getDefaultDisplay
().
getHeight
());
mAudioDisplayRange
=
Math
.
min
(
screen
.
widthPixels
,
screen
.
heightPixels
);
float
y_changed
=
event
.
getRawY
()
-
mTouchY
;
float
x_changed
=
event
.
getRawX
()
-
mTouchX
;
...
...
@@ -689,11 +688,8 @@ public class VideoPlayerActivity extends Activity {
OVERLAY_TIMEOUT
);
}
}
// Seek
// Tools to get the xdpi resolution for the cubic progression
DisplayMetrics
screen
=
new
DisplayMetrics
();
getWindowManager
().
getDefaultDisplay
().
getMetrics
(
screen
);
// Seek
float
gesturesize
=
(
float
)
((
x_changed
/
screen
.
xdpi
)
*
2.54
);
// No seek action if coef > 0.5 and gesturesize < 1cm
if
((
Math
.
abs
(
y_changed
)
<
Math
.
abs
(
x_changed
))
...
...
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