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

Commit

Permalink
Show unsafe icon in template
Browse files Browse the repository at this point in the history
Refs #1827
  • Loading branch information
M66B committed Aug 16, 2014
1 parent 842c340 commit 6e618b1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions res/layout/templateentry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
android:paddingLeft="3dip"
android:textAppearance="?android:attr/textAppearanceSmall" />

<ImageView
android:id="@+id/imgUnsafe"
android:layout_width="32dip"
android:layout_height="32dip"
android:contentDescription="@string/title_unsafe"
android:paddingLeft="3dip"
android:src="?attr/icon_unsafe"
android:visibility="gone" />

<ImageView
android:id="@+id/imgCbRestrict"
android:layout_width="32dip"
Expand Down
3 changes: 0 additions & 3 deletions src/biz/bokhorst/xprivacy/ActivityApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,6 @@ public void onClick(View view) {
else if (extras.getInt(cAction) == cActionSettings)
optionSettings();
}

// Annotate
Meta.annotate(this.getResources());
}

@Override
Expand Down
7 changes: 7 additions & 0 deletions src/biz/bokhorst/xprivacy/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ protected void onCreate(Bundle savedInstanceState) {
if (Util.hasProLicense(this) != null)
setTitle(String.format("%s - %s", getString(R.string.app_name), getString(R.string.menu_pro)));

// Annotate
Meta.annotate(this.getResources());

// Get localized restriction name
List<String> listRestrictionName = new ArrayList<String>(PrivacyManager.getRestrictions(this).navigableKeySet());
listRestrictionName.add(0, getString(R.string.menu_all));
Expand Down Expand Up @@ -1212,6 +1215,7 @@ private class ViewHolder {
public ImageView imgIndicator;
public ImageView imgInfo;
public TextView tvRestriction;
public ImageView imgUnsafe;
public ImageView imgCbRestrict;
public ImageView imgCbAsk;
public boolean restricted;
Expand All @@ -1222,6 +1226,7 @@ public ViewHolder(View theRow) {
imgIndicator = (ImageView) row.findViewById(R.id.imgIndicator);
imgInfo = (ImageView) row.findViewById(R.id.imgInfo);
tvRestriction = (TextView) row.findViewById(R.id.tvRestriction);
imgUnsafe = (ImageView) row.findViewById(R.id.imgUnsafe);
imgCbRestrict = (ImageView) row.findViewById(R.id.imgCbRestrict);
imgCbAsk = (ImageView) row.findViewById(R.id.imgCbAsk);
}
Expand Down Expand Up @@ -1288,6 +1293,7 @@ public View getGroupView(int groupPosition, boolean isExpanded, View convertView
: R.attr.icon_expander_minimized));
holder.imgIndicator.setVisibility(View.VISIBLE);
holder.imgInfo.setVisibility(View.GONE);
holder.imgUnsafe.setVisibility(View.GONE);

// Set data
holder.tvRestriction.setTypeface(null, Typeface.BOLD);
Expand Down Expand Up @@ -1392,6 +1398,7 @@ public void onClick(View view) {
}
});
}
holder.imgUnsafe.setVisibility(hook.isUnsafe() ? View.VISIBLE : View.GONE);

// Set data
if (hook.isDangerous())
Expand Down

0 comments on commit 6e618b1

Please sign in to comment.