I have an activity that displays a camera screen, another one that displays a dynamic list of things, and I would like to slide between them.
The problem is that the ViewPager only allows me to slide between different layouts, without any activity-related effect.
Thanks for your help!
I think that using a ViewPager is what would be the easiest way. But if you don't want to, maybe you can try something like that :
Code something to detect the swipe gesture.
When the swipe gesture is detected, start the second activity whith a slide transition.
I've never done something like that. It's just a though.
Related
I have two activities one with some data and the second one, semitrasparent with some buttons on it.
I want the second activity slide over the first one after the swipe gesture.
I've already read about ViewPager and it's not what I am looking for. I want the first activity still being visible over the semitrasparent second one.
I am looking for any suggestions how to do this.
Literally not possible.
The entire point of an Activity is that it fills the ENTIRE screen, and there are never 2 of them shown at the same time, ever.
So you can't swipe to "semi" open one with a slide animation.
To do that, you'll have to use 1 Activity, and multiple Fragments.
So, I'm working on a media player application.
I would like to make something similar to Google Play Music's or SoundCloud's slide up mini-player to full-player UX.
I'm not really sure how to tackle that, though. Is it simply two fragments/views? I can understand how to transition onClick with animations, but how would I go about the fluid dragging?
Yes, it can be done with a fragment, OnTouchListener, and dragging the fragment up. I've done it with a click event and animation with no dragging.
The activity is on the bottom and the container with the fragment placed on top via the xml.
I wouldn't call it expanding though. Its just not fully revealed on screen (i.e. the location is on and off the screen and the fragment isn't actually changing).
I want to make something like transitions between ViewControllers in iOS 7 but in Android, is it possible?
Explanation: please look at image below, I have main Activity which has ViewPager inside, so we can swipe between Fragments. I want to call another Activity (or Fragment) from each Fragment (blue on image) swiping to bottom or to top but this action should be done smoothly like in ViewPager.
You can intercept swipe up and down gestures and set items in viewpager accordingly. Please read this guide on how to intercept swipes in various directions.
I'm building an application where i use a tabhost. In each tab there is a fragment, so the user can swipe through each fragment. I want different buttons in each fragment but them on the tabhost, so that they won't swipe too. So i change each button in the onTabChanged() method of the tabhost dynamically. But this results in slowing down, actually freezing for a bit. I even tried putting it on a thread but it didn't make any difference. Do you know any way that i can use so that the swiping through the screens will be smooth again?
Thank you for your time.
your explanation is really fuzzy but as far as I understood what you want to do is to move the buttons to outside the tabhost and on the click event you use something like:
switch(tabHost.getCurrentTab(){
// do stuff
}
Is it possible to animate the same activity without actually reloading the activity instance?
I would like to make my ListActivity slide aside and reveal itself again but with new data in the ListView. This will occur each time the user drills down the list.
Using ViewAnimator should solve your problem.