There is a given element of the screen. Tags are located in the FlowLayout
container (third-party library), which automatically transfers items to another row if they do not fit. The problem is that I need to display only 1 line of tags, and when I click on "more", I can display the rest. Maybe someone has an idea how to solve this problem.
Tagging methods
private void createTag(Context context, FlowLayout container, TagEntity tagEntity){ TextView txt = (TextView) LayoutInflater.from(context) .inflate(R.layout.tag_view, null); String tagText=tagEntity.getName(); if (tagText.length()>9){ txt.setText(tagText.substring(0,9)+"..."); } else{ txt.setText(tagEntity.getName()); } txt.setBackgroundResource(tagEntity.getTagGroup().getColor()); FlowLayout.LayoutParams fl =new FlowLayout.LayoutParams(FlowLayout.LayoutParams.WRAP_CONTENT, FlowLayout.LayoutParams.WRAP_CONTENT ); fl.setMargins(16,16,16,16); container.addView(txt,fl); } private void createTagFromList(Context context,FlowLayout container,List<TagEntity> list){ for (TagEntity tagEntity :list){ createTag(context,container, tagEntity); } }