textDrawable #136

Merged
AmineB merged 8 commits from davidoskky/ReaderForSelfoss-multiplatform:textDrawable into master 2023-03-26 11:12:03 +00:00
Contributor

Types of changes

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This is NOT translation related.

This closes issue #120

Removed the dependency com.amulyakhare.textdrawable and slightly simplified the logic required to set circular images.

## Types of changes - [x] I have read the **CONTRIBUTING** document. - [x] My code follows the code style of this project. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [x] All new and existing tests passed. - [x] This is **NOT** translation related. This closes issue #120 Removed the dependency `com.amulyakhare.textdrawable` and slightly simplified the logic required to set circular images.
davidoskky added 7 commits 2023-03-25 15:45:57 +00:00
AmineB requested changes 2023-03-25 20:49:27 +00:00
AmineB left a comment
Owner

Just a little cleaning, and this can be merged.

Just a little cleaning, and this can be merged.
@ -91,3 +83,1 @@
.round()
.build(itm.title.getHtmlDecoded().toTextDrawableString(), color)
binding.sourceImage.setImageDrawable(drawable)
binding.sourceImage.setBackgroundAndText(itm.title.getHtmlDecoded(), itm.title.getHtmlDecoded().toTextDrawableString())
Owner

You could call setBackgroundAndText with a single parameter, and call toTextDrawableString inside.

Also, here, there is an issue, it should be itm.sourcetitle that should be used.

                binding.sourceImage.setBackgroundAndText(itm.sourcetitle.getHtmlDecoded()) 
You could call `setBackgroundAndText` with a single parameter, and call `toTextDrawableString` inside. Also, here, there is an issue, it should be `itm.sourcetitle` that should be used. ``` binding.sourceImage.setBackgroundAndText(itm.sourcetitle.getHtmlDecoded()) ```
AmineB marked this conversation as resolved
@ -65,3 +55,1 @@
.build(itm.title.getHtmlDecoded().toTextDrawableString(), color)
binding.itemImage.setImageDrawable(drawable)
binding.itemImage.setBackgroundAndText(itm.title.getHtmlDecoded(), itm.title.getHtmlDecoded().toTextDrawableString())
Owner

Same as before:

                binding.itemImage.setBackgroundAndText(itm.sourcetitle.getHtmlDecoded()) 
Same as before: ``` binding.itemImage.setBackgroundAndText(itm.sourcetitle.getHtmlDecoded()) ```
AmineB marked this conversation as resolved
@ -0,0 +20,4 @@
val imageView: ShapeableImageView
val textView: TextView
private val colorScheme = listOf(
Owner

Why introduce a new way to handle colors, instead of using the color generator that was used previously ?

Why introduce a new way to handle colors, instead of using the color generator that was used previously ?
Author
Contributor

The color generator was provided by the library we're removing. I simply copied the relevant part of the code from there.

The color generator was provided by the library we're removing. I simply copied the relevant part of the code from there.
AmineB marked this conversation as resolved
davidoskky force-pushed textDrawable from ea6261c975 to 10ab67d071 2023-03-25 21:02:53 +00:00 Compare
Author
Contributor

Alright, this should do.

Alright, this should do.
AmineB approved these changes 2023-03-26 11:11:23 +00:00
AmineB merged commit 8d7d3174aa into master 2023-03-26 11:12:03 +00:00
davidoskky deleted branch textDrawable 2023-03-26 12:59:36 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Louvorg/ReaderForSelfoss-multiplatform#136
No description provided.