Loading api/current.txt +2 −1 Original line number Diff line number Diff line Loading @@ -15953,11 +15953,12 @@ package android.media.tv { method public void setOverlayViewEnabled(boolean); } public class TvView extends android.view.SurfaceView { public class TvView extends android.view.ViewGroup { ctor public TvView(android.content.Context); ctor public TvView(android.content.Context, android.util.AttributeSet); ctor public TvView(android.content.Context, android.util.AttributeSet, int); method public boolean dispatchUnhandledInputEvent(android.view.InputEvent); method protected void onLayout(boolean, int, int, int, int); method public boolean onUnhandledInputEvent(android.view.InputEvent); method public void reset(); method public void setOnUnhandledInputEventListener(android.media.tv.TvView.OnUnhandledInputEventListener); media/java/android/media/tv/TvView.java +30 −6 Original line number Diff line number Diff line Loading @@ -33,12 +33,13 @@ import android.view.MotionEvent; import android.view.Surface; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.ViewGroup; import android.view.ViewRootImpl; /** * View playing TV */ public class TvView extends SurfaceView { public class TvView extends ViewGroup { private static final String TAG = "TvView"; // STOPSHIP: Turn debugging off. private static final boolean DEBUG = true; Loading @@ -57,6 +58,7 @@ public class TvView extends SurfaceView { private final Handler mHandler = new Handler(); private TvInputManager.Session mSession; private final SurfaceView mSurfaceView; private Surface mSurface; private boolean mOverlayViewCreated; private Rect mOverlayViewFrame; Loading Loading @@ -124,7 +126,14 @@ public class TvView extends SurfaceView { public TvView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); getHolder().addCallback(mSurfaceHolderCallback); mSurfaceView = new SurfaceView(context, attrs, defStyleAttr) { @Override protected void updateWindow(boolean force, boolean redrawNeeded) { super.updateWindow(force, redrawNeeded); relayoutSessionOverlayView(); }}; mSurfaceView.getHolder().addCallback(mSurfaceHolderCallback); addView(mSurfaceView); mTvInputManager = (TvInputManager) getContext().getSystemService(Context.TV_INPUT_SERVICE); } Loading Loading @@ -310,11 +319,26 @@ public class TvView extends SurfaceView { super.onDetachedFromWindow(); } /** @hide */ @Override protected void updateWindow(boolean force, boolean redrawNeeded) { super.updateWindow(force, redrawNeeded); relayoutSessionOverlayView(); protected void onLayout(boolean changed, int left, int top, int right, int bottom) { mSurfaceView.layout(0, 0, right - left, bottom - top); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { mSurfaceView.measure(widthMeasureSpec, heightMeasureSpec); int width = mSurfaceView.getMeasuredWidth(); int height = mSurfaceView.getMeasuredHeight(); int childState = mSurfaceView.getMeasuredState(); setMeasuredDimension(resolveSizeAndState(width, widthMeasureSpec, childState), resolveSizeAndState(height, heightMeasureSpec, childState << MEASURED_HEIGHT_STATE_SHIFT)); } @Override public void setVisibility(int visibility) { super.setVisibility(visibility); mSurfaceView.setVisibility(visibility); } private void release() { Loading Loading
api/current.txt +2 −1 Original line number Diff line number Diff line Loading @@ -15953,11 +15953,12 @@ package android.media.tv { method public void setOverlayViewEnabled(boolean); } public class TvView extends android.view.SurfaceView { public class TvView extends android.view.ViewGroup { ctor public TvView(android.content.Context); ctor public TvView(android.content.Context, android.util.AttributeSet); ctor public TvView(android.content.Context, android.util.AttributeSet, int); method public boolean dispatchUnhandledInputEvent(android.view.InputEvent); method protected void onLayout(boolean, int, int, int, int); method public boolean onUnhandledInputEvent(android.view.InputEvent); method public void reset(); method public void setOnUnhandledInputEventListener(android.media.tv.TvView.OnUnhandledInputEventListener);
media/java/android/media/tv/TvView.java +30 −6 Original line number Diff line number Diff line Loading @@ -33,12 +33,13 @@ import android.view.MotionEvent; import android.view.Surface; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.ViewGroup; import android.view.ViewRootImpl; /** * View playing TV */ public class TvView extends SurfaceView { public class TvView extends ViewGroup { private static final String TAG = "TvView"; // STOPSHIP: Turn debugging off. private static final boolean DEBUG = true; Loading @@ -57,6 +58,7 @@ public class TvView extends SurfaceView { private final Handler mHandler = new Handler(); private TvInputManager.Session mSession; private final SurfaceView mSurfaceView; private Surface mSurface; private boolean mOverlayViewCreated; private Rect mOverlayViewFrame; Loading Loading @@ -124,7 +126,14 @@ public class TvView extends SurfaceView { public TvView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); getHolder().addCallback(mSurfaceHolderCallback); mSurfaceView = new SurfaceView(context, attrs, defStyleAttr) { @Override protected void updateWindow(boolean force, boolean redrawNeeded) { super.updateWindow(force, redrawNeeded); relayoutSessionOverlayView(); }}; mSurfaceView.getHolder().addCallback(mSurfaceHolderCallback); addView(mSurfaceView); mTvInputManager = (TvInputManager) getContext().getSystemService(Context.TV_INPUT_SERVICE); } Loading Loading @@ -310,11 +319,26 @@ public class TvView extends SurfaceView { super.onDetachedFromWindow(); } /** @hide */ @Override protected void updateWindow(boolean force, boolean redrawNeeded) { super.updateWindow(force, redrawNeeded); relayoutSessionOverlayView(); protected void onLayout(boolean changed, int left, int top, int right, int bottom) { mSurfaceView.layout(0, 0, right - left, bottom - top); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { mSurfaceView.measure(widthMeasureSpec, heightMeasureSpec); int width = mSurfaceView.getMeasuredWidth(); int height = mSurfaceView.getMeasuredHeight(); int childState = mSurfaceView.getMeasuredState(); setMeasuredDimension(resolveSizeAndState(width, widthMeasureSpec, childState), resolveSizeAndState(height, heightMeasureSpec, childState << MEASURED_HEIGHT_STATE_SHIFT)); } @Override public void setVisibility(int visibility) { super.setVisibility(visibility); mSurfaceView.setVisibility(visibility); } private void release() { Loading