2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-28 12:47:43 +00:00

Rename updateComputerList -> updateDeviceList

This commit is contained in:
Albert Vaca Cintora 2023-03-22 18:17:17 +01:00
parent e2a35fb97f
commit 7bf2a40180
3 changed files with 14 additions and 14 deletions

View File

@ -80,7 +80,7 @@ public class SendKeystrokesToHostActivity extends AppCompatActivity {
// device is connected and send the text to it without user confirmation, to make sending of // device is connected and send the text to it without user confirmation, to make sending of
// short and safe text like PINs/TANs very fluent // short and safe text like PINs/TANs very fluent
// //
// (contentIsOkay gets used in updateComputerList again) // (contentIsOkay gets used in updateDeviceList again)
if (prefs.getBoolean(getString(R.string.pref_send_safe_text_immediately), true)) { if (prefs.getBoolean(getString(R.string.pref_send_safe_text_immediately), true)) {
SafeTextChecker safeTextChecker = new SafeTextChecker(SAFE_CHARS, MAX_SAFE_LENGTH); SafeTextChecker safeTextChecker = new SafeTextChecker(SAFE_CHARS, MAX_SAFE_LENGTH);
contentIsOkay = safeTextChecker.isSafe(toSend); contentIsOkay = safeTextChecker.isSafe(toSend);
@ -108,11 +108,11 @@ public class SendKeystrokesToHostActivity extends AppCompatActivity {
// subscribe to new connected devices // subscribe to new connected devices
BackgroundService.RunCommand(this, service -> { BackgroundService.RunCommand(this, service -> {
service.onNetworkChange(); service.onNetworkChange();
service.addDeviceListChangedCallback("SendKeystrokesToHostActivity", this::updateComputerList); service.addDeviceListChangedCallback("SendKeystrokesToHostActivity", this::updateDeviceList);
}); });
// list all currently connected devices // list all currently connected devices
updateComputerList(); updateDeviceList();
} else { } else {
Toast.makeText(getApplicationContext(), R.string.sendkeystrokes_wrong_data, Toast.LENGTH_LONG).show(); Toast.makeText(getApplicationContext(), R.string.sendkeystrokes_wrong_data, Toast.LENGTH_LONG).show();
@ -143,7 +143,7 @@ public class SendKeystrokesToHostActivity extends AppCompatActivity {
} }
private void updateComputerList() { private void updateDeviceList() {
BackgroundService.RunCommand(this, service -> { BackgroundService.RunCommand(this, service -> {
Collection<Device> devices = service.getDevices().values(); Collection<Device> devices = service.getDevices().values();

View File

@ -42,15 +42,15 @@ public class ShareActivity extends AppCompatActivity {
@Override @Override
public boolean onOptionsItemSelected(final MenuItem item) { public boolean onOptionsItemSelected(final MenuItem item) {
if (item.getItemId() == R.id.menu_refresh) { if (item.getItemId() == R.id.menu_refresh) {
updateComputerListAction(); updateDeviceListAction();
return true; return true;
} else { } else {
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
} }
private void updateComputerListAction() { private void updateDeviceListAction() {
updateComputerList(); updateDeviceList();
BackgroundService.RunCommand(ShareActivity.this, BackgroundService::onNetworkChange); BackgroundService.RunCommand(ShareActivity.this, BackgroundService::onNetworkChange);
binding.devicesListLayout.refreshListLayout.setRefreshing(true); binding.devicesListLayout.refreshListLayout.setRefreshing(true);
@ -60,7 +60,7 @@ public class ShareActivity extends AppCompatActivity {
}, 1500); }, 1500);
} }
private void updateComputerList() { private void updateDeviceList() {
final Intent intent = getIntent(); final Intent intent = getIntent();
String action = intent.getAction(); String action = intent.getAction();
@ -110,7 +110,7 @@ public class ShareActivity extends AppCompatActivity {
getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true);
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
binding.devicesListLayout.refreshListLayout.setOnRefreshListener(this::updateComputerListAction); binding.devicesListLayout.refreshListLayout.setOnRefreshListener(this::updateDeviceListAction);
if (actionBar != null) { if (actionBar != null) {
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM);
} }
@ -131,9 +131,9 @@ public class ShareActivity extends AppCompatActivity {
} else { } else {
BackgroundService.RunCommand(this, service -> { BackgroundService.RunCommand(this, service -> {
service.onNetworkChange(); service.onNetworkChange();
service.addDeviceListChangedCallback("ShareActivity", this::updateComputerList); service.addDeviceListChangedCallback("ShareActivity", this::updateDeviceList);
}); });
updateComputerList(); updateDeviceList();
} }
} }

View File

@ -79,7 +79,7 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
pairingExplanationTextBinding = PairingExplanationTextBinding.inflate(inflater); pairingExplanationTextBinding = PairingExplanationTextBinding.inflate(inflater);
pairingExplanationTextNoWifiBinding = PairingExplanationTextNoWifiBinding.inflate(inflater); pairingExplanationTextNoWifiBinding = PairingExplanationTextNoWifiBinding.inflate(inflater);
devicesListBinding.refreshListLayout.setOnRefreshListener(this::updateComputerListAction); devicesListBinding.refreshListLayout.setOnRefreshListener(this::updateDeviceListAction);
notTrustedText = pairingExplanationNotTrustedBinding.getRoot(); notTrustedText = pairingExplanationNotTrustedBinding.getRoot();
notTrustedText.setOnClickListener(null); notTrustedText.setOnClickListener(null);
@ -135,7 +135,7 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
mActivity = ((MainActivity) getActivity()); mActivity = ((MainActivity) getActivity());
} }
private void updateComputerListAction() { private void updateDeviceListAction() {
updateDeviceList(); updateDeviceList();
BackgroundService.RunCommand(mActivity, BackgroundService::onNetworkChange); BackgroundService.RunCommand(mActivity, BackgroundService::onNetworkChange);
devicesListBinding.refreshListLayout.setRefreshing(true); devicesListBinding.refreshListLayout.setRefreshing(true);
@ -294,7 +294,7 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
public boolean onOptionsItemSelected(final MenuItem item) { public boolean onOptionsItemSelected(final MenuItem item) {
int id = item.getItemId(); int id = item.getItemId();
if (id == R.id.menu_refresh) { if (id == R.id.menu_refresh) {
updateComputerListAction(); updateDeviceListAction();
return true; return true;
} else if (id == R.id.menu_custom_device_list) { } else if (id == R.id.menu_custom_device_list) {
startActivity(new Intent(mActivity, CustomDevicesActivity.class)); startActivity(new Intent(mActivity, CustomDevicesActivity.class));