Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert only highlight the ayah in translation #1848

Merged
merged 1 commit into from
Jan 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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