mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-17 11:19:01 +00:00
Remove unused file
This commit is contained in:
parent
4d749c7604
commit
63f6397cbc
1 changed files with 0 additions and 70 deletions
|
|
@ -1,70 +0,0 @@
|
|||
package com.habitrpg.android.habitica.ui.helpers;
|
||||
|
||||
// https://gist.github.com/lodlock/e3cd12130bad70a098db
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v4.view.ViewPropertyAnimatorListener;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
import com.github.clans.fab.FloatingActionMenu;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class FloatingActionMenuBehavior extends CoordinatorLayout.Behavior {
|
||||
private float mTranslationY;
|
||||
|
||||
public FloatingActionMenuBehavior(Context context, AttributeSet attrs) {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) {
|
||||
return dependency instanceof Snackbar.SnackbarLayout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) {
|
||||
if (child instanceof FloatingActionMenu && dependency instanceof Snackbar.SnackbarLayout) {
|
||||
this.updateTranslation(parent, child, dependency);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void updateTranslation(CoordinatorLayout parent, View child, View dependency) {
|
||||
float translationY = this.getTranslationY(parent, child);
|
||||
if (translationY != this.mTranslationY) {
|
||||
ViewCompat.animate(child)
|
||||
.cancel();
|
||||
if (Math.abs(translationY - this.mTranslationY) == (float) dependency.getHeight()) {
|
||||
ViewCompat.animate(child)
|
||||
.translationY(translationY)
|
||||
.setListener((ViewPropertyAnimatorListener) null);
|
||||
} else {
|
||||
ViewCompat.setTranslationY(child, translationY);
|
||||
}
|
||||
|
||||
this.mTranslationY = translationY;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private float getTranslationY(CoordinatorLayout parent, View child) {
|
||||
float minOffset = 0.0F;
|
||||
List dependencies = parent.getDependencies(child);
|
||||
int i = 0;
|
||||
|
||||
for (int z = dependencies.size(); i < z; ++i) {
|
||||
View view = (View) dependencies.get(i);
|
||||
if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(child, view)) {
|
||||
minOffset = Math.min(minOffset, ViewCompat.getTranslationY(view) - (float) view.getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
return minOffset;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue