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>
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 89724cc..3b2ea1a 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -103,6 +103,7 @@
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
+import android.widget.EditText;
import android.widget.ListView;
import android.widget.TabWidget;
@@ -1362,4 +1363,7 @@
&& volume.isMountedReadable();
}
+ public static void setEditTextCursorPosition(EditText editText) {
+ editText.setSelection(editText.getText().length());
+ }
}