Merge branch 'add-repo-url' into 'master'

Enhancement : Repo URL added to apk's on AppDetailsActivity.

Fixes issue #527.
Adds repo URL to apk's present on AppDetails.

Samples  
![sample](/uploads/0d603cf7242f6f45348c78009f811623/sample.png)![sampl2](/uploads/31efab104bd52cecc9f2ea1e923116c6/sampl2.png)

See merge request !222
This commit is contained in:
Daniel Martí 2016-03-05 21:50:48 +00:00
commit 3c33e55fd3
3 changed files with 17 additions and 2 deletions

View File

@ -29,11 +29,20 @@
android:layout_width="wrap_content"
tools:text="Installed" />
<LinearLayout
<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
android:id="@+id/container_added_nativecode"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/status"
android:layout_below="@id/repository"
android:orientation="horizontal">
<TextView android:id="@+id/added"

View File

@ -96,6 +96,7 @@
<string name="bad_fingerprint">Bad fingerprint</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="repo_provider">Repository: %s</string>
<string name="menu_update_repo">Update Repos</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 {
TextView version;
TextView status;
TextView repository;
TextView size;
TextView api;
TextView incompatibleReasons;
@ -217,6 +218,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
holder = new ViewHolder();
holder.version = (TextView) convertView.findViewById(R.id.version);
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.api = (TextView) convertView.findViewById(R.id.api);
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.repository.setText(getString(R.string.repo_provider,
RepoProvider.Helper.findById(getContext(), apk.repo).getName()));
if (apk.size > 0) {
holder.size.setText(Utils.getFriendlySize(apk.size));
holder.size.setVisibility(View.VISIBLE);