|
|
|
@ -1885,47 +1885,52 @@ public class Helper {
|
|
|
|
|
field.setAccessible(true);
|
|
|
|
|
|
|
|
|
|
if (!ftype.isArray()) {
|
|
|
|
|
if (Animator.class.isAssignableFrom(type)) {
|
|
|
|
|
Animator animator = (Animator) field.get(instance);
|
|
|
|
|
if (animator != null) {
|
|
|
|
|
sb.append(" animator");
|
|
|
|
|
if (animator.isStarted())
|
|
|
|
|
animator.cancel();
|
|
|
|
|
animator.setTarget(null);
|
|
|
|
|
try {
|
|
|
|
|
if (View.class.isAssignableFrom(type)) {
|
|
|
|
|
View v = (View) field.get(instance);
|
|
|
|
|
if (v != null) {
|
|
|
|
|
sb.append(" tag");
|
|
|
|
|
v.setTag(null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Snackbar.class.isAssignableFrom(type)) {
|
|
|
|
|
Snackbar snackbar = (Snackbar) field.get(instance);
|
|
|
|
|
if (snackbar != null) {
|
|
|
|
|
sb.append(" action");
|
|
|
|
|
snackbar.setAction(null, null);
|
|
|
|
|
if (TextView.class.isAssignableFrom(type)) {
|
|
|
|
|
TextView tv = (TextView) field.get(instance);
|
|
|
|
|
if (tv != null) {
|
|
|
|
|
sb.append(" text");
|
|
|
|
|
tv.setText(null);
|
|
|
|
|
sb.append(" drawables");
|
|
|
|
|
tv.setCompoundDrawables(null, null, null, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (View.class.isAssignableFrom(type)) {
|
|
|
|
|
View v = (View) field.get(instance);
|
|
|
|
|
if (v != null) {
|
|
|
|
|
sb.append(" tag");
|
|
|
|
|
v.setTag(null);
|
|
|
|
|
if (ImageView.class.isAssignableFrom(type)) {
|
|
|
|
|
ImageView iv = (ImageView) field.get(instance);
|
|
|
|
|
if (iv != null) {
|
|
|
|
|
sb.append(" drawable");
|
|
|
|
|
iv.setImageDrawable(null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (TextView.class.isAssignableFrom(type)) {
|
|
|
|
|
TextView tv = (TextView) field.get(instance);
|
|
|
|
|
if (tv != null) {
|
|
|
|
|
sb.append(" text");
|
|
|
|
|
tv.setText(null);
|
|
|
|
|
sb.append(" drawables");
|
|
|
|
|
tv.setCompoundDrawables(null, null, null, null);
|
|
|
|
|
|
|
|
|
|
if (Animator.class.isAssignableFrom(type)) {
|
|
|
|
|
Animator animator = (Animator) field.get(instance);
|
|
|
|
|
if (animator != null) {
|
|
|
|
|
sb.append(" animator");
|
|
|
|
|
if (animator.isStarted())
|
|
|
|
|
animator.cancel();
|
|
|
|
|
animator.setTarget(null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ImageView.class.isAssignableFrom(type)) {
|
|
|
|
|
ImageView iv = (ImageView) field.get(instance);
|
|
|
|
|
if (iv != null) {
|
|
|
|
|
sb.append(" drawable");
|
|
|
|
|
iv.setImageDrawable(null);
|
|
|
|
|
if (Snackbar.class.isAssignableFrom(type)) {
|
|
|
|
|
Snackbar snackbar = (Snackbar) field.get(instance);
|
|
|
|
|
if (snackbar != null) {
|
|
|
|
|
sb.append(" action");
|
|
|
|
|
snackbar.setAction(null, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|