Simplification

pull/208/head
M66B 2 years ago
parent a690c1fabb
commit 8a32f70378

@ -7112,7 +7112,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
// Scroll to found text // Scroll to found text
if (pos >= 0) { if (pos >= 0) {
int color = Helper.resolveColor(searchView.getContext(), R.attr.colorHighlight); Context context = searchView.getContext();
int color = Helper.resolveColor(context, R.attr.colorHighlight);
SpannableString ss = new SpannableString(searchView.getText()); SpannableString ss = new SpannableString(searchView.getText());
ss.setSpan(new BackgroundColorSpan(color), ss.setSpan(new BackgroundColorSpan(color),
pos, pos + query.length(), Spannable.SPAN_COMPOSING); pos, pos + query.length(), Spannable.SPAN_COMPOSING);
@ -7124,8 +7125,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (layout != null) { if (layout != null) {
int line = layout.getLineForOffset(pos); int line = layout.getLineForOffset(pos);
int y = layout.getLineTop(line); int y = layout.getLineTop(line);
int dy = searchView.getContext().getResources() int dy = context.getResources().getDimensionPixelSize(R.dimen.search_in_text_margin);
.getDimensionPixelSize(R.dimen.search_in_text_margin);
View itemView = rvMessage.findContainingItemView(searchView); View itemView = rvMessage.findContainingItemView(searchView);
if (itemView != null) { if (itemView != null) {

Loading…
Cancel
Save