Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
H

HorizontalPicker

> 编程语言
Open source

A simple, customizable and easy to use picker where centre view is scaled up

373 stars0 likes1 views
WebsiteGitHub

About

A simple, customizable and easy to use picker where centre view is scaled up

HorizontalPicker

A simple, customizable and easy to use picker where centre view is scaled up

QuickStart

Include the Gradle dependency

java
dependencies {
    compile 'com.github.adityagohad:HorizontalPicker:1.0.1'
}

Don't forget to add following to build.gradle(Project:{your_project_name>})

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

How to use

Your picker will be recyclerView and this lib is just a custom layout manager to initialize the PickerLayoutManager and set the properties

java
PickerLayoutManager pickerLayoutManager = new PickerLayoutManager(this, PickerLayoutManager.HORIZONTAL, false);
pickerLayoutManager.setChangeAlpha(true);
pickerLayoutManager.setScaleDownBy(0.99f);
pickerLayoutManager.setScaleDownDistance(0.8f);

To make it snap to centre use SnapHelper

java
SnapHelper snapHelper = new LinearSnapHelper();
snapHelper.attachToRecyclerView(recyclerView);

set layout manager of your recyclerVew

java
recyclerView.setLayoutManager(pickerLayoutManager);

To get selected view use onScrollStopListener

java
pickerLayoutManager.setOnScrollStopListener(new PickerLayoutManager.onScrollStopListener() {
    @Override
        public void selectedView(View view) {
            //Do your thing
        }
    });
}

Don't forget this

To its core it is a recycler view with custom layout manager so if you forget to add clipToPadding="false" you will never be able to select first and last few elemets(values/views).

So always add paddingLeft and paddingRight like shown below.

    

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaandroidcentrecustomizablehorizontalnumberpicker

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言