Comments (17)
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.
from draggablepanel.
@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
from draggablepanel.
Can you upload a screenshot whit your device layout bounds option activated?
from draggablepanel.
@pedrovgs screenshoot
As You can see if you magnify image, video fragme is slightly overlaped a bottom
from draggablepanel.
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.
from draggablepanel.
@pedrovgs
Yes, I am using last library version.
quot from google dev https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayerFragment?hl=ru "Note that while videos are playing, this View has a minimum size of 200x110 dp. If you make the view any smaller, videos will automatically stop playing. Also, it is not permitted to overlay this fragment's view with other views while a video is playing. "
And if you will try to put any overlay to youtubeplayerview or youtubeplayerfragment you will see that it is true - video will stop plaing in 2 second if overlay vill not move out of youtubeplayer bounds.
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?
http://oi61.tinypic.com/2vv8dw5.jpg
from draggablepanel.
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).
from draggablepanel.
@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
from draggablepanel.
@NoStake This worked like charm. Thanks a lot.
from draggablepanel.
@ninja-tortoise can you upload your previous DraggablePanel configuration to a sample project? I'd like to fix this issue :)
from draggablepanel.
i had a problem with landscape view while using draggable panel, can u mention any hint or help to solve this feature.. i am trying to implement fullscreen mode...
from draggablepanel.
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.
from draggablepanel.
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 ..
from draggablepanel.
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.
from draggablepanel.
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:
At first wrap frame which will hold youtube fragment and add top and bottom padding
<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
change updateScale
method in resizetransformer to
@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
from draggablepanel.
Hi frank,
I have tried what you mentioned i am able to get resize transformer with youtube fragment but when minimized it seams that touches on minimized view is not recognized.It is not sliding to right or left for close its only maximizing.Can you update your code to sample.
from draggablepanel.
Hi Frakc,
I implemented your suggestions but the top video fragment is going below the screen,its not position well and also when minimized it seams that touches on minimized view is not recognized.It is not sliding to right or left for close its only maximizing..
from draggablepanel.
Related Issues (20)
- the top view on minimization sometimes does not minimize to fullest
- Disable vertical drag HOT 2
- How to Disable the closing of draggableview by clicking top view when its maximized.
- Disable drag Close left or right HOT 1
- Navigation Drawer is not working
- Draggable is cropping the image HOT 2
- Resources$NotFoundException while starting the sample app HOT 1
- how can I lock horizontal swipe? HOT 1
- Listener while dragging the DraggableView HOT 1
- Can't convert value at index 5 to dimension: type=0x12 HOT 1
- Restore view after swiped? HOT 1
- enable_click_to_maximize_view = true is not working when i set TopViewMarginBottom programmatically
- How To handle Once Orientation change in this Panel?
- Move player around the screen
- Add ScrollView or NestedScrollView
- After Android studio update to 3.0 getTop view on nullPointer Exception
- After updating android studio to 3.0 faced this problem
- After updating Android 3.0
- How to bring DraggablePanel overlay all activity
- I am getting this error in Fragment Are you missing a call to unregisterReceiver()? on mzimizing or orentation change.Activity view.com.youtubeviewdesign.MainActivity has leaked IntentReceiver view.com.youtubeviewdesign.player.BasePlayer$1@5398cb0 that was originally registered here.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from draggablepanel.