android: Fix the menu animations
Turns out those unused methods were actually used for something.
This commit is contained in:
parent
eee0f42381
commit
b5cafc8fd1
@ -6,8 +6,10 @@ import android.widget.FrameLayout;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* FrameLayout subclass with few Properties added to simplify animations.
|
* FrameLayout subclass with few Properties added to simplify animations.
|
||||||
|
* Don't remove the methods appearing as unused, in order not to break the menu animations
|
||||||
*/
|
*/
|
||||||
public final class SettingsFrameLayout extends FrameLayout {
|
public final class SettingsFrameLayout extends FrameLayout {
|
||||||
|
private float mVisibleness = 1.0f;
|
||||||
|
|
||||||
public SettingsFrameLayout(Context context) {
|
public SettingsFrameLayout(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@ -24,4 +26,23 @@ public final class SettingsFrameLayout extends FrameLayout {
|
|||||||
public SettingsFrameLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
public SettingsFrameLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||||
super(context, attrs, defStyleAttr, defStyleRes);
|
super(context, attrs, defStyleAttr, defStyleRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float getYFraction() {
|
||||||
|
return getY() / getHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYFraction(float yFraction) {
|
||||||
|
final int height = getHeight();
|
||||||
|
setY((height > 0) ? (yFraction * height) : -9999);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getVisibleness() {
|
||||||
|
return mVisibleness;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVisibleness(float visibleness) {
|
||||||
|
setScaleX(visibleness);
|
||||||
|
setScaleY(visibleness);
|
||||||
|
setAlpha(visibleness);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user