How to slide a map on a textView from right of screen - android

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.

Related

How to increase ViewPager swipeable area

I have a ViewPager with two Fragments. The first Fragment is a simple RecyclerView. But the second Fragment contains a full screen Google Maps element.
Fragment 1:
Fragment 2:
The problem is that when you are viewing Fragment 2, it's very hard to go to Fragment 1 by swiping from the left side of the screen to the right because the map will start moving. You really have to touch from the very edge of the left side in order to go to Fragment 1.
How do I extend the swipeable area on the left side of the screen when in Fragment 2?
I've tried adding a left padding to the map which does work but the layout gets ugly since the map starts after the padding.

Is it possible to swipe up to another activity

I have an activity which contains a ViewPager which lets me swipe between four pages and a RelativeLayout at the bottom containing tabs for the pages. I was wondering if it was possible to make it so that when I drag the bottom RelativeLayout up it starts a new activity ending the ViewPager activity.
Added horrible diagram to help explain
I think this link will help you.
slide up xml animation on change activity in android
You can just change the animations X and Y values to create Slide Up animation on startActivity.

In Android, how to make views transit between screens under viewPager?

So I have a single activity that controls a viewPager and this viewPager controls five fragments. In one of the fragments, there is an ImageView.
I want this imageView transit to the next page when I do a swipe left. More specifically, the position of this imageView will transit as I am swiping and once the swiping is done and the next fragment layout is completely shown on the screen, this ImageView should be a fixed location in this layout.
Does anybody know how I can make this work?
Thanks!
I think I know what you mean. It might be easier to make it a separate View on top of the pager, perhaps disabled so drags will go through it. and then you need to get a live reading of the position of the page. onPageScrolled on ViewPager.OnPageChangeListener is pretty cool and gives you what you need to place elements or do other transitionary effects based on the actual position of the Views in your ViewPager.

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.

Android: Customize slide layouts

I'm making a new app that has a layout as follows:
LinearLayout1 LinearLayout2
Breadcrumb
Main Content
When user clicks "linear layout2", the screen will slide left until "linear layout1" is hidden. Then a new activity with title is "linear layout2" will be shown.
When user clicks "linear layout1", the screen will slide right until "linear layout2" is hidden. Then a new activity with title is "linear layout2" will be shown.
I do some researches but cannot find a solution. Could you please give me some tips and examples so that I can go ahead?
Thanks
Your question is slightly confusing so I'm going to make an assumption.
Is [LinearLayout1 LinearLayout2 Breadcrumb] suppose to be navigation or tabs that when selected insert their corresponding content into the Main Content?
If so I would suggest using fragments for each piece of content. Then when you click the navigation/tab, perform an animation of the fragment which slides the content in and out.
See the google docs for how to use fragments:
http://developer.android.com/guide/components/fragments.html
See another stackoverflow answer for how to do the slide animation:
Android Fragments and animation

Categories

Resources