UI tweaks for manage repos.
Padding for add repo dialog. Move cursor to end of text input for new repo dialog.
This commit is contained in:
parent
42d21bcbe9
commit
8306007f84
@ -2,7 +2,8 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical"
|
||||||
|
android:padding="6dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -46,6 +46,7 @@ import java.util.*;
|
|||||||
|
|
||||||
public class ManageRepo extends ListActivity {
|
public class ManageRepo extends ListActivity {
|
||||||
|
|
||||||
|
private static final String DEFAULT_NEW_REPO_TEXT = "https://";
|
||||||
private final int ADD_REPO = 1;
|
private final int ADD_REPO = 1;
|
||||||
private final int UPDATE_REPOS = 2;
|
private final int UPDATE_REPOS = 2;
|
||||||
|
|
||||||
@ -275,7 +276,7 @@ public class ManageRepo extends ListActivity {
|
|||||||
final EditText fingerprintEditText = (EditText) view.findViewById(R.id.edit_fingerprint);
|
final EditText fingerprintEditText = (EditText) view.findViewById(R.id.edit_fingerprint);
|
||||||
|
|
||||||
List<Repo> repos = getRepos();
|
List<Repo> 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.setIcon(android.R.drawable.ic_menu_add);
|
||||||
alrt.setTitle(getString(R.string.repo_add_title));
|
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)
|
if (newFingerprint != null)
|
||||||
fingerprintEditText.setText(newFingerprint);
|
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) {
|
if (text == null) {
|
||||||
text = "https://";
|
text = DEFAULT_NEW_REPO_TEXT;
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user