• Stars
    star
    199
  • Rank 191,548 (Top 4 %)
  • Language
    Java
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

βœ”οΈ Scrollable view which can be used to give different choices to user with nice ui.

Android Arsenal Open Source Love License

ScrollChoice

Scrollable view which can be used to give different choices to user with nice ui.

Preview

Add With Gradle Dependency

compile 'com.webianks.library:scroll-choice:1.0.1'

Maven:

<dependency>
  <groupId>com.webianks.library</groupId>
  <artifactId>scroll-choice</artifactId>
  <version>1.0.1</version>
  <type>pom</type>
</dependency>

Min SDK

15

Compile SDK

25

Add ScrollChoice to layout

<com.webianks.library.scroll_choice.ScrollChoice
        android:id="@+id/scroll_choice"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

From Java

Get the reference of ScrollChoice

ScrollChoice scrollChoice = (ScrollChoice) findViewById(R.id.scroll_choice);

Prepare your list items

List<String> data = new ArrayList<>();
data.add("Brazil");
data.add("USA");
data.add("China");
data.add("Pakistan");
data.add("Australia");
data.add("India");
data.add("Nepal");
data.add("Sri Lanka");
data.add("Spain");
data.add("Italy");
data.add("France");

Add to the ScrollChoice object with default selected item index

scrollChoice.addItems(data,5);

Attach listener to listen to know which item was selected

scrollChoice.setOnItemSelectedListener(new ScrollChoice.OnItemSelectedListener() {
            @Override
            public void onItemSelected(ScrollChoice scrollChoice, int position, String name) {
                Log.d("webi",name);
            }
        });

Here 5 is the index of default selected item.

Customization Through XML

<!--Change background Color-->
    app:scroll_background_color="#212121"
<!--Change selected item's background -->
    app:scroll_selected_item_background="#000000"
<!--Change text color-->
    app:scroll_item_text_color="#f5f5f5"
<!--Show/Hide atmospheric gradient effect on top-bottom items-->
    app:scroll_atmospheric="true"
<!--Hide/show scroll indicator-->
    app:scroll_indicator="true"
<!--Change indicator color-->
    app:scroll_indicator_color="#000000"
<!--Align all items-->
    app:scroll_item_align="center"
<!--Set selected item's text color-->
    app:scroll_selected_item_text_color="?attr/colorPrimary"
<!--Set selected item position-->
    app:scroll_selected_item_position="center"
<!--Set different text size-->
    app:scroll_item_text_size="17sp"
<!--Set different indicator size-->
    app:scroll_indicator_size="1dp"      

Test APK

Based on the awesome WheelPicker taken from SingleDateAndTimePicker by Florent CHAMPIGNY.

License

MIT License

Copyright (c) 2017 Ramankit Singh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

More Repositories

1

PopupBubble

πŸ…ΏοΈ Easily add and customise "New Post" popup button with the feeds (RecyclerView) of your app.
Java
381
star
2

msgs

πŸ“₯ Messaging app utilising some of the sms APIs.
Kotlin
163
star
3

BluetoothChat

β˜‰β€ΏβŠ™ Simple bluetooth chat app.
Kotlin
120
star
4

EasyFeedback

✏️ Easily gather feedback from any android application. Get detailed information on the email.
Java
104
star
5

EasyPortfolio

πŸ’» Easily add Portfolio Screen in your android app.
Java
28
star
6

PlayStoreParallelDownload

πŸŒ€ Demo logic to download/update apps in parallel inside recyclerview like AppStore.
Java
26
star
7

Crimson

πŸ‘“ An android application that can prove to be the ultimate care taker of your eyes. [Built during hackDTU event.]
Java
24
star
8

Expensive

Simple Expense Manager App using MVP.
Kotlin
24
star
9

BreathingProgressDemo

πŸ”΅ Nice little breathing progress which can be used in replacement with the default ProgressBar in Android.
Java
22
star
10

webianks_resume

πŸ“„ Clone of MaterialResume with customizations for my resume.
HTML
7
star
11

scout

πŸ”° Scout helps to perform email search flawlessly on the basis of extracting various email search parameters from plain english query.
Java
4
star
12

CybonitoApp

Source code of official android app of fest "Cybonito".
Java
3
star
13

INCHECK-InternetCheck

πŸ“‘ This project contains very simple but usefull feature to check if the device has the Internet Access or not.
Java
3
star
14

BestKick

Pseudo Mobile application which lists the best Kickstarter.com projects.
Java
3
star
15

flutter_resume

My portfolio website built with Flutter Web
Dart
2
star
16

adidas-concept

Adidas Concept App made with Flutter.
Dart
2
star
17

Creddit

Basic credit card maintenance demonstration app.
Kotlin
2
star
18

EdforaStudio

Pseudo Android application that lists and plays best coke studio songs. [Edfora Hiring Challenge]
Java
2
star
19

EduCorp

A simplified way to connect parents and tutors! [Rang De Android Hiring Challenge]
Java
2
star
20

travy-bot

Your travel helper chat bot.
JavaScript
1
star
21

doggo

Kotlin
1
star
22

MallOfDeals

Mindtree Digital Hackathon 2015 project.
Java
1
star
23

NasaPicturesApp

Kotlin
1
star
24

MaterialRatingBar

Material Design RatingBar with better appearance.
Java
1
star