Java 类android.support.design.widget.Snackbar.SnackbarLayout 实例源码

项目:boohee_v5.6    文件:FloatingActionButton.java   
public boolean onDependentViewChanged(CoordinatorLayout parent, FloatingActionButton child, View dependency) {
    if (dependency instanceof SnackbarLayout) {
        updateFabTranslationForSnackbar(parent, child, dependency);
    } else if (dependency instanceof AppBarLayout) {
        updateFabVisibility(parent, (AppBarLayout) dependency, child);
    }
    return false;
}
项目:boohee_v5.6    文件:FloatingActionButton.java   
private float getFabTranslationYForSnackbar(CoordinatorLayout parent, FloatingActionButton fab) {
    float minOffset = 0.0f;
    List<View> dependencies = parent.getDependencies(fab);
    int z = dependencies.size();
    for (int i = 0; i < z; i++) {
        View view = (View) dependencies.get(i);
        if ((view instanceof SnackbarLayout) && parent.doViewsOverlap(fab, view)) {
            minOffset = Math.min(minOffset, ViewCompat.getTranslationY(view) - ((float) view.getHeight()));
        }
    }
    return minOffset;
}
项目:Material-BottomNavigation    文件:BottomBehavior.java   
@Override
public boolean onDependentViewChanged(final CoordinatorLayout parent, final BottomNavigation child, View dependency) {
    if (isSnackbar(dependency)) {
        if (null == snackbarDependentView) {
            snackbarDependentView = new SnackBarDependentView((SnackbarLayout) dependency, height, bottomInset);
        }
        return snackbarDependentView.onDependentViewChanged(parent, child);
    }
    return super.onDependentViewChanged(parent, child, dependency);
}
项目:boohee_v5.6    文件:FloatingActionButton.java   
public boolean layoutDependsOn(CoordinatorLayout parent, FloatingActionButton child, View dependency) {
    return SNACKBAR_BEHAVIOR_ENABLED && (dependency instanceof SnackbarLayout);
}
项目:Material-BottomNavigation    文件:BottomBehavior.java   
private boolean isSnackbar(@NonNull final View view) {
    return SnackbarLayout.class.isInstance(view);
}
项目:Material-BottomNavigation    文件:BottomBehavior.java   
SnackBarDependentView(final SnackbarLayout child, final int height, final int bottomInset) {
    super(child, height, bottomInset);
}