Skip to content

Commit

Permalink
Merge pull request #162 from Giphy/task/update-demo-2.1.9
Browse files Browse the repository at this point in the history
- update to SDK 2.1.9
  • Loading branch information
ALexanderLonsky committed Oct 25, 2021
2 parents 7c44f3f + dd50910 commit 802a8a0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
37 changes: 36 additions & 1 deletion Docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The latest release is available on [Maven Central](https://search.maven.org/arti

Add the GIPHY SDK dependency in the module ```build.gradle``` file:
```
implementation 'com.giphy.sdk:ui:2.1.8'
implementation 'com.giphy.sdk:ui:2.1.9'
```

### Basic Setup
Expand Down Expand Up @@ -165,6 +165,41 @@ settings.theme = GPHTheme.Dark
settings.setTheme(GPHTheme.Dark);
```

As of version `2.1.9` you can set a custom theme
##### kotlin
#
```kotlin
GPHCustomTheme.channelColor= 0xffD8D8D8.toInt()
GPHCustomTheme.handleBarColor = 0xff888888.toInt()
GPHCustomTheme.backgroundColor = 0xff121212.toInt()
GPHCustomTheme.dialogOverlayBackgroundColor = 0xFF4E4E4E.toInt()
GPHCustomTheme.textColor = 0xffA6A6A6.toInt()
GPHCustomTheme.activeTextColor = 0xff00FF99.toInt()
GPHCustomTheme.imageColor = 0xC09A9A9A.toInt()
GPHCustomTheme.activeImageColor = 0xFF00FF99.toInt()
GPHCustomTheme.searchBackgroundColor = 0xFF4E4E4E.toInt()
GPHCustomTheme.searchQueryColor = 0xffffffff.toInt()
GPHCustomTheme.suggestionBackgroundColor = 0xFF212121.toInt()
GPHCustomTheme.moreByYouBackgroundColor = 0xFFF1F1F1.toInt()
GPHCustomTheme.backButtonColor = 0xFFFFFFFF.toInt()

val settings = GPHSettings(theme = GPHTheme.Custom)
val dialog = GiphyDialogFragment.newInstance(settings)
dialog.show(supportFragmentManager, "gifs_dialog")
```
##### java
#
```java
GPHCustomTheme.INSTANCE.setBackgroundColor(0xff121212);

final GPHTheme theme = GPHTheme.Custom;
final GPHSettings settings = new GPHSettings();
settings.setTheme(theme);
final GiphyDialogFragment dialog = GiphyDialogFragment.Companion.newInstance(settings);
dialog.show(getSupportFragmentManager(), "giphy_dialog");
```


- **Media types**: Set the content type(s) you'd like to show by setting the `mediaTypeConfig` property, which is an array of `GPHContentType`s
<br> **Note**: Emoji only is not available for the carousel layout option.
##### kotlin
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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.1.8"
implementation "com.giphy.sdk:ui:2.1.9"
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation "com.squareup.leakcanary:leakcanary-android:1.6.3"
implementation "com.github.savvyapps:ToggleButtonLayout:1.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public GiphyDialogFragment show(final boolean withDarkTheme, @NonNull final Gi
settings.setSelectedContentType(GPHContentType.emoji);

settings.setGridType(GridType.waterfall);
settings.setTheme(GPHTheme.Light);
settings.setStickerColumnCount(3);
final GiphyDialogFragment dialog = GiphyDialogFragment.Companion.newInstance(settings);
dialog.setGifSelectionListener(listener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class SettingsDialogFragment : androidx.fragment.app.DialogFragment() {
GPHTheme.Light -> R.id.lightTheme
GPHTheme.Dark -> R.id.darkTheme
GPHTheme.Automatic -> R.id.autoTheme
else -> R.id.autoTheme
}, true
)
layoutSelector.setToggled(
Expand Down

0 comments on commit 802a8a0

Please sign in to comment.