• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BottomNavigation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: onNestedVerticalOverScroll

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


示例17: onDirectionNestedPreScroll

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
public void onDirectionNestedPreScroll(CoordinatorLayout coordinatorLayout, BottomNavigation child, View target, int dx, int dy, int[]
        consumed, int scrollDirection) {
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:4,代码来源:TabletBehavior.java


示例18: onNestedDirectionFling

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
protected boolean onNestedDirectionFling(CoordinatorLayout coordinatorLayout, BottomNavigation child, View target, float velocityX, float
        velocityY, int scrollDirection) {
    return false;
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:5,代码来源:TabletBehavior.java


示例19: getBottomNavigation

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
BottomNavigation getBottomNavigation() {
    return ((BaseActivity) getActivity()).getBottomNavigation();
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:4,代码来源:EnableDisableActivityFragment.java


示例20: onMenuChanged

import it.sephiroth.android.library.bottomnavigation.BottomNavigation; //导入依赖的package包/类
@Override
public void onMenuChanged(final BottomNavigation parent) {
    refreshAdapter();
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:5,代码来源:EnableDisableActivityFragment.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PredicateType类代码示例发布时间:2022-05-22
下一篇:
Java SessionIdGenerator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap