Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FadingActionBar with FragmentTabHost #113

Open
vishwasdoth opened this issue Apr 14, 2015 · 3 comments
Open

FadingActionBar with FragmentTabHost #113

vishwasdoth opened this issue Apr 14, 2015 · 3 comments

Comments

@vishwasdoth
Copy link

Can I use FadingActionBar with FragmentTabHost?

I have FragmentTabHost with three Fragments and each has ListView. Above Fragment tabs, I have header layout which I want to parallax hide on ListView scroll.

@manaqvi
Copy link

manaqvi commented Apr 21, 2015

Yes. It can be possible by placing header layout (where you want parallax effect) within parent fragment which is in your case is "FragmentTabHost". then you can simply make effect using this:

                     FadingActionBarHelper mFadingHelper = new FadingActionBarHelper()
                     .actionBarBackground(R.drawable.ab_background_light)
                     .headerLayout(R.layout.header)
                     .contentLayout(R.layout.fragment_tab_host)
                     .lightActionBar(true);

Note: make sure your three listview fragments are in fragment_tab_host's java class. even a better approach to use a viewpager within FragmentTabHost to hold all three fragment (List fragments).

@vishwasdoth
Copy link
Author

Thanks for your response. I am not getting one thing here. What do you mean by "Note: make sure your three listview fragments are in fragment_tab_host's java class."

Here is my setup...
mTabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
mTabHost.setup(getActivity(), getChildFragmentManager(), R.id.tab_fragments_holder);

mTabHost.addTab(tabSpec, Fragment1.class, args);
mTabHost.addTab(tabSpec, Fragment2.class, args);
mTabHost.addTab(tabSpec, Fragment3.class, args);

each fragment has different layout file.. like fragment_layout1.xml, fragment_layout2.xml

is this setup correct?

@vishwasdoth
Copy link
Author

I am still stuck on this. Any help would be great help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants