I am using the FlowLayout in a ScrollView and the right side of the layout is getting cut off. Not sure if this is related it to being in a ScrollView or not.
The last entry is getting cut off too.
private void updateMoviesTvTags() {
moviesTvContainer.removeAllViews();
for (int i = 0; i < 50; i++) {
CustomTextView tag = new CustomTextView(getActivity());
FlowLayout.LayoutParams lp = new FlowLayout.LayoutParams(FlowLayout.LayoutParams
.WRAP_CONTENT, FlowLayout.LayoutParams.WRAP_CONTENT);
lp.setMargins(0, 0, 10, 10);
tag.setLayoutParams(lp);
tag.setBackground(getResources().getDrawable(R.drawable.tag_bg));
tag.setText("test");
tag.setTextSize(16);
tag.setTextColor(getResources().getColor(R.color.primary_blue));
tag.setPadding(10, 10, 10, 10);
moviesTvContainer.addView(tag);
}
}
<com.wefika.flowlayout.FlowLayout
android:id="@+id/movies_tv_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start|top"
android:padding="10dp"/>