DraggablePanel icon indicating copy to clipboard operation
DraggablePanel copied to clipboard

Auto Full screen draggable view on screen rotation?

Open bilalilyas90 opened this issue 10 years ago • 21 comments

i want to show video view in full screen using draggable view when we rotate to landscape mode. but i am having some problem . please help me to solve this problem

bilalilyas90 avatar Feb 23 '15 05:02 bilalilyas90

#49 the same opened implementation.

ppamorim avatar Feb 23 '15 11:02 ppamorim

i want to use this same as youtube.... when in portrait work as default but when landscape video is full screen.

thank you

bilalilyas90 avatar Feb 23 '15 11:02 bilalilyas90

Take a fork! I will not do it for you now.

ppamorim avatar Feb 23 '15 11:02 ppamorim

please guide me a little bit... i dont know what to do..

bilalilyas90 avatar Feb 23 '15 11:02 bilalilyas90

@ppamorim is this issue duplicated?

pedrovgs avatar Feb 23 '15 11:02 pedrovgs

@pedrovgs Yes. This feature (rotate to fullscreen) need to be implemented out of box. But use the same ideia/methods of #49.

ppamorim avatar Feb 23 '15 12:02 ppamorim

@bilalilyas90

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);

        if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
            Display
                    display =
                    VideoSampleActivity.this.getWindowManager()
                                 .getDefaultDisplay();

            Point size = new Point();
            display.getSize(size);
            draggableView.setTopViewHeight(size.y);

            Toast.makeText(VideoSampleActivity.this, "landscape", Toast.LENGTH_SHORT)
                 .show();
        } else if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
            Toast.makeText(VideoSampleActivity.this, "portraite", Toast.LENGTH_SHORT)
                 .show();

            Resources r = getResources();
            int px = (int) TypedValue.applyDimension(
                    TypedValue.COMPLEX_UNIT_DIP, 200, r.getDisplayMetrics()
            );
            draggableView.setTopViewHeight(px);


        }
    }

That actually works good for draggableView. For draggablePannel need to add extra method to pass height directly to view.

frakc avatar Feb 24 '15 13:02 frakc

@frakc thanks... This works great but when in landscape mode , when i click on top view it goes to minimize.. and in layout i even used this draggable_view:enable_click_to_minimize_view="false" but still it goes to minize view... can u help me here ?

bilalilyas90 avatar Feb 24 '15 16:02 bilalilyas90

@bilalilyas90 try this tweak https://github.com/pedrovgs/DraggablePanel/issues/29 I did not tested it by myself but i hope it will help

frakc avatar Feb 24 '15 18:02 frakc

@frakc thank you alot.... this tweak helped me... :)

bilalilyas90 avatar Feb 24 '15 20:02 bilalilyas90

one more thing... i am using vitamio player in my app with draggable panel draggableview and when I minimize the dragview the screen of video goes to white in minimized view but is good in maximized view... can u help me here too??

bilalilyas90 avatar Feb 24 '15 21:02 bilalilyas90

@bilalilyas90 try to replace your player with standart videoview. If behaviour consistent - it sum internal bug, if not - contact your payer developers as it might be part of player protection ( like in youtube, which stops when view overlaping is detected)

frakc avatar Feb 26 '15 10:02 frakc

@frakc I am using vitamio player library.... sometimes video comes correct in minimized view and sometimes when I am in minimized state(at end of screen) screen goes white but when in maximized state and while dragging it is working fine... please help me.. screenshots are attached

http://prntscr.com/6a0apy (sometimes correct) http://prntscr.com/69yge2 (while dragging) http://prntscr.com/69yfpa (in minimized state)

bilalilyas90 avatar Feb 26 '15 10:02 bilalilyas90

@bilalilyas90 sorry i am unexpirienced with draggablepanel and vitamio, I simply dont have any idea

frakc avatar Feb 26 '15 11:02 frakc

@frakc no problem... and by the way thanks for the help..

bilalilyas90 avatar Feb 26 '15 11:02 bilalilyas90

@frakc Vitamio Player use SurfaceView. SurfaceView has problems with resize and transform operation. You need use TextureView for it. I'll report to Vitamio dev...

The problem is here: https://github.com/yixia/VitamioBundle/blob/master/vitamio/src/io/vov/vitamio/widget/VideoView.java

ppamorim avatar Feb 26 '15 11:02 ppamorim

Please, study this branch: https://github.com/ppamorim/DraggablePanel/tree/textureViewSample

ppamorim avatar Feb 26 '15 12:02 ppamorim

@frakc when I add the onConfigurationChanged code you added above the video goes to landscape as expected. However, when I go to portrait after this, minimize the video, maximize it again and then rotate the device to go portrait again, the landscape video is not the correct width. I'm using draggable view. Is this the same for anyone else?

http://imgur.com/o2YbAQ1

sierra-delta avatar Mar 29 '15 14:03 sierra-delta

@ninja-tortoise yes I am also having same problem :(

bilalilyas90 avatar Mar 29 '15 15:03 bilalilyas90

dear pedrovgs why after added the configuration code above on click the video minimize?? any help plz

HagerMagdy avatar Mar 31 '15 12:03 HagerMagdy

@HagerMagdy Its because of minimise check

if(slideOffset > MIN_SLIDE_OFFSET && !isClosed() && isMaximized()) {
            minimize();
        }

you can ither edit way of minimise check or check orientation to perform or not perform some actions

if(getResources().getConfiguration().orientation == Configuration .ORIENTATION_PORTRAIT)

frakc avatar Apr 16 '15 10:04 frakc