Lambda
This commit is contained in:
parent
a9bccdeadd
commit
670ba768c2
|
@ -1233,9 +1233,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
holder.status_action_container.setVisibility(View.GONE);
|
||||
if( holder.status_action_container_twitter != null){
|
||||
holder.status_action_container_twitter.setVisibility(View.VISIBLE);
|
||||
holder.status_action_container_twitter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
holder.status_action_container_twitter.setOnClickListener(v -> {
|
||||
Intent sendIntent = new Intent(Intent.ACTION_SEND);
|
||||
sendIntent.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.shared_via));
|
||||
String url = status.getUrl();
|
||||
|
@ -1256,7 +1254,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
sendIntent.putExtra(Intent.EXTRA_TEXT, extra_text);
|
||||
sendIntent.setType("text/plain");
|
||||
context.startActivity(Intent.createChooser(sendIntent, context.getString(R.string.share_with)));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1321,9 +1318,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
CrossActions.doCrossConversation(context, status);
|
||||
}
|
||||
});
|
||||
holder.main_container.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
holder.main_container.setOnClickListener(v -> {
|
||||
if (type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE && type != RetrieveFeedsAsyncTask.Type.NEWS) {
|
||||
Intent intent = new Intent(context, ShowConversationActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
|
@ -1341,7 +1336,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
if (social != UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE)
|
||||
CrossActions.doCrossConversation(context, status);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1396,7 +1390,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
},
|
||||
0, (acctSpan.length() - 3),
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
SpannableString startingSpan = new SpannableString(starting);
|
||||
SpannableString startingSpan;
|
||||
if (acctReblogSpan != null) {
|
||||
for (URLSpan span : urls)
|
||||
acctReblogSpan.removeSpan(span);
|
||||
|
@ -1488,12 +1482,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
holder.status_show_more_content.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
holder.status_show_more_content.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
holder.status_show_more_content.setOnClickListener(v -> {
|
||||
status.setExpanded(!status.isExpanded());
|
||||
notifyStatusChanged(status);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
@ -1559,9 +1550,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
if (status.isFetchMore()) {
|
||||
holder.fetch_more.setVisibility(View.VISIBLE);
|
||||
holder.fetch_more.setEnabled(true);
|
||||
holder.fetch_more.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
holder.fetch_more.setOnClickListener(view -> {
|
||||
status.setFetchMore(false);
|
||||
holder.fetch_more.setEnabled(false);
|
||||
holder.fetch_more.setVisibility(View.GONE);
|
||||
|
@ -1579,7 +1568,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
} else {
|
||||
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
holder.fetch_more.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
|
@ -2177,9 +2165,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
if (!card.getType().toLowerCase().equals("video") && (display_card || (type == RetrieveFeedsAsyncTask.Type.CONTEXT && viewHolder.getAdapterPosition() == conversationPosition))) {
|
||||
holder.status_cardview.setVisibility(View.VISIBLE);
|
||||
holder.status_cardview_video.setVisibility(View.GONE);
|
||||
holder.status_cardview.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
holder.status_cardview.setOnClickListener(view -> {
|
||||
String url = card.getUrl();
|
||||
boolean nitter = sharedpreferences.getBoolean(Helper.SET_NITTER, false);
|
||||
if (nitter) {
|
||||
|
@ -2191,7 +2177,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
}
|
||||
}
|
||||
Helper.openBrowser(context, url);
|
||||
}
|
||||
});
|
||||
} else if (card.getType().toLowerCase().equals("video") && (display_video_preview || (type == RetrieveFeedsAsyncTask.Type.CONTEXT && viewHolder.getAdapterPosition() == conversationPosition))) {
|
||||
Glide.with(holder.status_cardview_image.getContext())
|
||||
|
@ -2413,9 +2398,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(holder.quick_reply_text.getWindowToken(), 0);
|
||||
}
|
||||
holder.quick_reply_switch_to_full.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
holder.quick_reply_switch_to_full.setOnClickListener(v12 -> {
|
||||
status.setShortReply(false);
|
||||
holder.quick_reply_container.setVisibility(View.GONE);
|
||||
Intent intent = new Intent(context, TootActivity.class);
|
||||
|
@ -2438,7 +2421,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
CrossActions.doCrossReply(context, status, type, true);
|
||||
|
@ -2452,9 +2434,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
});
|
||||
|
||||
|
||||
holder.status_favorite_count.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
holder.status_favorite_count.setOnClickListener(v -> {
|
||||
if (!status.isFavourited() && confirmFav)
|
||||
status.setFavAnimated(true);
|
||||
if (!status.isFavourited() && !confirmFav) {
|
||||
|
@ -2462,7 +2442,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
notifyStatusChanged(status);
|
||||
}
|
||||
CrossActions.doCrossAction(context, type, status, null, (status.isFavourited() || (status.getReblog() != null && status.getReblog().isFavourited())) ? API.StatusAction.UNFAVOURITE : API.StatusAction.FAVOURITE, statusListAdapter, StatusListAdapter.this, true);
|
||||
}
|
||||
});
|
||||
holder.spark_button_fav.setOnClickListener(v -> {
|
||||
if (!status.isFavourited() && confirmFav)
|
||||
|
@ -2523,7 +2502,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
builderInner.setView(input);
|
||||
}
|
||||
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
final EditText finalInput = input;
|
||||
builderInner.setPositiveButton(R.string.yes, (dialog, which) -> {
|
||||
String targetedId = status.getId();
|
||||
new PostActionAsyncTask(context, doAction, targetedId, StatusListAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
|
@ -2714,7 +2692,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
builderInner.setMessage(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
//noinspection deprecation
|
||||
builderInner.setMessage(Html.fromHtml(status.getContent()));
|
||||
break;
|
||||
case R.id.action_block_domain:
|
||||
|
@ -2807,7 +2784,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
content = Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
||||
else
|
||||
//noinspection deprecation
|
||||
content = Html.fromHtml(status.getContent()).toString();
|
||||
ClipData clip = ClipData.newPlainText(Helper.CLIP_BOARD, content);
|
||||
if (clipboard != null) {
|
||||
|
@ -3345,7 +3321,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
|
||||
}
|
||||
|
||||
private int closePanels() {
|
||||
private void closePanels() {
|
||||
int position = -1;
|
||||
if (statuses != null && statuses.size() > 0) {
|
||||
for (Status status : statuses) {
|
||||
|
@ -3357,7 +3333,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
}
|
||||
}
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
private void timedMuteAction(Status status) {
|
||||
|
|
Loading…
Reference in New Issue