https://github.com/only-icesoul/jjintentchooser
Simple intent chooser with callback when intent selected
https://github.com/only-icesoul/jjintentchooser
Last synced: 2 months ago
JSON representation
Simple intent chooser with callback when intent selected
- Host: GitHub
- URL: https://github.com/only-icesoul/jjintentchooser
- Owner: Only-IceSoul
- License: apache-2.0
- Created: 2020-01-13T15:26:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-14T19:01:20.000Z (over 5 years ago)
- Last Synced: 2025-01-22T21:11:57.230Z (4 months ago)
- Language: Kotlin
- Size: 176 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JJIntentChooser
Simple intent chooser
## Usage
1.-Add it in your root build.gradle at the end of repositories:
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
2.- Add the dependency
```
dependencies {
implementation 'com.github.Only-IceSoul:JJIntentChooser:1.1'
}
```## Preview

# Using IntentChooser
```
JJIntentChooser(this)
.setTitle("Pick app")
.setIntent(PrimaryIntent())
.setIntentSecondaries(
// intents for query or normal intents
)
.startForResult(100)
```## Ignore
ActivityInfo Name
```kotlin
.setIgnore("com.google.android.apps.photos.picker.external.ExternalPickerActivity",etc...)```
# Tracking when an activity was clicked
```kotlin
class TrackingIntentChooserActivity : JJIntentChooserActivity() {override fun onIntentClicked(resolveInfo: ResolveInfo) {
Toast.makeText(this, "info: ${resolveInfo.activityInfo.packageName} ${resolveInfo.activityInfo.name}",Toast.LENGTH_SHORT).show()//do something or request permission
super.onIntentClicked(resolveInfo) //super call startActivity}
override fun onIntentLongClicked(resolveInfo: ResolveInfo): Boolean {
Toast.makeText(this, "LongClicked info: $ {resolveInfo.activityInfo.packageName} ${resolveInfo.activityInfo.name}",Toast.LENGTH_SHORT)
.show()//do something
return super.onIntentLongClicked(resolveInfo)
}
}```
**Declare in the AndroidManifest.xml**
```java
```**Declare in Code**
```kotlin
.setActivity(TrackingActivity::class.java)
.startForResult(requestCode = 100)
```# License
[see License ](https://github.com/Only-IceSoul/JJIntentChooser/blob/master/LICENSE)