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


Java BottomNavigation类代码示例

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


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

示例1: onDependentViewChanged

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
@Override
public boolean onDependentViewChanged(
    final CoordinatorLayout parent, final FloatingActionMenu child, final View dependency) {
    log(TAG, INFO, "onDependentViewChanged: " + dependency);

    final List<View> list = parent.getDependencies(child);
    int bottomMargin = ((ViewGroup.MarginLayoutParams) child.getLayoutParams()).bottomMargin;

    float t = 0;
    boolean result = false;

    for (View dep : list) {
        if (Snackbar.SnackbarLayout.class.isInstance(dep)) {
            t += dep.getTranslationY() - dep.getHeight();
            result = true;
        } else if (BottomNavigation.class.isInstance(dep)) {
            BottomNavigation navigation = (BottomNavigation) dep;
            t += navigation.getTranslationY() - navigation.getHeight() + bottomMargin;
            result = true;
        }
    }

    child.setTranslationY(t);
    return result;
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:26,代码来源:MainActivityCustomBehavior.java

示例2: onCreate

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getSupportActionBar().setHomeButtonEnabled(false);

    setContentView(R.layout.activity_main);

    if (savedInstanceState != null) {
        selectedIndex = savedInstanceState.getInt(EXTRA_SELECTED_TAB_INDEX);
    }

    bottomNavigation = (BottomNavigation) findViewById(R.id.bottom_navigation);
    viewPager = (ViewPager) findViewById(R.id.view_pager);

    initBottomNavigation();
}
 
开发者ID:vycius,项目名称:NMAkademija,代码行数:18,代码来源:MainActivity.java

示例3: layoutDependsOn

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
@Override public boolean layoutDependsOn(final CoordinatorLayout parent, final FloatingActionButton child, final View dependency) {
    if (BottomNavigation.class.isInstance(dependency)) {
        return true;
    } else if (Snackbar.SnackbarLayout.class.isInstance(dependency)) {
        return true;
    }
    return super.layoutDependsOn(parent, child, dependency);
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:9,代码来源:FloatingActionButtonBehavior.java

示例4: onDependentViewChanged

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
@Override public boolean onDependentViewChanged(@NonNull
                                                final CoordinatorLayout parent, @NonNull
                                                final FloatingActionButton child, final View dependency) {
    log(TAG, INFO, "onDependentViewChanged: " + dependency);
    final List<View> list = parent.getDependencies(child);
    ViewGroup.MarginLayoutParams params = ((ViewGroup.MarginLayoutParams) child.getLayoutParams());
    int bottomMargin = (params.bottomMargin + params.rightMargin) - (params.topMargin + params.leftMargin);
    float t = 0;
    float t2 = 0;
    float t3 = 0;
    boolean result = false;
    for (View dep : list) {
        if (Snackbar.SnackbarLayout.class.isInstance(dep)) {
            t += dep.getTranslationY() - dep.getHeight();
            result = true;
        } else if (BottomNavigation.class.isInstance(dep)) {
            BottomNavigation navigation = (BottomNavigation) dep;
            t2 = navigation.getTranslationY() - navigation.getHeight() + bottomMargin;
            t += t2;
            result = true;

            if (navigationBarHeight > 0) {
                if (!navigation.isExpanded()) {
                    child.hide();
                } else {
                    child.show();
                }
            }
        }
    }

    if (navigationBarHeight > 0 && t2 < 0) {
        t = Math.min(t2, t + navigationBarHeight);
    }

    child.setTranslationY(t);
    return result;
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:39,代码来源:FloatingActionButtonBehavior.java

示例5: initView

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
@Override protected void initView() {
    mContainer = findViewById(R.id.main_activity_container);
    mBottomNavigation = (BottomNavigation) findViewById(R.id.BottomNavigation);
    if (mBottomNavigation != null) {
        mBottomNavigation.setOnMenuItemClickListener(this);
    }
    manager = getFragmentManager();
}
 
开发者ID:wavever,项目名称:GankLock,代码行数:9,代码来源:MainActivity.java

示例6: layoutDependsOn

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
@Override
public boolean layoutDependsOn(final CoordinatorLayout parent, final FloatingActionMenu child, final View dependency) {
    if (BottomNavigation.class.isInstance(dependency)) {
        return true;
    } else if (Snackbar.SnackbarLayout.class.isInstance(dependency)) {
        return true;
    }
    return super.layoutDependsOn(parent, child, dependency);
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:10,代码来源:MainActivityCustomBehavior.java

示例7: createAdater

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
private void createAdater(int height, final boolean hasAppBarLayout) {
    final BottomNavigation navigation = getBottomNavigation();
    MiscUtils.log(getClass().getSimpleName(), Log.INFO, "createAdapter(" + height + ")");
    mRecyclerView.setHasFixedSize(true);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
    mRecyclerView.setAdapter(new Adapter(getContext(), height, hasAppBarLayout));

    if (null != navigation) {
        refreshAdapter();
    }
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:12,代码来源:EnableDisableActivityFragment.java

示例8: setMenuType

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
public boolean setMenuType(final int type) {
    BottomNavigation navigation = getBottomNavigation();
    if (null == navigation) {
        return false;
    }

    switch (type) {
        case MENU_TYPE_3_ITEMS:
            navigation.inflateMenu(R.menu.bottombar_menu_3items);
            break;

        case MENU_TYPE_3_ITEMS_NO_BACKGROUND:
            navigation.inflateMenu(R.menu.bottombar_menu_3items_no_background);
            break;

        case MENU_TYPE_4_ITEMS:
            navigation.inflateMenu(R.menu.bottombar_menu_4items);
            break;

        case MENU_TYPE_4_ITEMS_NO_BACKGROUND:
            navigation.inflateMenu(R.menu.bottombar_menu_4items_no_background);
            break;

        case MENU_TYPE_5_ITEMS:
            navigation.inflateMenu(R.menu.bottombar_menu_5items);
            break;

        case MENU_TYPE_5_ITEMS_NO_BACKGROUND:
            navigation.inflateMenu(R.menu.bottombar_menu_5items_no_background);
            break;
    }

    return true;
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:35,代码来源:MainActivity.java

示例9: onContentChanged

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
@Override
public void onContentChanged() {
    super.onContentChanged();
    mViewPager = (ViewPager) findViewById(R.id.ViewPager01);
    mBottomNavigation = (BottomNavigation) findViewById(R.id.BottomNavigation);
    if (null != mBottomNavigation) {
        Typeface typeface = Typeface.createFromAsset(getAssets(), "Roboto-Light.ttf");
        mBottomNavigation.setOnMenuItemClickListener(this);
        mBottomNavigation.setDefaultTypeface(typeface);
    }
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:12,代码来源:BaseActivity.java

示例10: onCreate

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mBottomNavigation = (BottomNavigation) findViewById(R.id.bottomNavigation);
    mFragmentContainer = (FrameLayout) findViewById(R.id.fragment_container);
    mFragmentManager = getSupportFragmentManager();
    fragmentTags = new ArrayList<>();
    setupBottomNavigation();
    initFraments();
}
 
开发者ID:huanglizhuo,项目名称:GitPath,代码行数:12,代码来源:MainActivity.java

示例11: onActivityStarted

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
@Override public void onActivityStarted(@Nullable Bundle savedInstance,
                                        @NonNull MainView mainView,
                                        @NonNull BottomNavigation bottomNavigation,
                                        @NonNull NavigationView navigationView) {
    navigationView.setNavigationItemSelectedListener(this);
    Typeface myTypeface = TypeFaceHelper.getTypeface();
    bottomNavigation.setDefaultTypeface(myTypeface);
    bottomNavigation.setOnMenuItemClickListener(this);
    if (savedInstance == null) {
        bottomNavigation.setDefaultSelectedIndex(0);
    }
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:13,代码来源:MainPresenter.java

示例12: layoutDependsOn

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
public boolean layoutDependsOn(CoordinatorLayout parent, BottomNavigation child, View dependency) {
    return AppBarLayout.class.isInstance(dependency) || Toolbar.class.isInstance(dependency);
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:4,代码来源:TabletBehavior.java

示例13: onDependentViewChanged

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
public boolean onDependentViewChanged(CoordinatorLayout parent, BottomNavigation child, View dependency) {
    return true;
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:4,代码来源:TabletBehavior.java

示例14: onDependentViewRemoved

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
public void onDependentViewRemoved(CoordinatorLayout parent, BottomNavigation child, View dependency) {
    super.onDependentViewRemoved(parent, child, dependency);
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:4,代码来源:TabletBehavior.java

示例15: onLayoutChild

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
public boolean onLayoutChild(CoordinatorLayout parent, BottomNavigation child, int layoutDirection) {
    return super.onLayoutChild(parent, child, layoutDirection);
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:4,代码来源:TabletBehavior.java


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