Hide message action labels in compact view

pull/156/head
M66B 5 years ago
parent 34e93cdb48
commit e98c71334b

@ -100,6 +100,7 @@ import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import com.github.chrisbanes.photoview.PhotoView; import com.github.chrisbanes.photoview.PhotoView;
import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.bottomnavigation.LabelVisibilityMode;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
@ -144,6 +145,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private int answers = -1; private int answers = -1;
private IProperties properties; private IProperties properties;
private int dp36;
private int colorPrimary; private int colorPrimary;
private int colorAccent; private int colorAccent;
private int colorWarning; private int colorWarning;
@ -379,6 +381,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvNoInternetAttachments = attachments.findViewById(R.id.tvNoInternetAttachments); tvNoInternetAttachments = attachments.findViewById(R.id.tvNoInternetAttachments);
bnvActions = itemView.findViewById(R.id.bnvActions); bnvActions = itemView.findViewById(R.id.bnvActions);
if (compact) {
bnvActions.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED);
ViewGroup.LayoutParams lparam = bnvActions.getLayoutParams();
lparam.height = dp36;
bnvActions.setLayoutParams(lparam);
}
tbHtml = itemView.findViewById(R.id.tbHtml); tbHtml = itemView.findViewById(R.id.tbHtml);
ibImages = itemView.findViewById(R.id.ibImages); ibImages = itemView.findViewById(R.id.ibImages);
@ -3393,6 +3401,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.suitable = ConnectionHelper.getNetworkState(context).isSuitable(); this.suitable = ConnectionHelper.getNetworkState(context).isSuitable();
this.properties = properties; this.properties = properties;
this.dp36 = Helper.dp2pixels(context, 36);
this.colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary); this.colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary);
this.colorAccent = Helper.resolveColor(context, R.attr.colorAccent); this.colorAccent = Helper.resolveColor(context, R.attr.colorAccent);
this.colorWarning = Helper.resolveColor(context, R.attr.colorWarning); this.colorWarning = Helper.resolveColor(context, R.attr.colorWarning);

Loading…
Cancel
Save