|
|
@@ -35,7 +35,7 @@ public class Loading {
|
|
|
private FrameAnimation animation;
|
|
|
private int delayMs = 0;
|
|
|
private Disposable disposable;
|
|
|
-
|
|
|
+ private ImageView imageView;
|
|
|
|
|
|
public Loading(Activity context) {
|
|
|
this.activity = context;
|
|
|
@@ -79,8 +79,9 @@ public class Loading {
|
|
|
private void showInternal() {
|
|
|
if (null != view) {
|
|
|
view.setAlpha(1f);
|
|
|
- ImageView imageView = view.findViewById(R.id.image_loading);
|
|
|
- animation = new FrameAnimation.Builder(imageView, R.array.loading_animation, 50).repeat(true).build();
|
|
|
+ imageView = view.findViewById(R.id.image_loading);
|
|
|
+ imageView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
|
|
+ animation = new FrameAnimation.Builder(imageView, R.array.loading_animation, 40).repeat(true).build();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -95,6 +96,8 @@ public class Loading {
|
|
|
if (null != view) {
|
|
|
FrameLayout frameLayout = activity.findViewById(android.R.id.content);
|
|
|
frameLayout.removeView(view);
|
|
|
+ imageView.setLayerType(View.LAYER_TYPE_NONE, null);
|
|
|
+ imageView = null;
|
|
|
view = null;
|
|
|
activity = null;
|
|
|
}
|