Fix issue #955 - Focus the clicked messages and allow selections for remote conversations

This commit is contained in:
Thomas 2023-09-04 17:17:15 +02:00
parent 95e4952012
commit 5f3ca62393
2 changed files with 16 additions and 0 deletions

View file

@ -2041,6 +2041,18 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
Toasty.info(context, context.getString(R.string.toast_error_search), Toasty.LENGTH_SHORT).show(); Toasty.info(context, context.getString(R.string.toast_error_search), Toasty.LENGTH_SHORT).show();
} }
}); });
} else if (context instanceof ContextActivity) {
int position = 0;
for (Status _status : statusList) {
if (_status.isFocused) {
_status.isFocused = false;
adapter.notifyItemChanged(position);
} else if (statusToDeal.equals(_status)) {
_status.isFocused = true;
adapter.notifyItemChanged(position);
}
position++;
}
} }
} else { } else {
Intent intent = new Intent(context, ContextActivity.class); Intent intent = new Intent(context, ContextActivity.class);

View file

@ -280,6 +280,10 @@ public class FragmentMastodonContext extends Fragment {
} }
if (found) { if (found) {
binding.recyclerView.scrollToPosition(position); binding.recyclerView.scrollToPosition(position);
statuses.get(0).isFocused = false;
statuses.get(position).isFocused = true;
statusAdapter.notifyItemChanged(0);
statusAdapter.notifyItemChanged(position);
} }
} }
} }