use of co.krypt.krypton.help.HelpFragment in project krypton-android by kryptco.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
CrashReporting.startANRReporting();
Notifications.setupNotificationChannels(getApplicationContext());
silo = Silo.shared(getApplicationContext());
startService(new Intent(this, BluetoothService.class));
OnboardingProgress progress = new OnboardingProgress(getApplicationContext());
if (new MeStorage(getApplicationContext()).load() == null || progress.inProgress()) {
startActivity(new Intent(this, OnboardingActivity.class));
finish();
return;
}
if (ConnectionResult.SUCCESS != GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(getApplicationContext())) {
// TODO: warn about no push notifications, prompt to install google play services
}
setContentView(R.layout.activity_main);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setOffscreenPageLimit(4);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
ImageButton settingsButton = (ImageButton) findViewById(R.id.settingsButton);
settingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
SettingsFragment settingsFragment = new SettingsFragment();
transaction.setCustomAnimations(R.anim.enter_from_bottom, R.anim.exit_to_bottom, R.anim.enter_from_bottom, R.anim.exit_to_bottom).addToBackStack(null).replace(R.id.fragmentOverlay, settingsFragment).commit();
new Analytics(getApplicationContext()).postPageView("About");
}
});
ImageButton infoButton = (ImageButton) findViewById(R.id.infoButton);
infoButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
HelpFragment helpFragment = new HelpFragment();
transaction.setCustomAnimations(R.anim.enter_from_bottom, R.anim.exit_to_bottom, R.anim.enter_from_bottom, R.anim.exit_to_bottom).addToBackStack(null).replace(R.id.fragmentOverlay, helpFragment).commit();
new Analytics(getApplicationContext()).postPageView("Help");
}
});
if (getIntent() != null) {
onNewIntent(getIntent());
}
}
Aggregations