MaterialSpinner

Material Spinner which looks like EditText inside TextInputLayout

License

License

Categories

Categories

Ant Build Tools
GroupId

GroupId

io.pravikant
ArtifactId

ArtifactId

materialspinner
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

MaterialSpinner
Material Spinner which looks like EditText inside TextInputLayout
Project URL

Project URL

https://github.com/iampravikant/MaterialSpinner
Source Code Management

Source Code Management

https://github.com/iampravikant/MaterialSpinner

Download materialspinner

How to add to project

<!-- https://jarcasting.com/artifacts/io.pravikant/materialspinner/ -->
<dependency>
    <groupId>io.pravikant</groupId>
    <artifactId>materialspinner</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/io.pravikant/materialspinner/
implementation 'io.pravikant:materialspinner:1.0.0'
// https://jarcasting.com/artifacts/io.pravikant/materialspinner/
implementation ("io.pravikant:materialspinner:1.0.0")
'io.pravikant:materialspinner:aar:1.0.0'
<dependency org="io.pravikant" name="materialspinner" rev="1.0.0">
  <artifact name="materialspinner" type="aar" />
</dependency>
@Grapes(
@Grab(group='io.pravikant', module='materialspinner', version='1.0.0')
)
libraryDependencies += "io.pravikant" % "materialspinner" % "1.0.0"
[io.pravikant/materialspinner "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.android.support » appcompat-v7 jar 27.1.1
org.jetbrains.kotlin : kotlin-stdlib-jre7 jar 1.1.51

Project Modules

There are no modules declared in this project.

MIT Licence

Material Spinner

Material Spinner which looks like EditText inside TextInputLayout

Example

alt text

Usage

Step 1: Add MaterialSpinner in XML

<io.pravikant.materialspinner.MaterialSpinner
        android:id="@+id/main_occupation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:ms_hint="Occupation" />

Step 2: Set items

main_occupation.setItems(resources.getStringArray(R.array.occupations))

Step 3: Get current selected item

main_occupation.getSelectedItem().toString()

Custom ArrayAdapter

val adapter = ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, resources.getStringArray(R.array.occupations))
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
main_occupation.setAdapter(adapter)

Attributes

<attr name="ms_hint" format="string" />
<attr name="ms_hint_color" format="color" />
<attr name="ms_line_color" format="color" />
<attr name="ms_text_size" format="dimension" />

Download

Gradle:

repositories {
  mavenCentral()
  google()
}

dependencies {
  implementation 'io.pravikant:materialspinner:1.0.0'
}

Note: Don't forget to add mavenCentral() under repositories in root-level build.gradle

Maven:

<dependency>
  <groupId>io.pravikant</groupId>
  <artifactId>materialspinner</artifactId>
  <version>1.0.0</version>
  <type>aar</type>
</dependency>

Author

Pramod Ravikant

alt text alt text alt text

Licence

This project is licensed under the MIT License - see the LICENSE file for details

Versions

Version
1.0.0