Giter VIP home page Giter VIP logo

Comments (17)

pedrovgs avatar pedrovgs commented on August 19, 2024

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.

frakc avatar frakc commented on August 19, 2024

@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.

pedrovgs avatar pedrovgs commented on August 19, 2024

Can you upload a screenshot whit your device layout bounds option activated?

from draggablepanel.

frakc avatar frakc commented on August 19, 2024

@pedrovgs screenshoot
As You can see if you magnify image, video fragme is slightly overlaped a bottom

from draggablepanel.

pedrovgs avatar pedrovgs commented on August 19, 2024

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.

frakc avatar frakc commented on August 19, 2024

@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.

sierra-delta avatar sierra-delta commented on August 19, 2024

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.

v-b7 avatar v-b7 commented on August 19, 2024

@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.

sierra-delta avatar sierra-delta commented on August 19, 2024

@NoStake This worked like charm. Thanks a lot.

from draggablepanel.

pedrovgs avatar pedrovgs commented on August 19, 2024

@ninja-tortoise can you upload your previous DraggablePanel configuration to a sample project? I'd like to fix this issue :)

from draggablepanel.

kriishna avatar kriishna commented on August 19, 2024

landscspe
Hi Pedrovgs,

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.

pedrovgs avatar pedrovgs commented on August 19, 2024

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.

kriishna avatar kriishna commented on August 19, 2024

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.

pedrovgs avatar pedrovgs commented on August 19, 2024

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.

frakc avatar frakc commented on August 19, 2024

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.

Ambilash avatar Ambilash commented on August 19, 2024

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.

Swapnildhamale92 avatar Swapnildhamale92 commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.