diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/adapters/PermissionListAdapter.java b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/adapters/PermissionListAdapter.java index 3a65f61..6798182 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/adapters/PermissionListAdapter.java +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/adapters/PermissionListAdapter.java @@ -1,7 +1,6 @@ package org.eu.exodus_privacy.exodusprivacy.adapters; import android.databinding.DataBindingUtil; -import android.databinding.ViewDataBinding; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -10,12 +9,9 @@ import android.view.ViewGroup; import org.eu.exodus_privacy.exodusprivacy.R; import org.eu.exodus_privacy.exodusprivacy.databinding.PermissionItemBinding; -import org.eu.exodus_privacy.exodusprivacy.databinding.TrackerItemBinding; import org.eu.exodus_privacy.exodusprivacy.objects.Permission; -import org.eu.exodus_privacy.exodusprivacy.objects.Tracker; import java.util.List; -import java.util.Set; public class PermissionListAdapter extends RecyclerView.Adapter{ @@ -68,24 +64,31 @@ public class PermissionListAdapter extends RecyclerView.Adapter { - permission.expanded = !permission.expanded; - manageExpanded(permission); + if( permission.description != null && permission.description.trim().length() > 0) { + permission.expanded = !permission.expanded; + manageExpanded(permission); + } }); + } - else + else { permissionItemBinding.permissionName.setText(R.string.no_permissions); + permissionItemBinding.arrow.setText(" "); + } } void manageExpanded(Permission permission) { if(permission.expanded) { - permissionItemBinding.rightArrow.setVisibility(View.GONE); - permissionItemBinding.downArrow.setVisibility(View.VISIBLE); + permissionItemBinding.arrow.setText("▼"); permissionItemBinding.permissionDescription.setVisibility(View.VISIBLE); } else { - permissionItemBinding.rightArrow.setVisibility(View.VISIBLE); - permissionItemBinding.downArrow.setVisibility(View.GONE); + if( permission.description != null && permission.description.trim().length() > 0 ) + permissionItemBinding.arrow.setText("▶"); + else + permissionItemBinding.arrow.setText("■"); permissionItemBinding.permissionDescription.setVisibility(View.GONE); + } } } diff --git a/app/src/main/res/layout/permission_item.xml b/app/src/main/res/layout/permission_item.xml index 1bdac76..f149ea4 100644 --- a/app/src/main/res/layout/permission_item.xml +++ b/app/src/main/res/layout/permission_item.xml @@ -14,27 +14,14 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> -