-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CustomView and Animation homework #43
base: master
Are you sure you want to change the base?
Conversation
} | ||
} | ||
|
||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А ты не хочешь тут описать логику расчетов?
return super.onTouchEvent(event) | ||
} | ||
|
||
private fun animation() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мне кажется что у тебя тут ошибка, как то странно выглядит выбранный сектор на первой картинке
pie.paint.strokeWidth = if(pie.isClicked) 20f else 0f | ||
} | ||
} | ||
requestLayout() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а зачем нужен вызов requestLayout?
private var bOffset = 0f | ||
private var animWidth = 0f | ||
private var clickedPie: PiePiece? = null | ||
private val animatorSet = AnimatorSet() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а зачем сет?
attrs: AttributeSet? = null, | ||
defStyleAttr: Int = 0 | ||
) : View(context, attrs, defStyleAttr) { | ||
private var animator: ValueAnimator = ValueAnimator.ofFloat() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Он разве нужен на уровне класса?
fun onClick(category: String) | ||
} | ||
|
||
class PieChartView @JvmOverloads constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Реализуй, пожалуйста, сохранение/восстановление стейта
No description provided.