mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-01-03 14:40:07 +02:00
Clean code
This commit is contained in:
parent
86f39fb4ee
commit
50f9cb2b7b
1 changed files with 6 additions and 12 deletions
|
@ -896,10 +896,8 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
holder.binding.content.setOnItemClickListener((parent, view, position, id) -> {
|
||||
app.fedilab.android.client.entities.api.Account account = accounts.get(position);
|
||||
String deltaSearch = "";
|
||||
int searchLength = searchDeep;
|
||||
if (currentCursorPosition < searchDeep) { //Less than 15 characters are written before the cursor position
|
||||
searchLength = currentCursorPosition;
|
||||
}
|
||||
//Less than 15 characters are written before the cursor position
|
||||
int searchLength = Math.min(currentCursorPosition, searchDeep);
|
||||
if (currentCursorPosition - searchLength > 0 && currentCursorPosition < oldContent.length())
|
||||
deltaSearch = oldContent.substring(currentCursorPosition - searchLength, currentCursorPosition);
|
||||
else {
|
||||
|
@ -951,10 +949,8 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
return;
|
||||
Tag tag = results.hashtags.get(position);
|
||||
String deltaSearch = "";
|
||||
int searchLength = searchDeep;
|
||||
if (currentCursorPosition < searchDeep) { //Less than 15 characters are written before the cursor position
|
||||
searchLength = currentCursorPosition;
|
||||
}
|
||||
//Less than 15 characters are written before the cursor position
|
||||
int searchLength = Math.min(currentCursorPosition, searchDeep);
|
||||
if (currentCursorPosition - searchLength > 0 && currentCursorPosition < oldContent.length())
|
||||
deltaSearch = oldContent.substring(currentCursorPosition - searchLength, currentCursorPosition);
|
||||
else {
|
||||
|
@ -1011,10 +1007,8 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
holder.binding.content.setOnItemClickListener((parent, view, position, id) -> {
|
||||
String shortcodeSelected = emojisToDisplay.get(position).shortcode;
|
||||
String deltaSearch = "";
|
||||
int searchLength = searchDeep;
|
||||
if (currentCursorPosition < searchDeep) { //Less than 15 characters are written before the cursor position
|
||||
searchLength = currentCursorPosition;
|
||||
}
|
||||
//Less than 15 characters are written before the cursor position
|
||||
int searchLength = Math.min(currentCursorPosition, searchDeep);
|
||||
if (currentCursorPosition - searchLength > 0 && currentCursorPosition < oldContent.length())
|
||||
deltaSearch = oldContent.substring(currentCursorPosition - searchLength, currentCursorPosition);
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue