mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-31 06:05:12 +00:00
Make linter happy: use lambdas
This commit is contained in:
@@ -90,9 +90,9 @@ public class BigscreenActivity extends AppCompatActivity {
|
||||
.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
|
||||
if (result.get(0) != null) {
|
||||
final String deviceId = getIntent().getStringExtra("deviceId");
|
||||
BackgroundService.RunWithPlugin(this, deviceId, BigscreenPlugin.class, plugin -> runOnUiThread(() -> {
|
||||
plugin.sendSTT(result.get(0));
|
||||
}));
|
||||
BackgroundService.RunWithPlugin(this, deviceId, BigscreenPlugin.class, plugin ->
|
||||
runOnUiThread(() -> plugin.sendSTT(result.get(0)))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -10,13 +10,11 @@ package org.kde.kdeconnect.Plugins.MousePadPlugin;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
@@ -50,21 +48,17 @@ public class ComposeSendActivity extends AppCompatActivity {
|
||||
EditText editText = findViewById(R.id.compose);
|
||||
|
||||
editText.requestFocus();
|
||||
editText.setOnEditorActionListener(new EditText.OnEditorActionListener() {
|
||||
@Override
|
||||
|
||||
// this is almost never used
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEND) {
|
||||
sendComposed();
|
||||
return true;
|
||||
}
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
clear();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
// this is almost never used
|
||||
editText.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEND) {
|
||||
sendComposed();
|
||||
return true;
|
||||
}
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
clear();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,6 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CheckedTextView;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ListView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
@@ -140,12 +139,9 @@ public class NotificationFilterActivity extends AppCompatActivity {
|
||||
smScreenOffNotification.setChecked(
|
||||
sharedPreferences.getBoolean(getString(NotificationsPlugin.PREF_NOTIFICATION_SCREEN_OFF),false)
|
||||
);
|
||||
smScreenOffNotification.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
sharedPreferences.edit().putBoolean(getString(NotificationsPlugin.PREF_NOTIFICATION_SCREEN_OFF),isChecked).apply();
|
||||
}
|
||||
});
|
||||
smScreenOffNotification.setOnCheckedChangeListener((buttonView, isChecked) ->
|
||||
sharedPreferences.edit().putBoolean(getString(NotificationsPlugin.PREF_NOTIFICATION_SCREEN_OFF),isChecked).apply()
|
||||
);
|
||||
}
|
||||
|
||||
private void displayAppList() {
|
||||
|
Reference in New Issue
Block a user