use of com.roughike.bottombar.OnTabSelectListener in project BottomBar by roughike.
the class FiveColorChangingTabsActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_color_changing_tabs);
messageView = (TextView) findViewById(R.id.messageView);
BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
@Override
public void onTabSelected(@IdRes int tabId) {
messageView.setText(TabMessage.get(tabId, false));
}
});
bottomBar.setOnTabReselectListener(new OnTabReselectListener() {
@Override
public void onTabReSelected(@IdRes int tabId) {
Toast.makeText(getApplicationContext(), TabMessage.get(tabId, true), Toast.LENGTH_LONG).show();
}
});
}
use of com.roughike.bottombar.OnTabSelectListener 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();
}
});
}
use of com.roughike.bottombar.OnTabSelectListener in project BottomBar by roughike.
the class BadgeActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_three_tabs);
messageView = (TextView) findViewById(R.id.messageView);
final BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
@Override
public void onTabSelected(@IdRes int tabId) {
messageView.setText(TabMessage.get(tabId, false));
}
});
bottomBar.setOnTabReselectListener(new OnTabReselectListener() {
@Override
public void onTabReSelected(@IdRes int tabId) {
Toast.makeText(getApplicationContext(), TabMessage.get(tabId, true), Toast.LENGTH_LONG).show();
}
});
BottomBarTab nearby = bottomBar.getTabWithId(R.id.tab_nearby);
nearby.setBadgeCount(5);
}
use of com.roughike.bottombar.OnTabSelectListener in project BottomBar by roughike.
the class CustomColorAndFontActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_color_and_font);
messageView = (TextView) findViewById(R.id.messageView);
BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
@Override
public void onTabSelected(@IdRes int tabId) {
messageView.setText(TabMessage.get(tabId, false));
}
});
bottomBar.setOnTabReselectListener(new OnTabReselectListener() {
@Override
public void onTabReSelected(@IdRes int tabId) {
Toast.makeText(getApplicationContext(), TabMessage.get(tabId, true), Toast.LENGTH_LONG).show();
}
});
}
use of com.roughike.bottombar.OnTabSelectListener in project BottomBar by roughike.
the class ThreeTabsActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_three_tabs);
messageView = (TextView) findViewById(R.id.messageView);
BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
@Override
public void onTabSelected(@IdRes int tabId) {
messageView.setText(TabMessage.get(tabId, false));
}
});
bottomBar.setOnTabReselectListener(new OnTabReselectListener() {
@Override
public void onTabReSelected(@IdRes int tabId) {
Toast.makeText(getApplicationContext(), TabMessage.get(tabId, true), Toast.LENGTH_LONG).show();
}
});
}
Aggregations