DraggablePanel
DraggablePanel copied to clipboard
Auto Full screen draggable view on screen rotation?
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
#49 the same opened implementation.
i want to use this same as youtube.... when in portrait work as default but when landscape video is full screen.
thank you
Take a fork! I will not do it for you now.
please guide me a little bit... i dont know what to do..
@ppamorim is this issue duplicated?
@pedrovgs Yes. This feature (rotate to fullscreen) need to be implemented out of box. But use the same ideia/methods of #49.
@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 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 try this tweak https://github.com/pedrovgs/DraggablePanel/issues/29 I did not tested it by myself but i hope it will help
@frakc thank you alot.... this tweak helped me... :)
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 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 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 sorry i am unexpirienced with draggablepanel and vitamio, I simply dont have any idea
@frakc no problem... and by the way thanks for the help..
@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
Please, study this branch: https://github.com/ppamorim/DraggablePanel/tree/textureViewSample
@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
@ninja-tortoise yes I am also having same problem :(
dear pedrovgs why after added the configuration code above on click the video minimize?? any help plz
@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)