Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Yahiko-ux
Copy link

No description provided.

}
}

override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
Copy link
Collaborator

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() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2022-12-25 at 18 16 52

Screenshot 2022-12-25 at 18 16 50

Copy link
Collaborator

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()
Copy link
Collaborator

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()
Copy link
Collaborator

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()
Copy link
Collaborator

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(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Реализуй, пожалуйста, сохранение/восстановление стейта

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants