Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Display grayed usage data icon for methods with no usage data
Browse files Browse the repository at this point in the history
Closes #878
  • Loading branch information
M66B committed Dec 28, 2013
1 parent d128849 commit 660db4f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Test and beta releases will have experimental functions enabled by default.
**Next release**

* Notify action for application settings ([issue](https://github.com/M66B/XPrivacy/issues/955))
* Display grayed usage data icon for methods with no usage data ([issue](https://github.com/M66B/XPrivacy/issues/878))

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)

Expand Down
Binary file added res/drawable/used_holo_dark_grayed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable/used_holo_light_grayed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions res/values-v14/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<item name="icon_info">@drawable/info_holo_dark</item>
<item name="icon_internet">@drawable/internet_holo_dark</item>
<item name="icon_used">@drawable/used_holo_dark</item>
<item name="icon_used_grayed">@drawable/used_holo_dark_grayed</item>
<item name="icon_system">@drawable/system_holo_dark</item>
<item name="icon_expander_minimized">@drawable/expander_ic_minimized_holo_dark</item>
<item name="icon_expander_maximized">@drawable/expander_ic_maximized_holo_dark</item>
Expand All @@ -31,6 +32,7 @@
<item name="icon_info">@drawable/info_holo_light</item>
<item name="icon_internet">@drawable/internet_holo_light</item>
<item name="icon_used">@drawable/used_holo_light</item>
<item name="icon_used_grayed">@drawable/used_holo_light_grayed</item>
<item name="icon_system">@drawable/system_holo_light</item>
<item name="icon_expander_minimized">@drawable/expander_ic_minimized_holo_light</item>
<item name="icon_expander_maximized">@drawable/expander_ic_maximized_holo_light</item>
Expand Down
1 change: 1 addition & 0 deletions res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<attr name="icon_info" format="reference" />
<attr name="icon_internet" format="reference" />
<attr name="icon_used" format="reference" />
<attr name="icon_used_grayed" format="reference" />
<attr name="icon_system" format="reference" />
<attr name="icon_user" format="reference" />
<attr name="icon_user_system" format="reference" />
Expand Down
5 changes: 4 additions & 1 deletion src/biz/bokhorst/xprivacy/ActivityApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,10 @@ protected void onPostExecute(Object result) {
holder.ctvMethodName.setText(String.format("%s (%s)", md.getName(), sLastUsage));
}
holder.ctvMethodName.setEnabled(parentRestricted);
holder.imgUsed.setVisibility(lastUsage == 0 ? View.INVISIBLE : View.VISIBLE);
holder.imgUsed.setImageResource(Util.getThemed(ActivityApp.this,
md.hasNoUsageData() ? R.attr.icon_used_grayed : R.attr.icon_used));
holder.imgUsed
.setVisibility(lastUsage == 0 && !md.hasNoUsageData() ? View.INVISIBLE : View.VISIBLE);
holder.ctvMethodName.setTypeface(null, lastUsage == 0 ? Typeface.NORMAL : Typeface.BOLD_ITALIC);
holder.imgGranted.setVisibility(permission ? View.VISIBLE : View.INVISIBLE);
holder.ctvMethodName.setChecked(restricted);
Expand Down
4 changes: 4 additions & 0 deletions src/biz/bokhorst/xprivacy/PrivacyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,10 @@ public boolean isRestartRequired() {
return mRestart;
}

public boolean hasNoUsageData() {
return isRestartRequired();
}

public String[] getPermissions() {
return mPermissions;
}
Expand Down

0 comments on commit 660db4f

Please sign in to comment.