Merge pull request #1296 from alexbakker/shown-entries-bold

Only bold number of shown entries if found in the translated string
This commit is contained in:
Michael Schättgen 2024-03-13 16:39:30 +01:00 committed by GitHub
commit fbd3bf3ff5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -865,8 +865,10 @@ public class EntryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
String entriesShownString = String.format("%d", entriesShown);
int spanStart = entriesShownSpannable.toString().indexOf(entriesShownString);
int spanEnd = spanStart + entriesShownString.length();
entriesShownSpannable.setSpan(new StyleSpan(Typeface.BOLD), spanStart, spanEnd, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
if (spanStart >= 0) {
int spanEnd = spanStart + entriesShownString.length();
entriesShownSpannable.setSpan(new StyleSpan(Typeface.BOLD), spanStart, spanEnd, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
TextView textView = _footerView.findViewById(R.id.entries_shown_count);
textView.setText(entriesShownSpannable);