|
|
@@ -29,6 +29,7 @@ public class EventChartViewHolder extends RecyclerView.ViewHolder {
|
|
|
private View viewGraph;
|
|
|
private TextView textViewItemTitle;
|
|
|
private TextView textViewTotalCount;
|
|
|
+ private float randomGraph = (float) (Math.random() * 150 + 1);
|
|
|
|
|
|
|
|
|
public EventChartViewHolder(View itemView) {
|
|
|
@@ -42,7 +43,6 @@ public class EventChartViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
|
|
public void bind(IEventListener listener) {
|
|
|
// TODO: 그래프 계산
|
|
|
- float randomGraph = (float) (Math.random() * 150 + 1);
|
|
|
imageViewBackGround.setBackgroundColor(itemView.getResources().getColor(R.color.CF6F6F6));
|
|
|
textViewItemTitle.setText("연남동");
|
|
|
textViewTotalCount.setText((int) randomGraph + "명");
|
|
|
@@ -56,9 +56,34 @@ public class EventChartViewHolder extends RecyclerView.ViewHolder {
|
|
|
}
|
|
|
|
|
|
public void doStartAnimation() {
|
|
|
- ScaleAnimation animation
|
|
|
+ ScaleAnimation graphAnimation
|
|
|
= new ScaleAnimation(1.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 1.0f);
|
|
|
- animation.setDuration(1200);
|
|
|
- viewGraph.startAnimation(animation);
|
|
|
+ graphAnimation.setDuration(1200);
|
|
|
+ viewGraph.startAnimation(graphAnimation);
|
|
|
+
|
|
|
+ ScaleAnimation userFlagAnimation
|
|
|
+ = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
|
|
|
+ userFlagAnimation.setDuration(500);
|
|
|
+
|
|
|
+ graphAnimation.setAnimationListener(new Animation.AnimationListener() {
|
|
|
+ @Override
|
|
|
+ public void onAnimationStart(Animation animation) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onAnimationEnd(Animation animation) {
|
|
|
+
|
|
|
+ if (randomGraph > 100) {
|
|
|
+ flagUserPick.setVisibility(View.VISIBLE);
|
|
|
+ flagUserPick.startAnimation(userFlagAnimation);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onAnimationRepeat(Animation animation) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|