Search in sources :

Example 1 with TrendsPagerAdapter

use of com.klinker.android.twitter.adapters.TrendsPagerAdapter in project Talon-for-Twitter by klinker24.

the class DiscoverPager method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    context = this;
    sharedPrefs = context.getSharedPreferences("com.klinker.android.twitter_world_preferences", 0);
    settings = AppSettings.getInstance(this);
    requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
    setUpTheme();
    setContentView(R.layout.trends_activity);
    setUpDrawer(0, getResources().getString(R.string.trends));
    actionBar = getActionBar();
    actionBar.setTitle(getResources().getString(R.string.trends));
    if (!settings.isTwitterLoggedIn) {
        Intent login = new Intent(context, LoginActivity.class);
        startActivity(login);
        finish();
    }
    mSectionsPagerAdapter = new TrendsPagerAdapter(getFragmentManager(), context);
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mSectionsPagerAdapter);
    mViewPager.setOverScrollMode(ViewPager.OVER_SCROLL_NEVER);
    mViewPager.setOffscreenPageLimit(3);
    if (settings.addonTheme) {
        PagerTitleStrip strip = (PagerTitleStrip) findViewById(R.id.pager_title_strip);
        strip.setBackgroundColor(settings.pagerTitleInt);
    }
}
Also used : PagerTitleStrip(android.support.v4.view.PagerTitleStrip) Intent(android.content.Intent) TrendsPagerAdapter(com.klinker.android.twitter.adapters.TrendsPagerAdapter)

Aggregations

Intent (android.content.Intent)1 PagerTitleStrip (android.support.v4.view.PagerTitleStrip)1 TrendsPagerAdapter (com.klinker.android.twitter.adapters.TrendsPagerAdapter)1