use of com.astronauts.astronaut.gui.fragment.impl.DiscoveriesFragment in project Astronaut by astro-naut.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
//Prevent fragments from accidental overlapping
if (savedInstanceState != null) {
return;
}
bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
@Override
public void onTabSelected(@IdRes int tabId) {
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (tabId == R.id.tab_discoveries) {
DiscoveriesFragment fragment = new DiscoveriesFragment();
transaction.replace(R.id.contentContainer, fragment);
}
if (tabId == R.id.tab_mikroblog) {
MikroblogFragment fragment = new MikroblogFragment();
transaction.replace(R.id.contentContainer, fragment);
}
if (tabId == R.id.tab_moj_wykop) {
MojWykopFragment fragment = new MojWykopFragment();
transaction.replace(R.id.contentContainer, fragment);
}
if (tabId == R.id.tab_profile) {
ProfileFragment fragment = new ProfileFragment();
transaction.replace(R.id.contentContainer, fragment);
}
if (tabId == R.id.tab_settings) {
SettingsFragment fragment = new SettingsFragment();
transaction.replace(R.id.contentContainer, fragment);
}
transaction.commit();
}
});
}
Aggregations