Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8059471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:40:50+00:00 2026-06-05T09:40:50+00:00

I have created swipey tabs using ViewPagerExtensions but this time i am using only

  • 0

I have created swipey tabs using ViewPagerExtensions but this time i am using only one library ActionBarSherlock in my App and i dont know how to create swipey tabs like google play store. If you can help me to get it done, i’d be very thankful to you.

This is the onCreate method of my activity class

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        setTheme(SampleList.THEME); //Used for theme switching in samples
        super.onCreate(savedInstanceState);

        setContentView(R.layout.fragment_tabs);
        mTabHost = (TabHost)findViewById(android.R.id.tabhost);
        mTabHost.setup();

        mTabManager = new TabManager(this, mTabHost, R.id.realtabcontent);

        mTabManager.addTab(mTabHost.newTabSpec("simple").setIndicator("Groups"),FragmentStackSupport.CountingFragment.class, null);
        mTabManager.addTab(mTabHost.newTabSpec("contacts").setIndicator("Contacts"),LoaderCursorSupport.CursorLoaderListFragment.class, null);
        mTabManager.addTab(mTabHost.newTabSpec("custom").setIndicator("Logs"),LoaderCustomSupport.AppListFragment.class, null);
        mTabManager.addTab(mTabHost.newTabSpec("throttle").setIndicator("Gallery"),LoaderThrottleSupport.ThrottledLoaderListFragment.class, null);

        if (savedInstanceState != null) {
            mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
        }
    }

In first image Top New Paid is the current screen title and other two are showing previous or next screen tile. How can i show previous and next screen title at corner with some fading effect like it.

In first image Top New Paid is the current screen title and other two are showing previous or next screen tile. How can i show previous and next screen title at corner with some fading effect like it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:40:52+00:00Added an answer on June 5, 2026 at 9:40 am

    You need to use ActionBar Tabs, a TabsAdapter and a ViewPager (scrolly bit). Here’s a full tutorial I made: http://davidjkelley.net/?p=34 (just use the ABS imports, not standard compatibility library ones).

    Here’s some of the relevant code:

    import java.util.ArrayList;
    import android.app.ActionBar;
    import android.app.ActionBar.Tab;
    import android.content.Context;
    import android.content.Intent;
    import android.os.Bundle;
    import android.util.Log;
    import android.view.Menu;
    import android.view.MenuInflater;
    import android.view.MenuItem;
    import android.view.MenuItem.OnMenuItemClickListener;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.TextView;
    import android.support.v4.app.Fragment;
    import android.support.v4.app.FragmentActivity;
    import android.support.v4.app.FragmentManager;
    import android.support.v4.app.FragmentPagerAdapter;
    import android.support.v4.app.FragmentTransaction;
    import android.support.v4.view.ViewPager;
    import android.support.v4.view.ViewPager.OnPageChangeListener;
    public class Polling extends FragmentActivity {
    private ViewPager mViewPager;
    private TabsAdapter mTabsAdapter;
    private final static String TAG = "21st Polling:";
    
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.pager);
    setContentView(mViewPager);
    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayShowTitleEnabled(false);
    bar.setDisplayShowHomeEnabled(false);
    
    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.login),
    LoginFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.economics),
    EconFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.elections),
    ElectionsFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.politics),
    PoliticsFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.science),
    ScienceFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.finance),
    FinanceFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.religion),
    ReligionFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.military),
    MilitaryFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.international),
    InternationalFragment.class, null);
    }
    
    public static class TabsAdapter extends FragmentPagerAdapter
        implements ActionBar.TabListener, ViewPager.OnPageChangeListener {
            private final Context mContext;
            private final ActionBar mActionBar;
            private final ViewPager mViewPager;
            private final ArrayList<TabInfo> mTabs = new ArrayList<TabInfo>();
    
            static final class TabInfo {
                private final Class<?> clss;
                private final Bundle args;
    
                TabInfo(Class<?> _class, Bundle _args) {
                    clss = _class;
                    args = _args;
                }
            }
    
            public TabsAdapter(FragmentActivity activity, ViewPager pager) {
                super(activity.getSupportFragmentManager());
                mContext = activity;
                mActionBar = activity.getActionBar();
                mViewPager = pager;
                mViewPager.setAdapter(this);
                mViewPager.setOnPageChangeListener(this);
            }
    
            public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
                TabInfo info = new TabInfo(clss, args);
                tab.setTag(info);
                tab.setTabListener(this);
                mTabs.add(info);
                mActionBar.addTab(tab);
                notifyDataSetChanged();
            }
    
    
            public int getCount() {
                return mTabs.size();
            }
    
            public Fragment getItem(int position) {
                TabInfo info = mTabs.get(position);
                return Fragment.instantiate(mContext, info.clss.getName(), info.args);
            }
    
    
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
            }
    
    
            public void onPageSelected(int position) {
                mActionBar.setSelectedNavigationItem(position);
            }
    
    
            public void onPageScrollStateChanged(int state) {
            }
    
    
            public void onTabSelected(Tab tab, FragmentTransaction ft) {
                mViewPager.setCurrentItem(tab.getPosition());
                Log.v(TAG, "clicked");
                Object tag = tab.getTag();
                for (int i=0; i<mTabs.size(); i++) {
                    if (mTabs.get(i) == tag) {
                        mViewPager.setCurrentItem(i);
                    }
                }
            }
    
            public void onTabUnselected(Tab tab, FragmentTransaction ft) {}
    
            public void onTabReselected(Tab tab, FragmentTransaction ft) {}
    
            public void onTabReselected(Tab tab, android.app.FragmentTransaction ft) {}
    
            @Override
            public void onTabSelected(Tab tab, android.app.FragmentTransaction ft) {    
                Object tag = tab.getTag();
                for (int i=0; i<mTabs.size(); i++) {
                    if (mTabs.get(i) == tag) {
                        mViewPager.setCurrentItem(i);
                    }
                }
            }
    
            public void onTabUnselected(Tab tab, android.app.FragmentTransaction ft) {}
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom JTree. That tree could be filtered to show only
I have created an app in android and it requires some data to be
I am developing application using phonegap in eclipse for android .I have created folder
I have created an iPad app that has 10 view controllers that swipe left
I have created a program in Visual Basic using Microsoft Visual Studio 2010 Professional.
I have just created a grid application using the template provided in Visual Studio
I have tried for a few days now to figure this out but i
I Have created an android app, which has view flipper and it has 4
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a simpleSli.de from http://www.simplesli.de but I cant figure out how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.