I have a tab, at the bottom of the page, 4 items in the tab. When I click an item in a tab a new page animates(like in parallax animation) from bottom to the top with this tab layout as the top item. How can I do this. Is it possible with contraintLayout?
use FrameLayout which will act as fragment container and perform fragment transaction to stick fragment inside frame layout when user click on bottom tab item.
Further you can also perform animations like bottom_up animation with that particular fragment.Make sure you are using that frame layout within activity_main.xml inside parent view where you want to show your animation.
I have a detail screen which is fragment, in middle of it I have a linear layout with 2 textViews. I want to slide a map view from right of screen over the linear layout using a button, see picture below:
Anyone can help please?
You can consider using Android ViewPager to slide the map fragment back and forth over your textView.
Here is a tutorial if you want to start.
I'd love to know if anybody knows how to achieve following:
I've got a ViewPager showing up a fragment. While this fragment is showing, You can see the small left border of the fragment to the right. This fragment can be pulled out and acts like a NavigationDrawer.
Here's an example, the Android L Calculator app:
https://d13yacurqjgara.cloudfront.net/users/409459/screenshots/1647461/calculatorrender.gif
As You can see, there is a small blueish border to the right which can be pulled out by swiping it in just like a NavigationDrawer.
Any suggestions how this is achieved?
From the looks of it, this is not done with a ViewPager.
If I would have to do this layout, I would do it with 2 ViewGroups next to each other.
The first one would take 90% width of the screen, would be in the back, and aligned to the left, lets call this layout A.
The second one would take 75% width of the screen, placed in the front, aligned to the right, and have right margin of -65%. I would also add a nice shadow to its left edge, and call it layout B.
Layout A would have a grey background and lots of buttons, as in the animation. If the user swipes left on this view, you set a flag that layout B is shown, and animate the right margin of layout B, to show it. You would do the same when layout B is tapped while being almost hidden.
Any tap on layout A now would close layout B (you can control this with the flag).
When tapped on a button in layout B, you also animate the right margin back, and set the flag also back to false.
If you would use fragments for this, then you would have to worry too much with the communication between the two, and it would just go the same way as with views.
I'm using sliding pane layout in my project. When it was in its closed state i tried to click on an empty space of my fragment's layout, but the click was performed on another fragment (which should be shown only when sliding pane layout is in open state), like it's on the top of the screen. It looks like empty RelativeLayout's space is transparent for clicking. Is there a bug or am I doing wrong something?
I have a fragment with a button at the top. The fragment also has a full screen image.Lets assume my fragment into two halves (i.e the top half and bottom half). So my button is at the top half of the fragment.
Now what I want is when I click on the button at the top half of the fragment, I need to show some other UI at the bottom half of the fragment. But my top half should be visible and interactive. So that when I click again on the button at the top half again this new layout closes.