OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.annotation.SuppressLint; | |
7 import android.content.Context; | 8 import android.content.Context; |
8 import android.graphics.Color; | 9 import android.graphics.Color; |
9 import android.view.KeyEvent; | 10 import android.view.KeyEvent; |
10 import android.view.MotionEvent; | 11 import android.view.MotionEvent; |
11 import android.view.SurfaceHolder; | 12 import android.view.SurfaceHolder; |
12 import android.view.SurfaceView; | 13 import android.view.SurfaceView; |
13 import android.view.View; | 14 import android.view.View; |
14 import android.widget.MediaController; | 15 import android.widget.MediaController; |
15 | 16 |
16 /** | 17 /** |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 event.getAction() == KeyEvent.ACTION_UP) { | 132 event.getAction() == KeyEvent.ACTION_UP) { |
132 exitFullscreen(false); | 133 exitFullscreen(false); |
133 return true; | 134 return true; |
134 } else if (keyCode == KeyEvent.KEYCODE_MENU || keyCode == KeyEve nt.KEYCODE_SEARCH) { | 135 } else if (keyCode == KeyEvent.KEYCODE_MENU || keyCode == KeyEve nt.KEYCODE_SEARCH) { |
135 return true; | 136 return true; |
136 } | 137 } |
137 return false; | 138 return false; |
138 } | 139 } |
139 }); | 140 }); |
140 setOnTouchListener(new OnTouchListener() { | 141 setOnTouchListener(new OnTouchListener() { |
142 @SuppressLint("ClickableViewAccessibility") | |
aurimas (slooooooooow)
2014/08/12 02:47:55
This actually does not fix the bug, just adds a su
| |
141 @Override | 143 @Override |
142 public boolean onTouch(View v, MotionEvent event) { | 144 public boolean onTouch(View v, MotionEvent event) { |
143 if (isInPlaybackState() && mMediaController != null && | 145 if (isInPlaybackState() && mMediaController != null && |
144 event.getAction() == MotionEvent.ACTION_DOWN) { | 146 event.getAction() == MotionEvent.ACTION_DOWN) { |
145 toggleMediaControlsVisiblity(); | 147 toggleMediaControlsVisiblity(); |
146 } | 148 } |
147 return true; | 149 return true; |
148 } | 150 } |
149 }); | 151 }); |
150 surfaceView.setFocusable(true); | 152 surfaceView.setFocusable(true); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 /** | 295 /** |
294 * Sets the MediaControlsVisibilityListener that wants to listen to visibili ty change events. | 296 * Sets the MediaControlsVisibilityListener that wants to listen to visibili ty change events. |
295 * | 297 * |
296 * @param listener the listener to send the events to. | 298 * @param listener the listener to send the events to. |
297 */ | 299 */ |
298 public void setListener(MediaControlsVisibilityListener listener) { | 300 public void setListener(MediaControlsVisibilityListener listener) { |
299 mListener = listener; | 301 mListener = listener; |
300 } | 302 } |
301 | 303 |
302 } | 304 } |
OLD | NEW |