mirror of https://github.com/M66B/FairEmail.git
Added fail-safe
This commit is contained in:
parent
9d97c18b1d
commit
1dedf76261
|
@ -1885,6 +1885,33 @@ public class Helper {
|
|||
field.setAccessible(true);
|
||||
|
||||
if (!ftype.isArray()) {
|
||||
try {
|
||||
if (View.class.isAssignableFrom(type)) {
|
||||
View v = (View) field.get(instance);
|
||||
if (v != null) {
|
||||
sb.append(" tag");
|
||||
v.setTag(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 (ImageView.class.isAssignableFrom(type)) {
|
||||
ImageView iv = (ImageView) field.get(instance);
|
||||
if (iv != null) {
|
||||
sb.append(" drawable");
|
||||
iv.setImageDrawable(null);
|
||||
}
|
||||
}
|
||||
|
||||
if (Animator.class.isAssignableFrom(type)) {
|
||||
Animator animator = (Animator) field.get(instance);
|
||||
if (animator != null) {
|
||||
|
@ -1902,30 +1929,8 @@ public class Helper {
|
|||
snackbar.setAction(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (View.class.isAssignableFrom(type)) {
|
||||
View v = (View) field.get(instance);
|
||||
if (v != null) {
|
||||
sb.append(" tag");
|
||||
v.setTag(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 (ImageView.class.isAssignableFrom(type)) {
|
||||
ImageView iv = (ImageView) field.get(instance);
|
||||
if (iv != null) {
|
||||
sb.append(" drawable");
|
||||
iv.setImageDrawable(null);
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue