Skip to content
This repository was archived by the owner on Jan 8, 2026. It is now read-only.
This repository was archived by the owner on Jan 8, 2026. It is now read-only.

How do I set up icons instead of letters? #320

Description

@NoAH10833

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions