From fcb313e941f874bc3ed900ea754416b6d886a590 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 11 Oct 2019 18:09:29 +0200 Subject: [PATCH] Added messenging remark --- .../eu/faircode/netguard/AdapterRule.java | 19 +++++++++++++++++++ app/src/main/res/layout/rule.xml | 10 ++++++++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 30 insertions(+) diff --git a/app/src/main/java/eu/faircode/netguard/AdapterRule.java b/app/src/main/java/eu/faircode/netguard/AdapterRule.java index 978c9e5b..1be06e08 100644 --- a/app/src/main/java/eu/faircode/netguard/AdapterRule.java +++ b/app/src/main/java/eu/faircode/netguard/AdapterRule.java @@ -74,6 +74,7 @@ import com.bumptech.glide.request.RequestOptions; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; public class AdapterRule extends RecyclerView.Adapter implements Filterable { @@ -94,6 +95,18 @@ public class AdapterRule extends RecyclerView.Adapter im private List listAll = new ArrayList<>(); private List listFiltered = new ArrayList<>(); + private List messaging = Arrays.asList( + "com.discord", + "com.facebook.mlite", + "com.facebook.orca", + "com.instagram.android", + "com.Slack", + "com.skype.raider", + "com.snapchat.android", + "com.whatsapp", + "com.whatsapp.w4b" + ); + public static class ViewHolder extends RecyclerView.ViewHolder { public View view; @@ -114,6 +127,8 @@ public class AdapterRule extends RecyclerView.Adapter im public ImageView ivScreenOther; public TextView tvRoaming; + public TextView tvRemarkMessaging; + public LinearLayout llConfiguration; public TextView tvUid; public TextView tvPackage; @@ -171,6 +186,8 @@ public class AdapterRule extends RecyclerView.Adapter im ivScreenOther = itemView.findViewById(R.id.ivScreenOther); tvRoaming = itemView.findViewById(R.id.tvRoaming); + tvRemarkMessaging = itemView.findViewById(R.id.tvRemarkMessaging); + llConfiguration = itemView.findViewById(R.id.llConfiguration); tvUid = itemView.findViewById(R.id.tvUid); tvPackage = itemView.findViewById(R.id.tvPackage); @@ -433,6 +450,8 @@ public class AdapterRule extends RecyclerView.Adapter im holder.tvRoaming.setAlpha(otherActive ? 1 : 0.5f); holder.tvRoaming.setVisibility(rule.roaming && (!rule.other_blocked || rule.screen_other) ? View.VISIBLE : View.INVISIBLE); + holder.tvRemarkMessaging.setVisibility(messaging.contains(rule.packageName) ? View.VISIBLE : View.GONE); + // Expanded configuration section holder.llConfiguration.setVisibility(rule.expanded ? View.VISIBLE : View.GONE); diff --git a/app/src/main/res/layout/rule.xml b/app/src/main/res/layout/rule.xml index 85b56c05..7d267b40 100644 --- a/app/src/main/res/layout/rule.xml +++ b/app/src/main/res/layout/rule.xml @@ -158,6 +158,16 @@ + + has no internet permission is disabled + Incoming messages are received by Google Play services and not by this app and can therefore not be blocked by blocking this app Apply rules and conditions Conditions Allow Wi-Fi when screen is on