mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-14 06:22:50 +01:00
Ignore case when searching comments.
This commit is contained in:
parent
4f9bd0cde0
commit
200f5839ff
@ -770,14 +770,15 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
|||||||
if (visibleComments != null) {
|
if (visibleComments != null) {
|
||||||
if (searchNextComment) {
|
if (searchNextComment) {
|
||||||
for (int i = currentSearchIndex + 1; i < visibleComments.size(); i++) {
|
for (int i = currentSearchIndex + 1; i < visibleComments.size(); i++) {
|
||||||
if (visibleComments.get(i).getCommentRawText() != null && visibleComments.get(i).getCommentRawText().contains(query)) {
|
if (visibleComments.get(i).getCommentRawText() != null &&
|
||||||
|
visibleComments.get(i).getCommentRawText().toLowerCase().contains(query.toLowerCase())) {
|
||||||
if (mCommentsAdapter != null) {
|
if (mCommentsAdapter != null) {
|
||||||
mCommentsAdapter.highlightSearchResult(i);
|
mCommentsAdapter.highlightSearchResult(i);
|
||||||
mCommentsAdapter.notifyItemChanged(i);
|
mCommentsAdapter.notifyItemChanged(i);
|
||||||
if (mCommentsRecyclerView == null) {
|
if (mCommentsRecyclerView == null) {
|
||||||
mRecyclerView.smoothScrollToPosition(i + 1);
|
mRecyclerView.scrollToPosition(i + 1);
|
||||||
} else {
|
} else {
|
||||||
mCommentsRecyclerView.smoothScrollToPosition(i);
|
mCommentsRecyclerView.scrollToPosition(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -787,14 +788,15 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
for (int i = currentSearchIndex - 1; i >= 0; i--) {
|
for (int i = currentSearchIndex - 1; i >= 0; i--) {
|
||||||
if (visibleComments.get(i).getCommentRawText() !=null && visibleComments.get(i).getCommentRawText().contains(query)) {
|
if (visibleComments.get(i).getCommentRawText() !=null &&
|
||||||
|
visibleComments.get(i).getCommentRawText().toLowerCase().contains(query.toLowerCase())) {
|
||||||
if (mCommentsAdapter != null) {
|
if (mCommentsAdapter != null) {
|
||||||
mCommentsAdapter.highlightSearchResult(i);
|
mCommentsAdapter.highlightSearchResult(i);
|
||||||
mCommentsAdapter.notifyItemChanged(i);
|
mCommentsAdapter.notifyItemChanged(i);
|
||||||
if (mCommentsRecyclerView == null) {
|
if (mCommentsRecyclerView == null) {
|
||||||
mRecyclerView.smoothScrollToPosition(i + 1);
|
mRecyclerView.scrollToPosition(i + 1);
|
||||||
} else {
|
} else {
|
||||||
mCommentsRecyclerView.smoothScrollToPosition(i);
|
mCommentsRecyclerView.scrollToPosition(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -78,7 +78,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="?attr/font_family"
|
android:fontFamily="?attr/font_family"
|
||||||
android:textSize="?attr/font_default"
|
android:textSize="?attr/font_default"
|
||||||
android:hint="@string/search_comments" />
|
android:hint="@string/search_comments"
|
||||||
|
android:maxLines="1" />
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user