Skip to content

Commit

Permalink
Merge pull request quran#1848 from quran/revert_highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedre authored Jan 16, 2022
2 parents 6badd0f + e41194f commit a2638ed
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,21 @@ internal class TranslationAdapter(
}

private fun updateHighlight(row: TranslationViewRow, holder: RowViewHolder) {
// toggle highlighting of the ayah number and Quran text only
// toggle highlighting of the ayah, but not for sura headers and basmallah
val isHighlighted = row.ayahInfo.ayahId == highlightedAyah
if (row.type == TranslationViewRow.Type.VERSE_NUMBER ||
row.type == TranslationViewRow.Type.QURAN_TEXT) {
if (row.type != TranslationViewRow.Type.SURA_HEADER &&
row.type != TranslationViewRow.Type.BASMALLAH &&
row.type != TranslationViewRow.Type.SPACER
) {
holder.wrapperView.setBackgroundColor(
if (isHighlighted) ayahSelectionColor else 0
)
} else if (holder.divider != null) { // SPACER type
if (isHighlighted) {
holder.divider.highlight(ayahSelectionColor)
} else {
holder.divider.unhighlight()
}
}
}

Expand Down

0 comments on commit a2638ed

Please sign in to comment.