Skip to content

Commit

Permalink
Merge pull request #95 from Giphy/task/update-demo-2.0.4
Browse files Browse the repository at this point in the history
- update to SDK 2.0.4
  • Loading branch information
ALexanderLonsky authored Oct 28, 2020
2 parents eb92eb8 + 7ea9daa commit cb52a49
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions Docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ maven {

Then add the GIPHY SDK dependency in the module ```build.gradle``` file:
```
implementation 'com.giphy.sdk:ui:2.0.3'
implementation 'com.giphy.sdk:ui:2.0.4'
```

### Basic Setup
Expand Down Expand Up @@ -56,7 +56,7 @@ Configure the SDK with your API key. Apply for a new __Android SDK__ key. Please

Create a new instance of `GiphyDialogFragment`, which takes care of all the magic. Adjust the layout and theme by passing a `GPHSettings` object when creating the dialog.

``` kotlin
```kotlin
val settings = GPHSettings(GridType.waterfall, GPHTheme.Dark)
```

Expand All @@ -66,6 +66,18 @@ Instantiate a `GiphyDialogFragment` with the settings object.
val gifsDialog = GiphyDialogFragment.newInstance(settings)
```

#### `Fresco` initialization
The SDK has special `Fresco` setup to support our use case, though this should not pose any conflicts with your use of `Fresco` outside of the GIPHY SDK.
You can use our `GiphyFrescoHandler`:
``` kotlin
Giphy.configure(context, YOUR_API_KEY, verificationMode, frescoHandler = object : GiphyFrescoHandler {
override fun handle(imagePipelineConfigBuilder: ImagePipelineConfig.Builder) {
}
override fun handle(okHttpClientBuilder: OkHttpClient.Builder) {
}
}
```

#### `GPHSettings` properties

- **GPHTheme**: set the theme to be `Dark`, `Light` or `Automatic` which will match the application's `Night Mode` specifications for android P and newer. If you don't specify a theme, `Automatic` mode will be applied by default.
Expand Down Expand Up @@ -128,6 +140,12 @@ settings.useBlurredBackground = true
```kotlin
settings.stickerColumnCount: Int = 3
```
- **Suggestions bar**: As of version `2.0.4` you can hide suggestions bar
```kotlin
settings.showSuggestionsBar = false
```
#### Presentation
Show your `GiphyDialogFragment` using the `SupportFragmentManager` and watch as the GIFs start flowin'.

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
implementation "com.google.android.material:material:1.1.0"
implementation "com.giphy.sdk:ui:2.0.3"
implementation "com.giphy.sdk:ui:2.0.4"
implementation "com.squareup.leakcanary:leakcanary-android:1.6.3"
implementation "com.github.savvyapps:ToggleButtonLayout:1.2.0"
implementation "androidx.gridlayout:gridlayout:1.0.0"
Expand Down

0 comments on commit cb52a49

Please sign in to comment.