ResizeTransformer can't be used from DraggablePanel, you have to use DraggableView #38
Comments
DraggablePanel is a DraggableView facade and is not easy to support resize feature right now. You can use DraggableView with resize enabled and add your fragment manually as DraggablePanel does. That's why the sample code is not using this feature. |
@pedrovgs but main problem - resize transformer causes youtubefragment to be few pixel under some view, which make youtube player to stop, as anything is not allowed to be above it |
Can you upload a screenshot whit your device layout bounds option activated? |
@pedrovgs screenshoot |
I don't see any problem :S can you add an arrow or something like that pointing to the problem? Why do you say that youtube player is going to stop the video if youtube fragment is under some view? I guess you are using the last library version. |
@pedrovgs Also in last line of error log in topic body, you will see distances with negative numbers which point to overlaping. I also tried to point it on this image, do you see that top view is just few pixels below bottomview? |
I'm also seeing this behaviour where the youtube video will stop sometimes in minimized view. I am using DraggableView and the youtube video resizes correctly. 03-28 15:06:47.630 3783-3783/com.myapp W/YouTubeAndroidPlayerAPI﹕ YouTube video playback stopped due to unauthorized overlay on top of player. The YouTubePlayerView is not contained inside its ancestor android.widget.FrameLayout{1e96423f V.E..... .......D 1189,897-2395,1334 #7f0a0043 app:id/youtubeVideoContainer}. The distances between the ancestor's edges and that of the YouTubePlayerView is: left: 0, top: 0, right: -3, bottom: -1 (these should all be positive). |
@ninja-tortoise There might be an issue with ResizeTransformer or with YouTubePlayerFragment. A quick fix would be to add padding or margin (bottom and right) to YouTubePlayerView after the fragment's view was created |
@NoStake This worked like charm. Thanks a lot. |
@ninja-tortoise can you upload your previous DraggablePanel configuration to a sample project? I'd like to fix this issue :) |
The current workaround is change your DraggablePanel to use DraggableView. I'm trying to get time to improve this project but I'm working in another open source project right now...sorry. |
Hi Pedrovgs, Thanks for giving reply for my previous question, Hope you are doing well and busy with you work, i have one more doubt regarding draggable panel , if u have some free time can u clarify me , if we use "draggableView.setTopViewHeight(topFragmentHeight);" for top view fragment like 200 dip in Portrait mode , when the screen is in landscape mode, still the topFragmentHeight is 200dp, to show topview (video view) in full screen mode this is stopping me, if we change topFragmentHeight to 400 dp , in portrait mode it will bit more and in landscape view the top view(video view) will be fitted to fullscreen.. i guess this is stopping to load in full screen,, i tried from sidewith different approaches other than this way.. can u share your valuable inputs .. |
Thie setTopViewHeight is a method only valid in the portrait mode. If you want to develop a landscape mode you'll have to override some of the current behavior. |
besides overlappind, there also was issue with minimal player size for YouTubePlayerSupportFragment,which is limited to 200*110 dp. I fixed it in following way: <FrameLayout
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="220dip"
android:paddingBottom="5dip"
android:paddingTop="5dip"
android:layout_alignParentTop="true"
>
<FrameLayout
android:id="@+id/youtube_here"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</FrameLayout> then @Override public void updateScale(float verticalDragOffset) {
int newWidth = (int) (getOriginalWidth() * (1 - verticalDragOffset / getXScaleFactor()));
int newHeight = (int) (getOriginalHeight() * (1 - verticalDragOffset / getYScaleFactor()));
if(newWidth>minX)layoutParams.width = newWidth;
if(newHeight>minY)layoutParams.height = newHeight;
getView().setLayoutParams(layoutParams);
} and constructor to private int minX,minY;
ResizeTransformer(View view, View parent) {
super(view, parent);
layoutParams = (RelativeLayout.LayoutParams) view.getLayoutParams();
minX = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 210, view.getContext()
.getResources()
.getDisplayMetrics()
);
minY = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 114, view.getContext().getResources().getDisplayMetrics()
);
} that will ensure that player will not be smalle then minimal dimentions and will not be overlaped by bottom fragment |
Hi frank, |
Hi Frakc, |
There were many issues, that minimised youtubeplayersupportfragment displays only topleft corner of the video. And there were recommendations which did not work: set draggable_panel:top_view_resize="true"/ It did not work because this paramenter was never transmited to draggableview ( as i see in latest 1.6 snapshot version of source library) after I modefied
inside DragablePanel.java? I can see nice resied minimised youtubeplayerfragment
ScreenShot
But new issue arise from this. Dragview became overlaped by few pixels and i cant understand where it comes from.
The text was updated successfully, but these errors were encountered: