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