Enhancement|UI : Repository URL added to APK's on AppDetails Activity.

Fixes issue #527.
Repository URL's now shown as Provided By domain.name/repo
This commit is contained in:
Paresh Chouhan 2016-03-05 01:09:21 +05:30
parent 018a8231d6
commit 683ba8d20f
3 changed files with 17 additions and 2 deletions

View File

@ -29,11 +29,20 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
tools:text="Installed" /> tools:text="Installed" />
<TextView android:id="@+id/repository"
android:textSize="13sp"
android:singleLine="true"
android:ellipsize="end"
android:layout_below="@id/status"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
tools:text="Provided By F-Droid archive" />
<LinearLayout <LinearLayout
android:id="@+id/container_added_nativecode" android:id="@+id/container_added_nativecode"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:layout_below="@id/status" android:layout_below="@id/repository"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView android:id="@+id/added" <TextView android:id="@+id/added"

View File

@ -96,6 +96,7 @@
<string name="bad_fingerprint">Bad fingerprint</string> <string name="bad_fingerprint">Bad fingerprint</string>
<string name="invalid_url">This is not a valid URL.</string> <string name="invalid_url">This is not a valid URL.</string>
<string name="malformed_repo_uri">Ignoring malformed repo URI: %s</string> <string name="malformed_repo_uri">Ignoring malformed repo URI: %s</string>
<string name="repo_provider">Repository: %s</string>
<string name="menu_update_repo">Update Repos</string> <string name="menu_update_repo">Update Repos</string>
<string name="menu_manage">Repositories</string> <string name="menu_manage">Repositories</string>

View File

@ -135,6 +135,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
private static class ViewHolder { private static class ViewHolder {
TextView version; TextView version;
TextView status; TextView status;
TextView repository;
TextView size; TextView size;
TextView api; TextView api;
TextView incompatibleReasons; TextView incompatibleReasons;
@ -217,6 +218,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
holder = new ViewHolder(); holder = new ViewHolder();
holder.version = (TextView) convertView.findViewById(R.id.version); holder.version = (TextView) convertView.findViewById(R.id.version);
holder.status = (TextView) convertView.findViewById(R.id.status); holder.status = (TextView) convertView.findViewById(R.id.status);
holder.repository = (TextView) convertView.findViewById(R.id.repository);
holder.size = (TextView) convertView.findViewById(R.id.size); holder.size = (TextView) convertView.findViewById(R.id.size);
holder.api = (TextView) convertView.findViewById(R.id.api); holder.api = (TextView) convertView.findViewById(R.id.api);
holder.incompatibleReasons = (TextView) convertView.findViewById(R.id.incompatible_reasons); holder.incompatibleReasons = (TextView) convertView.findViewById(R.id.incompatible_reasons);
@ -235,6 +237,9 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
holder.status.setText(getInstalledStatus(apk)); holder.status.setText(getInstalledStatus(apk));
holder.repository.setText(getString(R.string.repo_provider,
RepoProvider.Helper.findById(getContext(), apk.repo).getName()));
if (apk.size > 0) { if (apk.size > 0) {
holder.size.setText(Utils.getFriendlySize(apk.size)); holder.size.setText(Utils.getFriendlySize(apk.size));
holder.size.setVisibility(View.VISIBLE); holder.size.setVisibility(View.VISIBLE);