Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
qandeelabbassi committed Jan 28, 2021
2 parents 65ea428 + 4efda53 commit 6b25588
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
<img width="45" height="45" src="./app/src/main/ic_launcher-playstore.png" alt="icon">
<p align="center">
<img align="center" width="50" height="50" src="./app/src/main/ic_launcher-playstore.png" alt="icon">
</p>

# Dropsy
Simple dropdown/spinner view for Android.
<h1 align="center">DROPSY</h1>
<p align="center">
Simple dropdown/spinner view for Android
</p>

<kbd>
<img width="250" src="./screenshots/dropsy_demo.gif" alt="demo">
</kbd>
<p align="center">
<a href="https://jitpack.io/#qandeelabbassi/Dropsy"><img alt="Jitpack" src="https://jitpack.io/v/qandeelabbassi/Dropsy.svg"/></a>
<a href="https://android-arsenal.com/api?level=19"><img alt="API" src="https://img.shields.io/badge/API-19%2B-brightgreen.svg?style=flat"/></a>
<a href="https://opensource.org/licenses/MIT"><img alt="License" src="https://img.shields.io/badge/License-MIT-yellow.svg"/></a>
</p>

<p align="center">
<kbd> <img width="250" src="./screenshots/dropsy_demo.gif" alt="demo"> </kbd>
</p>
</br>

## Gradle
Add it in your top-level `build.gradle`:
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
Add the dependency to app-level `build.gradle`:
```
implementation 'com.github.qandeelabbassi:Dropsy:1.0'
```

## Usage
:point_right: Add the Dropsy's `DropDownView` view in XML layout like this:
Expand All @@ -28,7 +54,7 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// set listener
findViewById<DropDownView>(R.id.dropdown_fruits).setItemClickListener { i, item ->
dropdown_fruits.setItemClickListener { i, item ->
Toast.makeText(this, "${item.text} clicked at index $i", Toast.LENGTH_SHORT).show()
}
}
Expand All @@ -40,6 +66,6 @@ btn_show.setOnClickListener { dropdown_fruits.showDropdown() }
btn_hide.setOnClickListener { dropdown_fruits.hideDropdown() }
```

## Sample App Screenshot:
## Sample App Screenshot

<img src="./screenshots/sample_app.png" width="250">
<img src="./screenshots/sample_app.png" width="250">

0 comments on commit 6b25588

Please sign in to comment.