From 8306007f846378e479a9b8513abd8d99adc0552f Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Thu, 12 Dec 2013 10:50:01 +1100 Subject: [PATCH] UI tweaks for manage repos. Padding for add repo dialog. Move cursor to end of text input for new repo dialog. --- res/layout/addrepo.xml | 3 ++- src/org/fdroid/fdroid/ManageRepo.java | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/res/layout/addrepo.xml b/res/layout/addrepo.xml index 0638049ee..d428092a2 100644 --- a/res/layout/addrepo.xml +++ b/res/layout/addrepo.xml @@ -2,7 +2,8 @@ + android:orientation="vertical" + android:padding="6dp"> repos = getRepos(); - final Repo repo = getRepoByAddress(newAddress, repos); + final Repo repo = newAddress != null && isImportingRepo ? getRepoByAddress(newAddress, repos) : null; alrt.setIcon(android.R.drawable.ic_menu_add); alrt.setTitle(getString(R.string.repo_add_title)); @@ -350,10 +351,16 @@ public class ManageRepo extends ListActivity { } } - if (newAddress != null) - uriEditText.setText(newAddress); if (newFingerprint != null) fingerprintEditText.setText(newFingerprint); + + if (newAddress != null) { + // This trick of emptying text then appending, + // rather than just setting in the first place, + // is neccesary to move the cursor to the end of the input. + uriEditText.setText(""); + uriEditText.append(newAddress); + } } /** @@ -430,7 +437,7 @@ public class ManageRepo extends ListActivity { } if (text == null) { - text = "https://"; + text = DEFAULT_NEW_REPO_TEXT; } return text; }