Skip to content

Sample: Showcase 2:1 aspect ratio#386

Merged
Canato merged 4 commits into
CanHub:mainfrom
vanniktech:sample-fix-aspect-ratio
Jun 18, 2022
Merged

Sample: Showcase 2:1 aspect ratio#386
Canato merged 4 commits into
CanHub:mainfrom
vanniktech:sample-fix-aspect-ratio

Conversation

@vanniktech

Copy link
Copy Markdown
Contributor

Also the previous code did things different than the text shown in the UI

@vanniktech
vanniktech requested a review from a team as a code owner June 16, 2022 11:20

binding.ratio.chipSixteenNine.setOnClickListener {
options = options.copy(ratio = Pair(9, 16))
options = options.copy(ratio = Pair(16, 9))

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.

binding.ratio.chipSixteenNine.setOnClickListener {
options = options.copy(ratio = Pair(9, 16))
options = options.copy(ratio = Pair(16, 9))

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
@Canato

Canato commented Jun 17, 2022

Copy link
Copy Markdown
Member

We can add a new ratio, but 4:3 differ from 16:9
ratio

Comment on lines 99 to +100
when (options.ratio) {
Pair(1, 1) -> binding.ratio.chipOneOne.isChecked = true
Pair(4, 3) -> binding.ratio.chipFourThree.isChecked = true
Pair(2, 1) -> binding.ratio.chipTwoOne.isChecked = true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can add a new one, but let's not remove 4:3

@vanniktech vanniktech changed the title Sample: Use 2:1 aspect ratio as 4:3 is the same as 16:9 Sample: Showcase 2:1 aspect ratio Jun 17, 2022
@Canato

Canato commented Jun 17, 2022

Copy link
Copy Markdown
Member

On another note, we need to update the CHANGELOG

@vanniktech

Copy link
Copy Markdown
Contributor Author

On another note, we need to update the CHANGELOG

With what?

binding.ratio.chipFourThree.setOnClickListener {
options = options.copy(ratio = Pair(16, 9))
options = options.copy(ratio = Pair(4, 3))
}

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
binding.ratio.chipFourThree.setOnClickListener {
options = options.copy(ratio = Pair(16, 9))
options = options.copy(ratio = Pair(4, 3))
}

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
@Canato

Canato commented Jun 17, 2022

Copy link
Copy Markdown
Member

On another note, we need to update the CHANGELOG

With what?

Add ratio 2,1

@vanniktech

Copy link
Copy Markdown
Contributor Author

Will do once the other PR is merged, otherwise I get conflicts in the changelog file

* CropImageOptions: Option to change progress bar color.
@vanniktech
vanniktech requested a review from Canato June 17, 2022 14:54
@Canato
Canato enabled auto-merge (squash) June 17, 2022 15:09

@Canato Canato left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some merge conflicts. Request changes so you get notify

@vanniktech
vanniktech requested a review from Canato June 17, 2022 20:15
@Canato
Canato merged commit 88b468b into CanHub:main Jun 18, 2022
@vanniktech
vanniktech deleted the sample-fix-aspect-ratio branch June 18, 2022 09:50
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.

3 participants