项目作者: volobot

项目描述 :
This is Stylish String Chooser for Android.
高级语言: Java
项目地址: git://github.com/volobot/String-Picker-Android.git
创建时间: 2019-06-24T07:20:08Z
项目社区:https://github.com/volobot/String-Picker-Android

开源协议:

下载


Stylise String Chooser

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

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }

Add the dependency

  1. dependencies {
  2. implementation 'com.github.volobot-admin:String-Picker-Android:v1.3'
  3. }

How to implement

  1. <com.volobot.stringchooser.StringChooser
  2. android:id="@+id/stringChooser"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. app:selectedColor="@android:color/holo_blue_dark"
  6. app:notSelectedColor="@android:color/holo_green_light"
  7. app:selectedSize="32dp"
  8. app:notSelectedSize="20dp"
  9. app:notSelectedOpacity="0.3"
  10. >
  1. StringChooser stringChooser = findViewById(R.id.stringChooser);
  2. List<String> strings = new ArrayList<>();
  3. for (int i = 0; i < 25; i++) {
  4. strings.add("option "+i);
  5. }
  6. stringChooser.setStrings(strings);
  7. stringChooser.setStringChooserCallback(new StringChooser.StringChooserCallback() {
  8. @Override
  9. public void onStringPickerValueChange(String s, int position) {
  10. Log.d(TAG, s);
  11. }
  12. });