diff options
author | Martijn Kaijser <martijn@xbmc.org> | 2016-10-31 20:31:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-31 20:31:25 +0100 |
commit | 20d744c2be468d56ceba4bae235c7f3cb2a28fdb (patch) | |
tree | 7d8310044c8216c689508089833ca9721523d066 /tools | |
parent | 0753e63fce343f90c05c2555abc69bc180f0572b (diff) | |
parent | c91b4a8147a233b1d092f6b8c9533a066edc279d (diff) |
Merge pull request #10818 from koying/fixamcssize
FIX: [amcs] get proper VideoView size (fixes #17032)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in | 12 | ||||
-rw-r--r-- | tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in index 702cfb671d..fe2822c043 100644 --- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in +++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in @@ -4,6 +4,7 @@ import android.app.NativeActivity; import android.content.ComponentName; import android.content.Intent; import android.hardware.input.InputManager; +import android.graphics.Rect; import android.media.AudioManager; import android.os.Bundle; import android.util.Log; @@ -40,6 +41,17 @@ public class Main extends NativeActivity implements Choreographer.FrameCallback return mVideoView.getSurface(); } + public Rect getVideoViewSurfaceRect() + { + Rect ret = new Rect(); + ret.top = 0; + ret.left = 0; + ret.right = mVideoView.mWidth; + ret.bottom = mVideoView.mHeight; + + return ret; + } + public void setVideoViewSurfaceRect(final int left, final int top, final int right, final int bottom) { runOnUiThread(new Runnable() diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in index 2980bf5190..5012d4c23c 100644 --- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in +++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in @@ -16,12 +16,16 @@ import android.view.SurfaceView; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; +import android.view.View; public class XBMCVideoView extends SurfaceView implements SurfaceHolder.Callback { private static final String TAG = "XBMCVideoPlayView"; + public boolean mHasHolder = false; + public int mWidth = -1; + public int mHeight = -1; public XBMCVideoView(Context context) { @@ -104,6 +108,10 @@ public class XBMCVideoView extends SurfaceView implements { Log.d(TAG, "Created"); mHasHolder = true; + + View v = getRootView(); + mWidth = v.getWidth(); + mHeight = v.getHeight(); } @Override @@ -112,6 +120,10 @@ public class XBMCVideoView extends SurfaceView implements { Log.d(TAG, "Changed, format:" + format + ", width:" + width + ", height:" + height); + + View v = getRootView(); + mWidth = v.getWidth(); + mHeight = v.getHeight(); } @Override |