I am making an app where user can make a survey which contains questions, I have buttons to go to the next questions but I also want him to be able to swipe left to go to the next question. How can I implement That?
Thanks in advance.
I strongly recommend you to use viewpager or horizontal recyclerview against activity . A question per activity is not good idea .
Good luck
Related
Demo1
Demo2
when users click the button to answer the questions for the TextView on the top, the TextView will change the questions depends on the user's answer.
(I think this part won't be hard for me)
But what should I do after user click the button, the buttons will change as well, please see the demo picture.
are there any skills I should study first? like framelayout?
Thank you for your answers.
It really depends on specific needs, but generally speaking, google guidelines are toward the use of fragments.
I'm developing Android apps since just few months and I'm using the single activity/multiple fragments approach. You have to learn how to use fragments, e.g. their lifecycle compared to the attached activity or how to handle events among fragments (EventBus can help you for such task).
You can find more discussions about this approach here
Cheers.
you can create a N fragement with your nuber Button and you set your buttons in this fragement (Demo 1)
but in click a one button you can replace a Specific Fragment (Demo 2) in your framelayout be placed in your Activity
I'm right now working on a launcher app and I have three Activities. User is on 2nd Activity by default and when user swipes left it should take him to 3rd Activity and when user swipes right it should take user to 1st Activity. Just like Swipable Tabs but the Tabs should not appear. Is it possible? Best example is of Home Screen, I want it exactly as Home Screen. I've tried a lot! But I'm not getting what ACTUALLY I want, any help would be gladly appreciated, thanks!
I hope I can get you well.
First personally I don't suggest achieving this goal by using multiple activity. A better way might be one activity containing multiple fragment.
Then if you do so, several tools can make help, ViewPager for example.
If you want to add some view page indicator, as what the homescreen looks like, then ViewPagerIndicator might be a good choice.
Hope it helps.
Please have a look on this image
The whole review section will slide according to days of week saturday monday etc..
Inside values are dynamic and will come from server accordingly
there are also buttons named comment,agreeand report abuse which will update values as according to their name
How can I achieve this kind of functionality in android.
That is I am in need of sliding functionality (Left and right both)which contains a list view with dynamic changing elements. and button on click which functionality will be there as accordingly
Please help me ASAP
thanks
Abhinav
HI guys I have found the solution of my own question
See this
android gestures
and this link
Switching between activities stack over flow
Thanks for visiting my question
Try to look at ViewPager class in Android Compatibility Package.
I want to create a UI similar to the images shown in the links given below.
http://www.4shared.com/photo/EU1KsEPC/device1.html
http://www.4shared.com/photo/tcQMx75T/device2.html
The requirement is, when I swipe to the right, it should go to the 2nd, 3rd pages and so on. And swiping to the left should go to the previous page.
How can I create such a UI? What layout should I use?
Any help in this regard would be well appreciated with points.
Best Regards,
Rony
I think you should look into a GridView.
http://developer.android.com/guide/tutorials/views/hello-gridview.html
http://developer.android.com/resources/tutorials/views/index.html
Perhaps your looking for this answer?
Implementing Swipe action on ViewFlipper with multiple GridViews
i have 4 activities in which i have to swipe them right, left and if i am in last activity and swipe to the left then again first activity should be shown.
can anybody have any idea how i can achieve this? or some sample code?
thanks a lot.
you can achieve it by animaton..
But it will show as a Gallery view and you can swipe as well...
OnTouchEvent on every activity you can call another activity using intents by
overridePendingTransition(R.anim.act_back_slide_enter, R.anim.act_back_slide_leave);
//overridePendingTransition("animation for activity which enters", "animation for activity which leaves");
I have not yet tried this... but we can make it in this form.. If you get success let me know.
#sajjoo Here goes your answer in deezapps widget with the questions below pointing at it
How to show multiple screens with right/left slide Gesture
How to create a slider screen (As in Tweetdeck) in Android?
and many more linked questions..
I recently posted a question that covers a lot of this (my question is about using Swipe together with ScrollView, the Swipe gesture by itself works just fine):
Swipe/Fling tab-changing in conjunction with ScrollView?
If you read the sources I have listed and use the code I've provided then you should be able to do it.
It's work fine... just must to delete the redundant R.java file...!
http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/