Skip to content

Commit

Permalink
Change note to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
meiron03 committed Apr 18, 2024
1 parent fd99524 commit 44000d8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class HomeAdapter(private val dataModel: HomepageDataModel) :
private const val POST = 7
private const val FEATURE = 8
private const val POLL = 9

private const val DRAFT_NOTE = " (NOTE: THIS IS A DRAFT THAT USERS CANNOT SEE)"
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
Expand Down Expand Up @@ -356,7 +358,7 @@ class HomeAdapter(private val dataModel: HomepageDataModel) :
if (cell.post.status == Post.DRAFT) {
holder.itemView.home_post_title.setTextColor(Color.parseColor("#ffb300"))

val draftSubtitle = post.subtitle + " (NOTE: THIS IS A DRAFT THAT USERS CANNOT SEE)"
val draftSubtitle = post.subtitle + DRAFT_NOTE
holder.itemView.home_post_subtitle.text = draftSubtitle
} else {
holder.itemView.home_post_subtitle.text = post.subtitle
Expand Down Expand Up @@ -447,7 +449,7 @@ class HomeAdapter(private val dataModel: HomepageDataModel) :
// if the post is a draft, then change the color and add a note
if (poll.status == Poll.DRAFT) {
holder.itemView.home_card_title.setTextColor(Color.parseColor("#ffb300"))
val draftQuestion = poll.question + " (NOTE: THIS IS A DRAFT THAT USERS CANNOT SEE)"
val draftQuestion = poll.question + DRAFT_NOTE
holder.itemView.home_card_title?.text = draftQuestion
} else {
holder.itemView.home_card_title?.text = poll.question
Expand Down

0 comments on commit 44000d8

Please sign in to comment.