Settings: Correctly align cursor in Settings
Steps to Reproduce: - Click on Density Settings (DPI Settings) / Renaming BT Device / Renaming SIM Settings - EditText Dialog pops up - The cursor is at the leftmost side of the text - Logically Cursor should be at rightmost side which can be aligned grabbing text length Screenshots: Before: http://imgur.com/a/o4vkr http://imgur.com/a/6Qext After: http://imgur.com/a/fuxqT http://imgur.com/a/vm2WX Bug: 65185652 Test: RunSettingsRoboTests: OK (47 tests) Change-Id: Id00308e7e019434edad4afab56cf4719be0d0d54 Signed-off-by: PMS22 <prathams99@rediff.com>
This commit is contained in:
@@ -116,6 +116,7 @@ abstract class BluetoothNameDialogFragment extends InstrumentedDialogFragment
|
||||
mDeviceNameView.setSelection(deviceName.length());
|
||||
}
|
||||
mDeviceNameView.addTextChangedListener(this);
|
||||
com.android.settings.Utils.setEditTextCursorPosition(mDeviceNameView);
|
||||
mDeviceNameView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
|
@@ -323,6 +323,7 @@ public final class DeviceProfilesSettings extends InstrumentedDialogFragment imp
|
||||
final EditText deviceNameField = (EditText) mRootView.findViewById(R.id.name);
|
||||
if (deviceNameField != null) {
|
||||
deviceNameField.setText(mCachedDevice.getName());
|
||||
com.android.settings.Utils.setEditTextCursorPosition(deviceNameField);
|
||||
}
|
||||
|
||||
refreshProfiles();
|
||||
|
Reference in New Issue
Block a user