|
|
@@ -7,9 +7,6 @@ import android.graphics.drawable.AnimationDrawable;
|
|
|
import android.support.v4.content.ContextCompat;
|
|
|
import android.widget.ImageView;
|
|
|
|
|
|
-import io.reactivex.Single;
|
|
|
-import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
-import io.reactivex.schedulers.Schedulers;
|
|
|
import kr.co.zumo.app.R;
|
|
|
|
|
|
/**
|
|
|
@@ -24,22 +21,10 @@ import kr.co.zumo.app.R;
|
|
|
*/
|
|
|
public class NotiAnimation {
|
|
|
|
|
|
- private AnimationDrawable animationDrawable;
|
|
|
-
|
|
|
public void show(ImageView target) {
|
|
|
-// GlideApp.with(target).load(ContextCompat.getDrawable(target.getContext(), R.drawable.noti_animation))
|
|
|
-// .into(target);
|
|
|
-
|
|
|
- Single.fromCallable(() -> {
|
|
|
- return ContextCompat.getDrawable(target.getContext(), R.drawable.noti_animation);
|
|
|
- })
|
|
|
- .subscribeOn(Schedulers.computation())
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(drawable -> {
|
|
|
- target.setImageDrawable(drawable);
|
|
|
- animationDrawable = (AnimationDrawable) target.getDrawable();
|
|
|
- animationDrawable.setOneShot(true);
|
|
|
- animationDrawable.start();
|
|
|
- }, Throwable::printStackTrace);
|
|
|
+ target.setImageDrawable(ContextCompat.getDrawable(target.getContext(), R.drawable.noti_animation));
|
|
|
+ AnimationDrawable animationDrawable = (AnimationDrawable) target.getDrawable();
|
|
|
+ animationDrawable.setOneShot(true);
|
|
|
+ animationDrawable.start();
|
|
|
}
|
|
|
}
|