I'm trying to design a guide section in my app using fragments. I'm using 6 fragments in my GuidActivity.java which related to its activity activity_guid.xml , the activity contains coordenator layout which contains an image of dotsat the bottom, I want when I navigate into next fragment the image get changed to another image (the next image has yellow second dot ) and so on , any help or more simple idea to preview the progress of fragments ??
Use a ViewPager instead, you will have gesture support and onPageChanged triggered when you scroll to next page.
A simple Onboarding screen doesn't need to use fragments
Related
First , Sorry for my vague title ,
I really don't know how to describe the problem I met.
I will try to draw a picture to explain.
In the following picture , there is a ViewPager with a TabLayout pointing to the first page.
so it works like this :
And the problem is , How to switch the current page to another page which is not included in the ViewPager , with keeping the Tablayout at the bottom and pointing to the current tab. Like this:
In the other words ,
Is it possible to group several pages(fragments) to a tab?
I think you should create custom FragmentPageAdapter for your ViewPager. That allows you replacing Tab1's base fragment (Current Page on your last picture) with another fragment (Another Page on your last picture).
You can do it e.g. after click on button on base fragment.
If you wont to go back to base fragment after click on Tab 1 you have implement OnTabSelectedListener having regard to setup with view pager.
I don't attach any code because I don't know how your code looks like.
im trying to implement an android aplication when your activity, cointains 3 or more 'main windows' like in the image -> 'A'. 'B'.'C'. so how is posible make when you slide you touch screen change from A, to B, for example, i was thinkin in a horizontal view, and inside of each item use a relative layout, but im not sure, its my first time with this kind of problem, thanks.
Try using android ViewPager. Each ImageView would be inside a Fragment that would reside inside your Activity. Check out this example
Use Tabbed Activity template when you want to make this type of Activity. ViewPager, Adapter and tab layout will be automatically implemented for you. Just make small changes in your Adapter according to your needs and use one Fragment for one tab and you can create as many tabs as you want in an Activity.
If you want i will post an example of an Adapter as i just implemented an Activity with 3 tabs.
To get your basics strong on ViewPager, tab layout and Fragment sections adapter read out this link.
I am making an app in which the header and footer would be same through out the app. i can start another activity with the same pattern of design in header and footer but as the other activity starts there comes a delay and we can easily notice that a new activity has pop up.
So what I want :
I want that if user click on any button from the footer the content in the middle between header and footer should be change and user should not see any jump which is made when I move to other activity.
So for this I know that I can use fragments. But for some reasons I can not use fragment activity. All I want to move fragment in the center only. So How can i do that . and How can I initialize other things which are in new fragment let say the upcoming fragment could have button so in this way , I wanted to know would it make my main activity heavy which is calling all these fragment
So please guide me through the demo code .
Note: please do not refer me to a fragment link just past some code to give me some idea.
Will be easiest to have the activity implement the header and footer and the variable content as fragments.
Please refer to this post. It has everything you need
Fixed header and footer in android app
I have a single activity which has a tabPageIndicator at the bottom of the screen. . The first four icons need to open other fragments. The final icon needs to open an alert box with options to open other screens.
I am facing two problems:
ViewPager loads all the 4 fragments at once and there is a lot of data being processed in the background. I would like to know if there is any way to load content only when the fragment is visible to user. I tried using setPageLimit but it did not work.
My second problem is that I would like to ideally open a popup when the last icon is clicked, rather than opening another fragment. IS that possible?
I am not sure if viewPager supports view without fragments.
Hi i need to swipe on each activity page to change next view.How to animate a swipe effect in android.
how can i swipe the activity(Mi firstquestion)
My secoundquestion
show multiple Activity in a singleview?
for example I have 4 activity Activity(1,2,3,4). In screen the 2nd activity should show in the center the next two activity (2 and 3 Activity)corner shows in the left and right in the page and if he again swiple it should be (2,3,4) from(123)Activity. How can i do this
the image i need is below
If you have multiple Activities on one screen you should probably consider using Fragments instead. And for Swiping between Activities I would use a ViewPager and swipe between Fragments.
http://developer.android.com/guide/components/fragments.html
http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
http://thepseudocoder.wordpress.com/2011/10/05/android-page-swiping-using-viewpager/