mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
Lambda usage simplifications (#1928)
* Replace anonymous type with lambda * Use method reference * Replace with expression lambda
This commit is contained in:
parent
1f8063284c
commit
e8f4a286c5
12 changed files with 57 additions and 110 deletions
|
|
@ -376,17 +376,13 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
|||
final EditText input = new EditText(getActivity());
|
||||
alert.setView(input);
|
||||
input.requestFocus();
|
||||
alert.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
String reason = input.getText().toString();
|
||||
DeleteTask deleteTask = new DeleteTask(getActivity(), media, reason);
|
||||
deleteTask.execute();
|
||||
enableDeleteButton(false);
|
||||
}
|
||||
alert.setPositiveButton(R.string.ok, (dialog, whichButton) -> {
|
||||
String reason = input.getText().toString();
|
||||
DeleteTask deleteTask = new DeleteTask(getActivity(), media, reason);
|
||||
deleteTask.execute();
|
||||
enableDeleteButton(false);
|
||||
});
|
||||
alert.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
}
|
||||
alert.setNegativeButton(R.string.cancel, (dialog, whichButton) -> {
|
||||
});
|
||||
AlertDialog d = alert.create();
|
||||
input.addTextChangedListener(new TextWatcher() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue