Skip to content

Commit

Permalink
Merge pull request #4 from hi-manshu/Readme
Browse files Browse the repository at this point in the history
Released Alpha-01
  • Loading branch information
hi-manshu committed Feb 2, 2022
2 parents e168286 + 232a40f commit 925cf83
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 1 deletion.
74 changes: 74 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,75 @@
### Pluck - The image-picker library for Compose

![Pluck](art/pluck.jpg)

This is an image-picker for your jetpack compose project. You can select from Gallery/Camera.

_Made with ❤️ for Android Developers by Himanshu_

[![Maven Central](https://img.shields.io/maven-central/v/com.himanshoe/pluck)](https://search.maven.org/artifact/com.himanshoe/pluck)
[![Github Followers](https://img.shields.io/github/followers/hi-manshu?label=Follow&style=social)](https://github.com/hi-manshu)
[![Twitter Follow](https://img.shields.io/twitter/follow/hi_man_shoe?label=Follow&style=social)](https://twitter.com/hi_man_shoe)


## Implementation

#### Step: 01

Add the specific permission in `AndroidManifest.xml` file

```xml

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.CAMERA" />

```

#### Step: 02

In `build.gradle` of app module, include the following dependency

```gradle
dependencies {
implementation("com.himanshoe:pluck:1.0.0-alpha01")
}
```

## Usage

#### 01

Now, to start using Pluck, use the composable `Pluck` like,

```kotlin
Pluck(onPhotoSelected = {
// List of PluckImage when selecting from Gallery
}, onPhotoClicked = {
// Bitmap when using Camera
})
```

#### 02

Now, if you want `Pluck` to handle the Permission for you as well. Use it like,

```kotlin
Permission(
permissions = listOf(
Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE
),
goToAppSettings = {
// Go to App Settings
}
) {
Pluck(onPhotoSelected = {
// List of PluckImage when selecting from Gallery
}, onPhotoClicked = {
// Bitmap when using Camera
})
}
```

### Drop a ⭐ to keep me motivated to keep working on Open-Source. Updates coming Soon!

3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ android {
}

dependencies {
implementation(project(":pluck"))
// implementation(project(":pluck"))
implementation("com.himanshoe:Pluck:1.0.0-alpha01")

implementation(Deps.Compose.ui)
implementation(Deps.Compose.material)
Expand Down
Binary file added art/pluck.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@ buildscript {
classpath(Deps.Gradle.androidGradlePlugin)
classpath(Deps.Gradle.kotlinGradlePlugin)
classpath(Deps.Gradle.ktlintGradlePlugin)
classpath(Deps.Gradle.vanniktechGradlePlugin)
}
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
allprojects {
pluginManager.withPlugin(Plugins.vanniktechPublish) {
extensions.getByType(com.vanniktech.maven.publish.MavenPublishPluginExtension::class.java)
.apply {
sonatypeHost = com.vanniktech.maven.publish.SonatypeHost.S01
}
}
}
subprojects {
apply(plugin = Plugins.ktlint)
}
Expand Down
1 change: 1 addition & 0 deletions pluck/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ dependencies {
androidTestImplementation(Deps.AndroidTest.espressoCore)
androidTestApi(Deps.AndroidTest.uiTestJunit)
}
plugins.apply(Plugins.vanniktechPublish)
17 changes: 17 additions & 0 deletions pluck/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Maven
POM_ARTIFACT_ID=pluck
POM_NAME=pluck
POM_DESCRIPTION=A Compose Image Picker.
POM_PACKAGING=aar
POM_INCEPTION_YEAR=2022
GROUP=com.himanshoe
VERSION_NAME=1.0.0-alpha01
VERSION_CODE=1
POM_URL=https://github.com/hi-manshu
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_SCM_URL=https://github.com/hi-manshu
POM_DEVELOPER_ID=hi-manshu
POM_DEVELOPER_NAME=Himanshu Singh
POM_DEVELOPER_URL=https://github.com/hi-manshu

0 comments on commit 925cf83

Please sign in to comment.