๐Ÿ”ฅ An android library to get simple menu options on steroids ๐Ÿ’ช

Overview

Pager

API Android Arsenal Pager AndroidDevDigest UX Planet AndroidWeekly AwesomeAndroid Download

๐Ÿ”ฅ 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):

allprojects {
		repositories {
			...
			maven { url 'https://www.jitpack.io' }
		}
	}

Dependency

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

dependencies 
	        implementation 'com.github.Pradyuman7:Pager:V1.1'
	}

Usage

  • Add the layout in your XML file for the activity, like this:
<?xml version="1.0" encoding="utf-8"?>
<merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.pd.cards.Main2Activity"
    tools:ignore="all"
    tools:showIn="@layout/activity_main2">

    <com.pd.pager.PagerLayout
        android:id="@+id/rl_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        app:num="five"/>
</merge>

<com.pd.pager.PagerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</com.pd.pager.PagerLayout>

  • Configure the layout and add the fragments like this:
PagerLayout pager = findViewById(R.id.rl_main);

        List<String> titleList = new ArrayList<>();
        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(new Page1());
        fragments.add(new Page2());
        fragments.add(new Page3());
        fragments.add(new Page4());
        fragments.add(new Page5());

        FragmentPagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
            @Override
            public Fragment getItem(int position) {
                return fragments.get(position);
            }

            @Override
            public int getCount() {
                return fragments.size();
            }
        };

        pager.setAdapter(adapter);
  • See the app code to know more about this.

Pull Request

Have some new ideas or found a bug? Do not hesitate to open an issue and make a pull request.

License

Pager is under License: GPL v3. See the LICENSE file for more info.

You might also like...
Get a libGDX-powered Android live wallpaper up and running quickly with this project template

This project is a libGDX Android live wallpaper template. It's the demo application created by the libGDX code generator, remade as a live wallpaper.

Let third-party launcher always get themed icon in MIUI (Maybe also works for other Android based OS).
Let third-party launcher always get themed icon in MIUI (Maybe also works for other Android based OS).

English ็ฎ€ไฝ“ไธญๆ–‡ Introduction This module can let third party launcher always use icons with MIUI/Flyme Themes. It may also work with other custom Android

Nova Wallet Android - Next get mobile app for Polkadot & Kusama ecosystem
Nova Wallet Android - Next get mobile app for Polkadot & Kusama ecosystem

Nova Wallet Android is a next gen application for Polkadot & Kusama ecosystem, transparent & community-oriented, focused on convenient UX/UI, fast performance & security.

Episodie is a TV show time tracker app with unusual design written in kotlin and clean architecture approach. Get to know how much time you spent watching tv shows.
Episodie is a TV show time tracker app with unusual design written in kotlin and clean architecture approach. Get to know how much time you spent watching tv shows.

Episodie Episodie is a TV show time tracker app with unusual design. Get to know how much time you spent watching tv shows. Track easily overall progr

when you use restful api and network get disconnect you have to store your data local for make your app faster and work on ofline mode

AppArchitectureOflineMode when you use restful api and network get disconnect you have to store your data local for make your app faster and work on o

An app allows the users to get top news about their countries
An app allows the users to get top news about their countries

News App This app allows the users to get top news about their countries. In the following figure, you can find the developed architecture: App consis

 ๐Ÿ“บ๏ธ Recommend movies and get movie details.
๐Ÿ“บ๏ธ Recommend movies and get movie details.

MovieDB ๐Ÿ“บ๏ธ Recommend movies and get movie details. Preview MovieList Detail What I used name function ๐ŸŒฑ retrofit2 send api request Glide The path of

App uses NewsAPI to get news for kotlin
App uses NewsAPI to get news for kotlin

News App Tech Stack ๐Ÿ› ๏ธ Kotlin MVVM & Repository pattern LiveData Navigation Coroutines Retrofit Room Glide About App ๐Ÿ’ก This app uses NewsAPI to get

Ipify allows users to get current public IP address for connected network in real-time
Ipify allows users to get current public IP address for connected network in real-time

Ipify-Android Ipify allows you to get current public IP address when connected to internet in real-time Add Dependency Use Gradle: Step 1: Add it in y

Comments
  • IndexOutOfBoundsException for pager.setTitles()

    IndexOutOfBoundsException for pager.setTitles()

    Describe the bug IndexOutOfBoundsException for pager.setTitles() occurs

    To Reproduce Steps to reproduce the behavior:

    1. Just make two pages and try pager.setTitles()

    Expected behavior Exception causes the app to crash.

    fixed 
    opened by Pradyuman7 0
  • Add tests

    Add tests

    Test everything and with get the most code coverage. Understand what lowers the quality of the code and improve it. Try different techniques to maximise the amount of bugs solved. Unit tests, mocks, integration tests and everything else to test the library working thoroughly

    enhancement Tests 
    opened by Pradyuman7 0
Releases(V1.1)
Owner
Pradyuman Dixit
I code.
Pradyuman Dixit
An App based on MVVM architecture to track & store a user's runs using Google Maps, with options to view & sort the runs as per the user's choice along the with option to run the app in background.

An App based on MVVM architecture to track & store a user's runs using Google Maps, with options to view & sort the runs as per the user's choice along the with option to run the app in background.

Harshit Maheshwari 1 Jun 9, 2022
This app contains an order flow for cupcakes with options for quantity, flavor, and pickup date

This app contains an order flow for cupcakes with options for quantity, flavor, and pickup date. The order details get displayed on an order summary screen and can be shared to another app to send the order.

Shaima Alghamdi 3 Aug 22, 2022
A simple android app written in Kotlin to get defination of word entered from Free Dictionary API.

FlashCard A simple android app written in Kotlin to get defination of word entered from Free Dictionary API. Problem Statement Many of students don't

RITEK ROUNAK 3 Jan 20, 2022
This is a simple app to help get or set your Slack status from the command line.

Slack Status This is a simple app to help get or set your Slack status from the command line. The app is a Spring Boot app written in Kotlin. It uses

Steven Noto 1 Oct 16, 2021
A library for Android to get the market name of the device.

GoogleSupportedDevices A library for Android to get the market name of the device. Getting Started Include the library in your build.gradle. implement

David Gonzรกlez 7 Dec 4, 2022
The example Android project of animated menu items in toolbar

Android Animated Menu Items The example Android project of animated menu items in toolbar. Thanks Srikant Shetty for idea of this animation. Cut: Copy

Ilya Fomenko 922 Nov 23, 2022
A demo of the power menu with Reveal and other animations

MaterialPowerMenu A demo of the power menu with Reveal and other animations Some days ago, I saw a gif on Google+ demonstating a concept of Android Po

Naman Dwivedi 888 Oct 11, 2022
Easy to use Overflow Menu for Jetpack Compose

Overflow Menu Android library for Jetpack Compose providing an Overflow Menu via fast and easy to use DSL. How to add to project Step 1. Add the JitPa

Ceribe 2 Dec 17, 2021
Abel Suviri 6 Dec 16, 2022
WeatherApp is an Android application that helps you to get the forecast and temperature for specific locations

WeatherApp2 WeatherApp is an Android application that helps you to get the forecast and temperature for specific locations , This app is based on the

null 5 Jan 2, 2022