android menu pager

android menu pager

🔥 An android library to get simple menu options to 💪. Inspired by AndroidResideMenu.

GIF

AndroidPub(Medium) Post

You can read the AndroidPub post about this library, the perks it provides and other details here.

Prerequisites

Add this in your root build.gradle file (not your module build.gradle file):

Dependency

Add this to your module’s build.gradle file (make sure the version matches the JitPack badge above):

Usage

  • Add the layout in your XML file for the activity, like this:

  • Configure the layout and add the fragments like this:PagerLayout pager = findViewById(R.id.rl_main);List<String> titleList =newArrayList<>(); titleList.add(“Page1”); titleList.add(“Page2”); titleList.add(“Page3”); titleList.add(“Page4”); titleList.add(“Page5”);if(pager ==null) Log.i(“Pager_Null”,”Pager is null”);pager.setTitles(titleList);fragments.add(newPage1()); fragments.add(newPage2()); fragments.add(newPage3()); fragments.add(newPage4()); fragments.add(newPage5());FragmentPagerAdapter adapter =newFragmentPagerAdapter(getSupportFragmentManager()) { @OverridepublicFragmentgetItem(intposition) { return fragments.get(position); }@OverridepublicintgetCount() { return fragments.size(); } };pager.setAdapter(adapter);
    • See the app code to know more about this.

308 total views, 2 views today

(Visited 61 times, 1 visits today)

You May Also Like

About the Author: Android Developer

This is Mohammad I am Android Application Developer. I am the founder of Android Tutorial Online blog. I am programming lover and professional blogger from India. I spend most of my time doing programming and helping other programmers. This Android tutorial online blog for learning and share Android code.
My Chatbot
Powered by Replace Me