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

HorizontalPicker

> 编程语言
Open source

A HorizontalPicker view for android, which supports both text and icon. :sparkles:

360 stars0 likes0 views
WebsiteGitHub

About

A HorizontalPicker view for android, which supports both text and icon. :sparkles:

Horizontal Picker

A Horizontal picker library for android which supports both text and icons . :pouting_cat:

Gradle Dependency

Add this in your root build.gradle file at the end of repositories:

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

Add the dependency :

java
dependencies {
	        compile 'com.github.GoodieBag:HorizontalPicker:v1.0'
	}

Sync the gradle and that's it! :+1:

Features :

  • Supports icons and text or a mixture of both as items of the picker.
  • Tap or scroll horizontally to select the items.
  • Supports drawables, selectors and text highlighting using selectors.
  • Selection change listener to monitor the current selected item.

Usage

XML :

xml

P.S : itemWidth and itemHeight are not mandatory. If ignored, it is WRAP_CONTENT by default.

textColorSelector is only applicable when the items are textItems.

Java :

java
 //If your picker needs to have text as items :  
 HorizontalPicker hpText = (HorizontalPicker) findViewById(R.id.picker);
 
 List textItems = new ArrayList<>();
        for(int i=1;i imageItems = new ArrayList<>();
imageItems.add(new HorizontalPicker.DrawableItem(R.drawable.example));
imageItems.add(new HorizontalPicker.DrawableItem(R.drawable.example2));
hpImage.setItems(imageItems);
Use hpText.setSelectedIndex(index) to select an item programmatically.

Listeners :

A listener exists to monitor the item selection change on slide or on tap.

java
HorizontalPicker.OnSelectionChangeListener listener = new HorizontalPicker.OnSelectionChangeListener() {
      		@Override
            public void onItemSelect(HorizontalPicker picker, int index) {
                HorizontalPicker.PickerItem selected = picker.getSelectedItem();
                Toast.makeText(MainActivity.this, selected.hasDrawable() ? "Item at " + (picker.getSelectedIndex() + 1) + " is selected" : selected.getText() + " is selected", Toast.LENGTH_SHORT).show();
            }
hpText.setChangeListener(listener);

Known Issues :

When the HorizontalPicker is wrapped in an HorizontalScrollView the scroll to select feature of the picker does not work as expected. This will be fixed soon.

LICENSE :

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaandroidandroid-libraryandroid-studiojava

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 推出的简洁高效系统语言