I am using the TabLayout design library that I want to get

I tried a lot of tutorials, and I can achieve this by setting the tab, but there is a limitation that occurs when choosing a tab. I want to change the color of the text, as well as the image of the icon, which is not possible, referring to any of the lessons that I have read so far. I have tried this so far by adding this to the FragmentStatePagerAdapter
public View getTabView(int position) { View tab = LayoutInflater.from(mContext).inflate(R.layout.tabbar_view, null); TextView tabText = (TextView) tab.findViewById(R.id.tabText); ImageView tabImage = (ImageView) tab.findViewById(R.id.tabImage); tabText.setText(mFragmentTitles.get(position)); tabImage.setBackgroundResource(mFragmentIcons.get(position)); if (position == 0) { tab.setSelected(true); } return tab; }
source share