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


Java CoordinatorLayout.doViewsOverlap方法代码示例

本文整理汇总了Java中android.support.design.widget.CoordinatorLayout.doViewsOverlap方法的典型用法代码示例。如果您正苦于以下问题:Java CoordinatorLayout.doViewsOverlap方法的具体用法?Java CoordinatorLayout.doViewsOverlap怎么用?Java CoordinatorLayout.doViewsOverlap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.design.widget.CoordinatorLayout的用法示例。


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

示例1: getFabTranslationYForSnackBar

import android.support.design.widget.CoordinatorLayout; //导入方法依赖的package包/类
private float getFabTranslationYForSnackBar(CoordinatorLayout parent,
                                            FloatingActionButton fab) {
    float minOffset = 0;
    final List<View> dependencies = parent.getDependencies(fab);
    for (int i = 0, z = dependencies.size(); i < z; i++) {
        final View view = dependencies.get(i);
        if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(fab, view)) {
            minOffset = Math.min(minOffset,
                    ViewCompat.getTranslationY(view) - view.getHeight());
        }
    }

    return minOffset;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:BottomNavBarFabBehaviour.java

示例2: getFabTranslationYForSnackbar

import android.support.design.widget.CoordinatorLayout; //导入方法依赖的package包/类
private float getFabTranslationYForSnackbar(CoordinatorLayout parent,
                                            View fab) {
    float minOffset = 0;
    final List<View> dependencies = parent.getDependencies(fab);
    for (int i = 0, z = dependencies.size(); i < z; i++) {
        final View view = dependencies.get(i);
        if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(fab, view)) {
            minOffset = Math.min(minOffset,
                    ViewCompat.getTranslationY(view) - view.getHeight());
        }
    }

    return minOffset;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:MyCommentBehavior.java

示例3: getTranslationYForSnackbar

import android.support.design.widget.CoordinatorLayout; //导入方法依赖的package包/类
private float getTranslationYForSnackbar(CoordinatorLayout parent, CircleIndicator ci) {
    float minOffset = 0;
    final List<View> dependencies = parent.getDependencies(ci);
    for (int i = 0, z = dependencies.size(); i < z; i++) {
        final View view = dependencies.get(i);
        if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(ci, view)) {
            minOffset =
                    Math.min(minOffset, ViewCompat.getTranslationY(view) - view.getHeight());
        }
    }

    return minOffset;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:SnackbarBehavior.java

示例4: getFabTranslationYForSnackbar

import android.support.design.widget.CoordinatorLayout; //导入方法依赖的package包/类
/**
 * Find the {@code translation Y} value for any child Snackbar components.
 *
 * @return 0.0F if there are no Snackbar components found, otherwise returns the min offset that
 * the FAB component should be animated.
 */
private float getFabTranslationYForSnackbar(CoordinatorLayout parent, View fab) {
    float minOffset = 0.0F;
    final List<View> dependencies = parent.getDependencies(fab);

    for (View view : dependencies) {
        if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(fab, view)) {
            minOffset = Math.min(minOffset, view.getTranslationY() - (float) view.getHeight());
        }
    }

    return minOffset;
}
 
开发者ID:jahirfiquitiva,项目名称:FABsMenu,代码行数:19,代码来源:FABSnackbarBehavior.java

示例5: getFabTranslationYForSnackbar

import android.support.design.widget.CoordinatorLayout; //导入方法依赖的package包/类
private float getFabTranslationYForSnackbar(CoordinatorLayout parent,
                                            FabSpeedDial fab) {
    float minOffset = 0;
    final List<View> dependencies = parent.getDependencies(fab);
    for (int i = 0, z = dependencies.size(); i < z; i++) {
        final View view = dependencies.get(i);
        if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(fab, view)) {
            minOffset = Math.min(minOffset,
                    ViewCompat.getTranslationY(view) - view.getHeight());
        }
    }

    return minOffset;
}
 
开发者ID:Alcatraz323,项目名称:MaterialOCR,代码行数:15,代码来源:FabSpeedDialBehaviour.java

示例6: getTranslationYForSnackbar

import android.support.design.widget.CoordinatorLayout; //导入方法依赖的package包/类
private float getTranslationYForSnackbar(CoordinatorLayout parent, FooterLayout footerLayout) {

        float minOffset = 0;
        final List<View> dependencies = parent.getDependencies(footerLayout);
        for (int i = 0, z = dependencies.size(); i < z; i++) {
            final View view = dependencies.get(i);
            if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(footerLayout, view)) {
                minOffset = Math.min(minOffset, ViewCompat.getTranslationY(view) - view.getHeight());
            }
        }

        return minOffset;
    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:14,代码来源:FooterBehavior.java


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