pedrovgs / DraggablePanel

Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.
Apache License 2.0
2.99k stars 606 forks source link

Cannot move Top player down/up when bottombar hide/show #102

Closed manhhoangxuan closed 7 years ago

manhhoangxuan commented 7 years ago

Dear All, I am facing a problem with Bottombar tab with Top player of DraggablePanel

I cannot move Top player by setTopFragmentMarginBottom dynamically when bottombar show or hide

Is Anyone using DraggablePanel with Bottombar successful?

Thanks in advanced!

pedrovgs commented 7 years ago

Hi @manhhoangxuan sorry for the late response. I've been working on other projects for some time.

Remember you can adjust the height of your fragment and pin it to the top of your screen. You can also move the bar to the first layer of your UI so it's drawn in top of any other fragment. This last option depends on your bar implementation.

Is this the answer to your question?

manhhoangxuan commented 7 years ago

Thanks for your responding Mr @pedrovgs First problem, i have move my bottombar to first layer (as you said) and this problem is ok However, the second problem is "Cannot move Top player down/up when bottombar hide/show" by setTopFragmentMarginBottom still not working. I would like move Top Miniplayer down/up when my bottombar hide/show (i have attacked screen shot for more clear) but i can't ( I have changed setTopFragmentMarginBottom but it's not working)

Thanks

15673219_1226020004111240_1979776561_n 15713190_1226020087444565_949763908_n

pedrovgs commented 7 years ago

As I can see in your screenshot you have to adjust the fragment or the draggable view/ draggable panel height. You can use animations when needed.

manhhoangxuan commented 7 years ago

Hi @pedrovgs As you see, i have setTopFragmentMarginBottom(60dp) from start for miniplayer above bottom menu However, when bottom menu is hide, i have used setTopFragmentMarginBottom(0) to move down Miniplayer but it's not working Do you have any solution here? Thanks

pedrovgs commented 7 years ago

@manhhoangxuan did you invalidate the view after calling that method?

manhhoangxuan commented 7 years ago

Hi @pedrovgs I have called this code to move down miniplayer mContainerDraggable.setTopFragmentMarginBottom(0); mContainerDraggable.invalidate();

And this code to move up miniplayer mContainerDraggable.setTopFragmentMarginBottom(getResources().getDimensionPixelSize(R.dimen.top_fragment_margin_x)); mContainerDraggable.invalidate();

However, It's not working, miniplayer position is nothing changed

manhhoangxuan commented 7 years ago

Hi @pedrovgs Please help Do you have any solution for this problem?

pedrovgs commented 7 years ago

@manhhoangxuan right now I'm working on a different project. I don't have a quick fix for this. Sorry. If you have time you can always send a PR with the fix. Any contribution is always welcome :)