i have chip group in xml layout and need to add chip dynamically. i need to add theme dynamically ,without changing the app theme i want to set material theme for chip view till now i cant find a proper solution , i will show my code snippet. i need your help badly
Chip chip = new Chip(mContext);
chip.setCloseIconVisible(true);
chip.setText(dataOptions.getListTitle());
chip.setTextAppearance(mContext, R.style.button_style_value_color_black);
chip.setHeight(30);
chip.isCloseIconVisible();
chip.setChipStrokeColorResource(R.color.chip_stroke_color);
chip.setChipStrokeWidth(1f);
chip.setCloseIconTintResource(R.color.grey_500);
chip.setChipBackgroundColorResource(R.color.chip_background);
chip.setChipCornerRadius(10f);
mBinding.feNotesChip.addView(chip);
chip.setOnCloseIconClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mAdapter.setItemToTheList(dataOptions, mBinding.feNotesEt.getText());
mBinding.feNotesChip.removeView(chip);
dataOptionsList.remove(dataOptions);
saveToFormElement(dataOptionsList, newList);
}
});