borrow AnimationDrawable from AOSP

This commit is contained in:
Mis012
2024-04-03 01:54:30 +02:00
parent 04ee40d010
commit 1e64babfd4
6 changed files with 402 additions and 16 deletions

View File

@@ -18,6 +18,7 @@ public class DrawableContainer extends Drawable {
if (idx >= 0 && idx < state.childCount && idx != curIndex && state.drawables[idx] != null) {
curIndex = idx;
native_selectChild(paintable, state.drawables[idx].paintable);
invalidateSelf();
return true;
}
return false;
@@ -34,7 +35,7 @@ public class DrawableContainer extends Drawable {
public DrawableContainerState(DrawableContainerState orig, DrawableContainer owner, Resources res) {
}
public int getCapacity() {
return drawables.length;
}
@@ -43,6 +44,10 @@ public class DrawableContainer extends Drawable {
return childCount;
}
public Drawable getChild(int idx) {
return drawables[idx];
}
public int addChild(Drawable dr) {
if (childCount >= drawables.length) {
growArray(drawables.length, drawables.length * 2);
@@ -57,5 +62,5 @@ public class DrawableContainer extends Drawable {
drawables = newDrawables;
}
}
}