2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 21:55:10 +00:00

Do not allow multi-line device names

This commit is contained in:
Albert Vaca Cintora
2023-05-30 00:34:09 +02:00
parent f00e420535
commit 28ed8209c4

View File

@@ -10,6 +10,7 @@ import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -51,6 +52,7 @@ public class SettingsFragment extends PreferenceFragmentCompat {
renameDevice = new EditTextPreference(context);
renameDevice.setKey(DeviceHelper.KEY_DEVICE_NAME_PREFERENCE);
renameDevice.setSelectable(true);
renameDevice.setOnBindEditTextListener(TextView::setSingleLine);
String deviceName = DeviceHelper.getDeviceName(context);
renameDevice.setTitle(R.string.settings_rename);
renameDevice.setSummary(deviceName);