https://github.com/random-guys/pica.chu
Contacts Picker
https://github.com/random-guys/pica.chu
library
Last synced: 9 months ago
JSON representation
Contacts Picker
- Host: GitHub
- URL: https://github.com/random-guys/pica.chu
- Owner: random-guys
- Created: 2019-08-14T13:53:43.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-03-06T11:37:07.000Z (over 1 year ago)
- Last Synced: 2025-04-10T09:38:12.867Z (about 1 year ago)
- Topics: library
- Language: Kotlin
- Size: 227 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pica.chu
This is tiny contacts picker as a BottomSheetDialog picker for Android.
We built it because we wanted to combine phone contacts on a device with contacts loaded from a server.
Also some contact pickers were just misbehaving and we needed the experience to be consistent across devices.
This lib will be useful to anyone that's frustrated using the default contact pickers that ship with android devices.
This is due to the fact that each device rolls out their contact picker.
## Demo

## Installation
Add the dependency :
```gradle
dependencies {
implementation 'com.random-guys:pica:0.1.1'
}
```
## Usage
Add these permissions to `AndroidManifest.xml`
```xml
```
Usage in View (`Activity` or `Fragment`)
```kt
import com.random_guys.pica.Chu
import com.random_guys.pica.Contact
import com.random_guys.pica.Pica
class MainActivity : AppCompatActivity(), Chu.ContactClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
button.setOnClickListener {
val mMainContacts = ArrayList()
// load contacts from phonebook into an array
val pica = Pica(this)
pica.load { contacts -> mMainContacts.addAll(contacts) }
// open contacts picker using contacts loaded from phonebook
val chooser = Chu(mMainContacts, this)
chooser.show(supportFragmentManager, "")
}
}
override fun onContactClickListener(contact: Contact) {
Toast.makeText(this, contact.name, Toast.LENGTH_LONG).show()
}
}
```