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

RoundedCornersTransformation can support 4 various sizes #103

Merged
merged 6 commits into from
Sep 17, 2019
Merged

RoundedCornersTransformation can support 4 various sizes #103

merged 6 commits into from
Sep 17, 2019

Conversation

khatv911
Copy link
Contributor

RoundedCornersTransformation's constructor can accept one single Float value (all corners are equal) or 4 Float values as 4 different rounded radii.

@khatv911 khatv911 closed this Sep 16, 2019
@khatv911 khatv911 reopened this Sep 16, 2019
@khatv911 khatv911 closed this Sep 16, 2019
@khatv911 khatv911 reopened this Sep 16, 2019
@khatv911
Copy link
Contributor Author

Travis build keeps failing. @colinrtwhite can you help to take a look

@@ -10,6 +10,7 @@ import androidx.lifecycle.Observer
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import coil.api.load
import coil.transform.RoundedCornersTransformation

class MainActivity : AppCompatActivity() {
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the changes to the sample app.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed


init {
require(radius >= 0) { "Radius must be >= 0." }
require(radii.size == 1 || radii.size == 4) { "Radii size has to be either 1 or 4" }
require(radii.all { it >= 0 }) { "All radius must be >= 0." }
Copy link
Member

Choose a reason for hiding this comment

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

Nit: "All radii must be >= 0."

@colinrtwhite
Copy link
Member

colinrtwhite commented Sep 16, 2019

@khatv911 Try re-running the build again. Unfortunately, the Travis CI Android Emulator has been a bit flaky lately.

@khatv911 khatv911 closed this Sep 17, 2019
@khatv911
Copy link
Contributor Author

make changes as reviewed.

@khatv911 khatv911 reopened this Sep 17, 2019
@colinrtwhite
Copy link
Member

@khatv911 Thanks. Looks like ktlint is failing at the moment. You can run ./test.sh locally to run the CI checks.

@khatv911
Copy link
Contributor Author

@colinrtwhite thanks for the finding. I had a successful build now.

Copy link
Member

@colinrtwhite colinrtwhite left a comment

Choose a reason for hiding this comment

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

Great, thanks for the contribution.

@colinrtwhite colinrtwhite merged commit 3930686 into coil-kt:master Sep 17, 2019
@khatv911 khatv911 deleted the variousRoundedCorners branch September 17, 2019 03:11
colinrtwhite pushed a commit that referenced this pull request Oct 5, 2022
* RoundedCornersTransformation can support 4 various sizes in clockwise order

* Fix lint issue

* trigger a CI rebuild

* code review changes

* fix wrong corner order

* remove reduntdant brace
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