Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NoAH10833 opened this issue Sep 29, 2023 · 0 comments
Open

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

NoAH10833 opened this issue Sep 29, 2023 · 0 comments

Comments

@NoAH10833
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant