I've noticed a problem concerning the position of a MediaController
for a VideoView
inside a Fragment
.
Here's a screenshot of how it looks on Nexus 7 running Android 4.3:
And here's a screenshot of the app on Nexus 7 running Android 4.2.2:
As you can see, the position of the MediaController is in the middle of my Activity on API 17 or lower (tested on another tablet with 4.1.2 as well). I've noticed that the size of the MediaController is correct.
My Fragment is shown in a FrameLayout whose width is defined by it's weight (0.6 here), so not by a specific dpi value.
I've checked the source code of MediaController on Grepcode and compared the one of 4.3 with the code of 4.2.2 and there are some small changes with the LayoutParams, but I can't find a way to make this work.
I initialize my VideoView and MediaController in the onActivityCreated() of my Fragment
mMediaController = new MediaController(getActivity());
mMediaController.setAnchorView(videoView);
videoView.setMediaController(mMediaController);
Does somebody know how I can position it right?