diff --git a/CHANGELOG.md b/CHANGELOG.md index d2397e97a..558f820e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Changelog * Restrict all *view* actions, show parameters and whitelisting ([issue](/../../issues/1419)) * You might see a few more messages *Restricted by XPrivacy* because of this +* Improved usage data layout, option to copy parameters ([issue](/../../issues/1424)) [Open issues](https://github.com/M66B/XPrivacy/issues?state=open) diff --git a/res/layout/usageentry.xml b/res/layout/usageentry.xml index 50a95eef1..c3cb0c974 100644 --- a/res/layout/usageentry.xml +++ b/res/layout/usageentry.xml @@ -37,13 +37,30 @@ android:textAppearance="?android:attr/textAppearanceSmall" android:textIsSelectable="false" /> - + android:orientation="vertical" > + + + + + \ No newline at end of file diff --git a/src/biz/bokhorst/xprivacy/ActivityUsage.java b/src/biz/bokhorst/xprivacy/ActivityUsage.java index 15406a9d0..692cd5c24 100644 --- a/src/biz/bokhorst/xprivacy/ActivityUsage.java +++ b/src/biz/bokhorst/xprivacy/ActivityUsage.java @@ -18,6 +18,7 @@ import android.os.Bundle; import android.support.v4.app.NavUtils; import android.support.v4.app.TaskStackBuilder; +import android.text.TextUtils; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -227,6 +228,7 @@ private class ViewHolder { public ImageView imgRestricted; public TextView tvApp; public TextView tvRestriction; + public TextView tvParameter; public ViewHolder(View theRow, int thePosition) { row = theRow; @@ -236,6 +238,7 @@ public ViewHolder(View theRow, int thePosition) { imgRestricted = (ImageView) row.findViewById(R.id.imgRestricted); tvApp = (TextView) row.findViewById(R.id.tvApp); tvRestriction = (TextView) row.findViewById(R.id.tvRestriction); + tvParameter = (TextView) row.findViewById(R.id.tvParameter); } } @@ -299,11 +302,12 @@ public View getView(int position, View convertView, ViewGroup parent) { holder.imgIcon.setVisibility(View.INVISIBLE); holder.imgRestricted.setVisibility(usageData.restricted ? View.VISIBLE : View.INVISIBLE); holder.tvApp.setText(Integer.toString(usageData.uid)); - if (usageData.extra == null || !mHasProLicense) - holder.tvRestriction.setText(String.format("%s/%s", usageData.restrictionName, usageData.methodName)); - else - holder.tvRestriction.setText(String.format("%s/%s(%s)", usageData.restrictionName, - usageData.methodName, usageData.extra)); + holder.tvRestriction.setText(String.format("%s/%s", usageData.restrictionName, usageData.methodName)); + if (!TextUtils.isEmpty(usageData.extra) && mHasProLicense) { + holder.tvParameter.setText(usageData.extra); + holder.tvParameter.setVisibility(View.VISIBLE); + } else + holder.tvParameter.setVisibility(View.GONE); // Async update new HolderTask(position, holder, usageData).executeOnExecutor(mExecutor, (Object) null);