@@ -0,0 +1,3402 @@
+/*%0A * Copyright (C) 2017 Citrus-CAF Project%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *%0A */%0Apackage com.citrus.theme;%0A%0Aimport android.content.Context;%0Aimport android.support.design.widget.CoordinatorLayout;%0Aimport android.support.design.widget.Snackbar;%0Aimport android.support.v4.view.ViewCompat;%0Aimport android.support.v4.view.ViewPropertyAnimatorListener;%0Aimport android.util.AttributeSet;%0Aimport android.view.View;%0A%0Aimport com.github.clans.fab.FloatingActionButton;%0Aimport com.github.clans.fab.FloatingActionMenu;%0A%0Aimport java.util.List;%0A%0Apublic class FloatingActionMenuBehavior extends CoordinatorLayout.Behavior %7B%0A    private float mTranslationY;%0A%0A    public FloatingActionMenuBehavior(Context context, AttributeSet attrs) %7B%0A        super();%0A    %7D%0A%0A    @Override%0A    public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) %7B%0A        return dependency instanceof Snackbar.SnackbarLayout;%0A    %7D%0A%0A    @Override%0A    public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) %7B%0A        if ((child instanceof FloatingActionMenu %7C%7C child instanceof FloatingActionButton) && dependency instanceof Snackbar.SnackbarLayout) %7B%0A            this.updateTranslation(parent, child, dependency);%0A        %7D%0A        return false;%0A    %7D%0A%0A    @Override%0A    public void onDependentViewRemoved(CoordinatorLayout parent, View child, View dependency) %7B%0A        if ((child instanceof FloatingActionMenu %7C%7C child instanceof FloatingActionButton) && dependency instanceof Snackbar.SnackbarLayout) %7B%0A            this.updateTranslation(parent, child, dependency);%0A        %7D%0A    %7D%0A%0A    private void updateTranslation(CoordinatorLayout parent, View child, View dependency) %7B%0A        float translationY = this.getTranslationY(parent, child);%0A        if (translationY != this.mTranslationY) %7B%0A            ViewCompat.animate(child)%0A                    .cancel();%0A            if (Math.abs(translationY - this.mTranslationY) == (float) dependency.getHeight()) %7B%0A                ViewCompat.animate(child)%0A                        .translationY(translationY)%0A                        .setListener((ViewPropertyAnimatorListener) null);%0A            %7D else %7B%0A                ViewCompat.setTranslationY(child, translationY);%0A            %7D%0A%0A            this.mTranslationY = translationY;%0A        %7D%0A%0A    %7D%0A%0A    private float getTranslationY(CoordinatorLayout parent, View child) %7B%0A        float minOffset = 0.0F;%0A        List dependencies = parent.getDependencies(child);%0A        int i = 0;%0A%0A        for (int z = dependencies.size(); i %3C z; ++i) %7B%0A            View view = (View) dependencies.get(i);%0A            if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(child, view)) %7B%0A                minOffset = Math.min(minOffset, ViewCompat.getTranslationY(view) - (float) view.getHeight());%0A            %7D%0A        %7D%0A%0A        return minOffset;%0A    %7D%0A%7D

fix FAB behaviour with snackbar