mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Bug 817721/817735/817732 - Add support for width animations in PropertyAnimator (r=mfinkle)
This commit is contained in:
parent
f1c0dc32a9
commit
024e7080f7
@ -57,6 +57,23 @@ public class AnimatorProxy {
|
||||
return proxy;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
View view = mImpl.getView();
|
||||
if (view != null)
|
||||
return view.getWidth();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setWidth(int width) {
|
||||
View view = mImpl.getView();
|
||||
if (view != null) {
|
||||
ViewGroup.LayoutParams lp = view.getLayoutParams();
|
||||
lp.width = width;
|
||||
view.setLayoutParams(lp);
|
||||
}
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
View view = mImpl.getView();
|
||||
if (view != null)
|
||||
|
@ -26,6 +26,7 @@ public class PropertyAnimator implements Runnable {
|
||||
TRANSLATION_Y,
|
||||
SCROLL_X,
|
||||
SCROLL_Y,
|
||||
WIDTH,
|
||||
HEIGHT
|
||||
}
|
||||
|
||||
@ -121,6 +122,8 @@ public class PropertyAnimator implements Runnable {
|
||||
element.from = element.proxy.getScrollY();
|
||||
else if (element.property == Property.SCROLL_X)
|
||||
element.from = element.proxy.getScrollX();
|
||||
else if (element.property == Property.WIDTH)
|
||||
element.from = element.proxy.getWidth();
|
||||
else if (element.property == Property.HEIGHT)
|
||||
element.from = element.proxy.getHeight();
|
||||
|
||||
@ -195,6 +198,8 @@ public class PropertyAnimator implements Runnable {
|
||||
element.proxy.scrollTo(element.proxy.getScrollX(), (int) delta);
|
||||
else if (element.property == Property.SCROLL_X)
|
||||
element.proxy.scrollTo((int) delta, element.proxy.getScrollY());
|
||||
else if (element.property == Property.WIDTH)
|
||||
element.proxy.setWidth((int) delta);
|
||||
else if (element.property == Property.HEIGHT)
|
||||
element.proxy.setHeight((int) delta);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user