aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris "Koying" Browet <cbro@semperpax.com>2016-10-30 14:16:06 +0100
committerChris "Koying" Browet <cbro@semperpax.com>2016-10-30 16:26:56 +0100
commitc91b4a8147a233b1d092f6b8c9533a066edc279d (patch)
treead0852dc4acd1bcb182654ba74aff747fe97f7c0 /tools
parenta43edb81eebd771d24fcf8431803cf2d77d63a36 (diff)
FIX: [amcs] get proper VideoView size
Diffstat (limited to 'tools')
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in12
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in12
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