当前位置: 首页>>代码示例>>Java>>正文


Java AHBottomNavigationAdapter类代码示例

本文整理汇总了Java中com.aurelhubert.ahbottomnavigation.AHBottomNavigationAdapter的典型用法代码示例。如果您正苦于以下问题:Java AHBottomNavigationAdapter类的具体用法?Java AHBottomNavigationAdapter怎么用?Java AHBottomNavigationAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AHBottomNavigationAdapter类属于com.aurelhubert.ahbottomnavigation包,在下文中一共展示了AHBottomNavigationAdapter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import com.aurelhubert.ahbottomnavigation.AHBottomNavigationAdapter; //导入依赖的package包/类
@Override
public void start(Bundle savedInstanceState) {
    AHBottomNavigationAdapter navigationAdapter = new AHBottomNavigationAdapter(activity, R.menu.menu_bottom_bar);
    navigationAdapter.setupWithBottomNavigation(bottomNavigation, null);
    final int accentColor;
    final int backgroundColor;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        accentColor = activity.getResources().getColor(R.color.primary, null);
        backgroundColor = activity.getResources().getColor(R.color.bottom_nav_background, null);
    } else {
        accentColor = activity.getResources().getColor(R.color.primary);
        backgroundColor = activity.getResources().getColor(R.color.bottom_nav_background);
    }
    bottomNavigation.setColored(false);
    bottomNavigation.setDefaultBackgroundColor(backgroundColor);
    bottomNavigation.setBehaviorTranslationEnabled(false);
    bottomNavigation.setAccentColor(accentColor);
    bottomNavigation.setOnTabSelectedListener(new BottomNavigationItemListener());
}
 
开发者ID:lecho,项目名称:conference-app,代码行数:20,代码来源:BottomNavigationController.java

示例2: setupBottomNavigation

import com.aurelhubert.ahbottomnavigation.AHBottomNavigationAdapter; //导入依赖的package包/类
private void setupBottomNavigation() {
  AHBottomNavigationAdapter adapter = new AHBottomNavigationAdapter(this, R.menu.navigation_home);
  adapter.setupWithBottomNavigation(bottomNavigation, null);

  bottomNavigation.setDefaultBackgroundColor(ContextCompat.getColor(this, R.color.bottom_navigation_background));
  bottomNavigation.setAccentColor(ContextCompat.getColor(this, R.color.bottom_navigation_item));
  bottomNavigation.setInactiveColor(ContextCompat.getColor(this, R.color.bottom_navigation_item_inactive));
  bottomNavigation.setForceTitlesHide(true);
  bottomNavigation.setOnTabSelectedListener((position, wasSelected) -> {
    presenter.onTabSelected(position, wasSelected);
    return true;
  });
}
 
开发者ID:philipphager,项目名称:disclosure-android-app,代码行数:14,代码来源:HomeActivity.java


注:本文中的com.aurelhubert.ahbottomnavigation.AHBottomNavigationAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。