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

Fixed adaptive progress bar update #234

Merged
merged 1 commit into from
Feb 6, 2018
Merged

Conversation

kvld
Copy link
Contributor

@kvld kvld commented Feb 6, 2018

Коротко для Release Notes, в формате «Сделали/Добавили/Исправили N»:
Фикс поведения статус бара в адаптивном режиме

Описание:
В некоторых случаях прогресс бар мог некорректно обновляться из-за того, что к прогрессу прибавляется константа для лучшего отображения.

@kvld kvld added this to the 1.52 milestone Feb 6, 2018
@kvld kvld self-assigned this Feb 6, 2018
@kvld kvld requested a review from Ostrenkiy February 6, 2018 23:00

expLabel.text = String(format: NSLocalizedString("RatingProgress", comment: ""), "\(rating)", "\(maxRating)")
levelLabel.text = String(format: NSLocalizedString("RatingProgressLevel", comment: ""), "\(currentLevel)")

let newProgress = Float(rating - prevMaxRating) / Float(maxRating - prevMaxRating)
let newProgress = Float(rating - prevMaxRating) / Float(maxRating - prevMaxRating) + progressAddition
let shouldFulfill = progressBar.progress > newProgress
Copy link
Contributor

Choose a reason for hiding this comment

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

правильно понимаю, что можно было это заменить на let shouldFulfill = progressBar.progress > newProgress + progressAddition и получилось бы то же самое, что сейчас?

P.S. Это не значит, что нужно менять

@Ostrenkiy Ostrenkiy merged commit c5de914 into dev Feb 6, 2018
@Ostrenkiy Ostrenkiy deleted the fix/adaptive-progressbar branch February 6, 2018 23:19
@Ostrenkiy Ostrenkiy mentioned this pull request Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants