Added messenging remark

This commit is contained in:
M66B 2019-10-11 18:09:29 +02:00
parent fe54cc3dde
commit fcb313e941
3 changed files with 30 additions and 0 deletions

View File

@ -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<AdapterRule.ViewHolder> implements Filterable {
@ -94,6 +95,18 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> im
private List<Rule> listAll = new ArrayList<>();
private List<Rule> listFiltered = new ArrayList<>();
private List<String> 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<AdapterRule.ViewHolder> 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<AdapterRule.ViewHolder> 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<AdapterRule.ViewHolder> 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);

View File

@ -158,6 +158,16 @@
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/tvRemarkMessaging"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_messaging"
android:textAppearance="@style/TextSmall"
android:textStyle="italic"
android:visibility="gone" />
<LinearLayout
android:id="@+id/llConfiguration"
android:layout_width="match_parent"

View File

@ -247,6 +247,7 @@ Your internet traffic is not being sent to a remote VPN server.</string>
<string name="title_internet">has no internet permission</string>
<string name="title_disabled">is disabled</string>
<string name="title_messaging">Incoming messages are received by Google Play services and not by this app and can therefore not be blocked by blocking this app</string>
<string name="title_apply">Apply rules and conditions</string>
<string name="title_conditions">Conditions</string>
<string name="title_screen_wifi">Allow Wi-Fi when screen is on</string>