diff options
Diffstat (limited to 'main/src/cgeo/geocaching/ui/dialog/Dialogs.java')
| -rw-r--r-- | main/src/cgeo/geocaching/ui/dialog/Dialogs.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/ui/dialog/Dialogs.java b/main/src/cgeo/geocaching/ui/dialog/Dialogs.java index 4f6de39..cbd5c94 100644 --- a/main/src/cgeo/geocaching/ui/dialog/Dialogs.java +++ b/main/src/cgeo/geocaching/ui/dialog/Dialogs.java @@ -4,6 +4,7 @@ import cgeo.geocaching.CgeoApplication; import org.apache.commons.lang3.StringUtils; import org.eclipse.jdt.annotation.Nullable; + import rx.util.functions.Action1; import android.app.Activity; @@ -298,7 +299,7 @@ public final class Dialogs { /** * Show a message dialog for input from the user. The okay button is only enabled on non empty input. - * + * * @param context * activity owning the dialog * @param title @@ -357,8 +358,16 @@ public final class Dialogs { dialog.show(); enableDialogButtonIfNotEmpty(dialog, defaultValue); - // position cursor after text - input.setSelection(input.getText().length()); + moveCursorToEnd(input); + } + + /** + * Move the cursor to the end of the input field. + * + * @param input + */ + public static void moveCursorToEnd(final EditText input) { + input.setSelection(input.getText().length(), input.getText().length()); } private static void enableDialogButtonIfNotEmpty(final AlertDialog dialog, final String input) { |
