Open NoAH10833 opened 1 year ago
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_gallery, container, false); galleryViewModel = new ViewModelProvider(this).get(GalleryViewModel.class); binding = FragmentGalleryBinding.inflate(inflater, container, false); smartTabLayout = root.findViewById(R.id.viewpagertab); viewPager = root.findViewById(R.id.viewpager); tabStrip = root.findViewById(R.id.tab_icon); //adaptar abas FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter( getActivity().getSupportFragmentManager(), FragmentPagerItems.with(getActivity()) .add("TUDO", TodosFragment.class) .add("cima", TopFragment.class) .add("selva", JGFragment.class) .add("meio", MidFragment.class) .add("baixo", ADCFragment.class) .add("baixo1", SUPFragment.class) .create() ); viewPager.setAdapter( adapter ); smartTabLayout.setViewPager( viewPager ); return root; } @Override public void onDestroyView() { super.onDestroyView(); binding = null; }
}
that's my code, I'm using it to display the tabs over another fragment, it's functional, but I don't know how to replace the letters with image icons
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
}
that's my code, I'm using it to display the tabs over another fragment, it's functional, but I don't know how to replace the letters with image icons