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:
PMS22
2017-06-14 07:10:15 +00:00
committed by Doris Ling
parent 3e6488448c
commit 63a0560a6c
6 changed files with 25 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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();