use of com.klinker.android.twitter.adapters.ProfilePagerAdapter in project Talon-for-Twitter by klinker24.
the class ProfilePager method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
overridePendingTransition(R.anim.activity_slide_up, R.anim.activity_slide_down);
mCache = App.getInstance(this).getBitmapCache();
context = this;
sharedPrefs = context.getSharedPreferences("com.klinker.android.twitter_world_preferences", 0);
settings = AppSettings.getInstance(this);
try {
ViewConfiguration config = ViewConfiguration.get(this);
Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
if (menuKeyField != null) {
menuKeyField.setAccessible(true);
menuKeyField.setBoolean(config, false);
}
} catch (Exception ex) {
// Ignore
}
if (getIntent().getBooleanExtra("from_widget", false) || ((settings.advanceWindowed && !getIntent().getBooleanExtra("long_click", false)) || !settings.advanceWindowed && getIntent().getBooleanExtra("long_click", false))) {
setUpWindow();
}
setUpTheme();
int currentOrientation = getResources().getConfiguration().orientation;
if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
} else {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
}
getFromIntent();
setContentView(R.layout.tweet_pager);
ViewPager pager = (ViewPager) findViewById(R.id.pager);
ProfilePagerAdapter mPagerAdapter = new ProfilePagerAdapter(getFragmentManager(), context, name, screenName, proPic, tweetId, isRetweet, isMyProfile);
pager.setAdapter(mPagerAdapter);
pager.setOffscreenPageLimit(3);
if (settings.addonTheme) {
PagerTitleStrip strip = (PagerTitleStrip) findViewById(R.id.pager_title_strip);
strip.setBackgroundColor(settings.pagerTitleInt);
if (!settings.showTitleStrip) {
strip.setVisibility(View.GONE);
}
}
Utils.setActionBar(context, !settings.advanceWindowed);
// set it to the profile
pager.setCurrentItem(1);
}
Aggregations