-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feed: improve binding and introduce StoryCard
- Loading branch information
1 parent
ee08fee
commit feee0e8
Showing
3 changed files
with
69 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/src/main/java/ua/itaysonlab/homefeeder/overlay/feed/binders/StoryCardBinder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package ua.itaysonlab.homefeeder.overlay.feed.binders | ||
|
||
import android.text.Html | ||
import android.util.SparseIntArray | ||
import android.view.View | ||
import coil.api.load | ||
import kotlinx.android.synthetic.main.feed_card_story_large.view.* | ||
import ua.itaysonlab.hfsdk.FeedItem | ||
import ua.itaysonlab.hfsdk.content.StoryCardContent | ||
|
||
object StoryCardBinder: FeedBinder { | ||
override fun bind(theme: SparseIntArray?, item: FeedItem, view: View) { | ||
val content = item.content as StoryCardContent | ||
|
||
view.story_title.text = content.title | ||
view.story_source.text = content.source.title | ||
view.story_desc.text = Html.fromHtml(content.text) | ||
|
||
view.story_pic.load(content.background_url) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters