mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-01 12:54:07 +00:00
parent
1f3e638dd0
commit
a3f9464554
2 changed files with 21 additions and 2 deletions
|
@ -89,6 +89,8 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
|||
public ImageView ivExpander;
|
||||
public TextView tvName;
|
||||
|
||||
public TextView tvHosts;
|
||||
|
||||
public LinearLayout llWifi;
|
||||
public CheckBox cbWifi;
|
||||
public ImageView ivScreenWifi;
|
||||
|
@ -133,6 +135,8 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
|||
ivExpander = (ImageView) itemView.findViewById(R.id.ivExpander);
|
||||
tvName = (TextView) itemView.findViewById(R.id.tvName);
|
||||
|
||||
tvHosts = (TextView) itemView.findViewById(R.id.tvHosts);
|
||||
|
||||
llWifi = (LinearLayout) itemView.findViewById(R.id.llWifi);
|
||||
cbWifi = (CheckBox) itemView.findViewById(R.id.cbWifi);
|
||||
ivScreenWifi = (ImageView) itemView.findViewById(R.id.ivScreenWifi);
|
||||
|
@ -504,9 +508,14 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
|||
}
|
||||
});
|
||||
|
||||
if (rule.expanded) {
|
||||
final AccessAdapter badapter = new AccessAdapter(context, dh.getAccess(rule.info.applicationInfo.uid));
|
||||
// Show rule count
|
||||
final AccessAdapter badapter = new AccessAdapter(context, dh.getAccess(rule.info.applicationInfo.uid));
|
||||
int count = badapter.getCount();
|
||||
holder.tvHosts.setVisibility(count > 0 ? View.VISIBLE : View.GONE);
|
||||
holder.tvHosts.setText(Integer.toString(count));
|
||||
|
||||
// Show rules
|
||||
if (rule.expanded) {
|
||||
if (filter)
|
||||
holder.lvAccess.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
|
|
|
@ -41,6 +41,16 @@
|
|||
android:textAppearance="@style/TextMedium" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvHosts"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textAppearance="@style/TextSmall"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llWifi"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
Loading…
Reference in a new issue