display mirrors in RepoDetailsActivity
This is rough, but better than nothing.
This commit is contained in:
parent
b3d90cd1b6
commit
759c3b90fc
@ -108,12 +108,18 @@ public class RepoDetailsActivity extends ActionBarActivity {
|
|||||||
RepoTable.Cols.NAME,
|
RepoTable.Cols.NAME,
|
||||||
RepoTable.Cols.ADDRESS,
|
RepoTable.Cols.ADDRESS,
|
||||||
RepoTable.Cols.FINGERPRINT,
|
RepoTable.Cols.FINGERPRINT,
|
||||||
|
RepoTable.Cols.MIRRORS,
|
||||||
};
|
};
|
||||||
repo = RepoProvider.Helper.findById(this, repoId, projection);
|
repo = RepoProvider.Helper.findById(this, repoId, projection);
|
||||||
|
|
||||||
TextView inputUrl = (TextView) findViewById(R.id.input_repo_url);
|
TextView inputUrl = (TextView) findViewById(R.id.input_repo_url);
|
||||||
inputUrl.setText(repo.address);
|
inputUrl.setText(repo.address);
|
||||||
|
|
||||||
|
if (repo.address.startsWith("content://")) {
|
||||||
|
// no need to show a QR Code, it is not shareable
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Uri uri = Uri.parse(repo.address);
|
Uri uri = Uri.parse(repo.address);
|
||||||
uri = uri.buildUpon().appendQueryParameter("fingerprint", repo.fingerprint).build();
|
uri = uri.buildUpon().appendQueryParameter("fingerprint", repo.fingerprint).build();
|
||||||
String qrUriString = uri.toString();
|
String qrUriString = uri.toString();
|
||||||
@ -321,6 +327,20 @@ public class RepoDetailsActivity extends ActionBarActivity {
|
|||||||
TextView numApps = (TextView) repoView.findViewById(R.id.text_num_apps);
|
TextView numApps = (TextView) repoView.findViewById(R.id.text_num_apps);
|
||||||
TextView lastUpdated = (TextView) repoView.findViewById(R.id.text_last_update);
|
TextView lastUpdated = (TextView) repoView.findViewById(R.id.text_last_update);
|
||||||
|
|
||||||
|
if (repo.mirrors != null) {
|
||||||
|
TextView officialMirrorsLabel = (TextView) repoView.findViewById(R.id.label_official_mirrors);
|
||||||
|
officialMirrorsLabel.setVisibility(View.VISIBLE);
|
||||||
|
TextView officialMirrorsText = (TextView) repoView.findViewById(R.id.text_official_mirrors);
|
||||||
|
officialMirrorsText.setVisibility(View.VISIBLE);
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String url : repo.mirrors) {
|
||||||
|
builder.append("◦ ");
|
||||||
|
builder.append(url);
|
||||||
|
builder.append('\n');
|
||||||
|
}
|
||||||
|
officialMirrorsText.setText(builder.toString());
|
||||||
|
}
|
||||||
|
|
||||||
name.setText(repo.name);
|
name.setText(repo.name);
|
||||||
|
|
||||||
int appCount = RepoProvider.Helper.countAppsForRepo(this, repoId);
|
int appCount = RepoProvider.Helper.countAppsForRepo(this, repoId);
|
||||||
|
@ -71,6 +71,30 @@
|
|||||||
android:id="@+id/text_last_update"
|
android:id="@+id/text_last_update"
|
||||||
style="@style/BodyText" />
|
style="@style/BodyText" />
|
||||||
|
|
||||||
|
<!-- mirrors included in the index -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/label_official_mirrors"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:text="@string/repo_official_mirrors"
|
||||||
|
style="@style/CaptionText" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_official_mirrors"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
style="@style/CaptionText" />
|
||||||
|
|
||||||
|
<!-- mirrors added by the user -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/label_user_mirrors"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:text="@string/repo_user_mirrors"
|
||||||
|
style="@style/CaptionText" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_user_mirrors"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
style="@style/CaptionText" />
|
||||||
|
|
||||||
<!-- The credentials used to access this repo (optional) -->
|
<!-- The credentials used to access this repo (optional) -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/label_username"
|
android:id="@+id/label_username"
|
||||||
|
@ -307,6 +307,8 @@ This often occurs with apps installed via Google Play or other sources, if they
|
|||||||
<string name="repo_fingerprint">Fingerprint of the signing key (SHA-256)</string>
|
<string name="repo_fingerprint">Fingerprint of the signing key (SHA-256)</string>
|
||||||
<string name="repo_description">Description</string>
|
<string name="repo_description">Description</string>
|
||||||
<string name="repo_last_update">Last update</string>
|
<string name="repo_last_update">Last update</string>
|
||||||
|
<string name="repo_official_mirrors">Official mirrors</string>
|
||||||
|
<string name="repo_user_mirrors">User mirrors</string>
|
||||||
<string name="repo_name">Name</string>
|
<string name="repo_name">Name</string>
|
||||||
<string name="unsigned_description">This means that the list of
|
<string name="unsigned_description">This means that the list of
|
||||||
apps could not be verified. You should be careful
|
apps could not be verified. You should be careful
|
||||||
|
Loading…
x
Reference in New Issue
Block a user