|
|
@@ -1,5 +1,7 @@
|
|
|
package kr.co.zumo.app.lifeplus.view.dialog;
|
|
|
|
|
|
+import android.animation.AnimatorSet;
|
|
|
+import android.animation.ObjectAnimator;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
@@ -7,9 +9,13 @@ import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.view.Window;
|
|
|
+import android.view.animation.DecelerateInterpolator;
|
|
|
import android.widget.ImageView;
|
|
|
+import android.widget.TextView;
|
|
|
|
|
|
import com.bumptech.glide.Glide;
|
|
|
+import com.robinhood.ticker.TickerUtils;
|
|
|
+import com.robinhood.ticker.TickerView;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
|
|
|
@@ -26,6 +32,8 @@ import kr.co.zumo.app.R;
|
|
|
public class CoinSavingDialog extends DialogBase {
|
|
|
|
|
|
private ImageView imageViewCoin;
|
|
|
+ private TextView textViewCoinDetail;
|
|
|
+ private TickerView tickerView;
|
|
|
|
|
|
@Nullable
|
|
|
@Override
|
|
|
@@ -38,7 +46,35 @@ public class CoinSavingDialog extends DialogBase {
|
|
|
Window window = getDialog().getWindow();
|
|
|
window.setBackgroundDrawableResource(R.color.CB3FFFFFF);
|
|
|
imageViewCoin = getView().findViewById(R.id.image_view_coin);
|
|
|
+ textViewCoinDetail = getView().findViewById(R.id.text_view_coin_detail);
|
|
|
|
|
|
+ tickerView = getView().findViewById(R.id.ticker_view);
|
|
|
+ tickerView.setText("00000");
|
|
|
+ tickerView.setCharacterLists(TickerUtils.provideNumberList());
|
|
|
+ tickerView.setText("15849", true);
|
|
|
+ tickerView.setAnimationInterpolator(new DecelerateInterpolator());
|
|
|
Glide.with(imageViewCoin).asGif().load(R.raw.coin_saving).into(imageViewCoin);
|
|
|
+
|
|
|
+ textViewCoinDetail.setText("+100");
|
|
|
+
|
|
|
+ setAnimationSetting();
|
|
|
+ startAnimation();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setAnimationSetting() {
|
|
|
+ textViewCoinDetail.setAlpha(0.0f);
|
|
|
+ textViewCoinDetail.setTranslationY(100f);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void startAnimation() {
|
|
|
+ ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(textViewCoinDetail, View.ALPHA, 0.0f, 1.0f);
|
|
|
+ alphaAnimator.setDuration(1000);
|
|
|
+ ObjectAnimator translationYAnimator = ObjectAnimator.ofFloat(textViewCoinDetail, View.TRANSLATION_Y, textViewCoinDetail.getTranslationY(), 0f);
|
|
|
+ translationYAnimator.setDuration(1000);
|
|
|
+
|
|
|
+ AnimatorSet animatorSet = new AnimatorSet();
|
|
|
+ animatorSet.playTogether(alphaAnimator, translationYAnimator);
|
|
|
+ animatorSet.setStartDelay(500);
|
|
|
+ animatorSet.start();
|
|
|
}
|
|
|
}
|