當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。