Here I have a TabLayout
and inside that I have ViewPager
where are 4 tabs and all tabs are static. I needed a blank space in center of TabLayout
so I added one more tab in TabLayout
, now I want to disable it, it should not get any clicked, tap or selector should not come on that particular tab as it is showing in image as
I'm adding custom view this tab as
for (int i = 0; i < mPagerAdapter.getCount(); i++) {
View customView = mPagerAdapter.getCustomeView(getActivity(), i);
mTabLayout.getTabAt(i).setCustomView(customView);
}
I tried to disable clicks etc on this tab as
LinearLayout tabStrip = ((LinearLayout)tabLayout.getChildAt(2));
tabStrip.setEnabled(false);
but it didn't work for me. Can anyone give me a right way to solve this issue?