In android, can we slide a fragment over another? For example, in the following image :
There are two fragments. One is red colored, and the other blue colored. If the user presses his finger on the black colored arrow and drags it to the right, the red colored fragment also drags along with it, thereby covering the blue fragment. In the end, the red fragment covers the whole blue fragment. Also, if the user lifts his finger before the red fragment has been dragged onto less than half of the blue fragment, the red fragment should come back to its original place (and thus not cover the blue fragment). However if the user does not lift his finger (i.e. drags the arrow) till the red fragment covers more than half of the blue fragment, or the whole blue fragment, then the red fragment should cover the whole blue fragment.
Also, if there are any views on the red colored fragment (like, Buttons
, EditTexts
etc.), then they will also get re-sized accordingly.
Is there any way to do this? If yes, then how?