How to fill half of a fragment with another layout in android? - android

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.

Related

When I replace a fragment the scroll is not to the top

I have an frame in an activity which received fragments based on button clicks at the bottom menu of the activity.
The Fragment I I have in question is structured like below. If I click off of the fragment when i'm at the scrolltop to another and then back to this one it stays at the top but if I scroll 1/2 way down the fragment and then leave and come back it is like 10% scrolled from the top. an odd behavior i'm not sure how to rectify.
Main Activity ->>viewpager1(frameLayout)->fragment1->frag1_constraint(ScrollView)
Fragment 1 Layout
Main Activity Layout

Constraintlayout animation with bottom tab

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.

ViewPager showing border of fragment

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.

fragment of sliding pane layout is transparent for clicking

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?

how to slide frameLayout using sliding menu

I have work on sliding menu. I have some problem of this sliding menu.
This is 3 frame layout. and i have Require slide center frame layout like this.
This is my second layout. how can i make this second layout?
Issue is: I have required second screen but in the second layout all frame are slide in right side. My requirement is only second frame move right side.

Categories

Resources