Skip to content

Commit

Permalink
Merge pull request #136 from Giphy/task/update-demo-2.1.1
Browse files Browse the repository at this point in the history
- update to SDK 2.1.1
  • Loading branch information
ALexanderLonsky authored Jun 18, 2021
2 parents adee6a6 + 16cd1d3 commit 1c4f33a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 41 deletions.
8 changes: 2 additions & 6 deletions 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.0'
implementation 'com.giphy.sdk:ui:2.1.1'
```

### Basic Setup
Expand Down Expand Up @@ -132,11 +132,7 @@ settings.confirmationRenditionType = RenditionType.original
settings.showCheckeredBackground = true
```
- **Blurred Background**: Use a translucent blurred background of the template container
```
settings.useBlurredBackground = true
```
- **Stickers Column Count**: Customise the number of columns for stickers (Accepted values between 2 and 4). We recommend using 3 columns for blurred mode.
- **Stickers Column Count**: Customise the number of columns for stickers (Accepted values between 2 and 4).
```kotlin
settings.stickerColumnCount: Int = 3
```
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.1.0"
implementation "com.giphy.sdk:ui:2.1.1"
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
2 changes: 1 addition & 1 deletion app/src/main/java/com/giphy/sdk/uidemo/DemoActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DemoActivity : AppCompatActivity() {
val INVALID_KEY = "NOT_A_VALID_KEY"
}

var settings = GPHSettings(gridType = GridType.waterfall, useBlurredBackground = false, theme = GPHTheme.Light, stickerColumnCount = 3)
var settings = GPHSettings(gridType = GridType.waterfall, theme = GPHTheme.Light, stickerColumnCount = 3)
var feedAdapter: MessageFeedAdapter? = null
var messageItems = ArrayList<FeedDataItem>()

Expand Down
11 changes: 0 additions & 11 deletions app/src/main/java/com/giphy/sdk/uidemo/DemoApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,4 @@ import android.app.Application
import com.squareup.leakcanary.LeakCanary

class DemoApplication : Application() {
override fun onCreate() {
super.onCreate()
if (BuildConfig.FLAVOR == "debug") {
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return
}
LeakCanary.install(this)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class SettingsDialogFragment : androidx.fragment.app.DialogFragment() {
}
showAttributionCheck.isChecked = settings.showAttribution
showConfirmationScreen.isChecked = settings.showConfirmationScreen
useBlurredBackground.isChecked = settings.useBlurredBackground
showCheckeredBackground.isChecked = settings.showCheckeredBackground

themeSelector.onToggledListener = { toggle, selected ->
Expand Down Expand Up @@ -122,7 +121,6 @@ class SettingsDialogFragment : androidx.fragment.app.DialogFragment() {
settings.mediaTypeConfig = contentTypes.toTypedArray()
settings.showAttribution = showAttributionCheck.isChecked
settings.showConfirmationScreen = showConfirmationScreen.isChecked
settings.useBlurredBackground = useBlurredBackground.isChecked
settings.showCheckeredBackground = showCheckeredBackground.isChecked
dismissListener(settings)
super.onDismiss(dialog)
Expand Down
13 changes: 1 addition & 12 deletions app/src/main/res/layout/fragment_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/showAttributionCheck" />

<CheckBox
android:id="@+id/useBlurredBackground"
style="@style/SettingHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="Use blurred background"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/showConfirmationScreen" />

<CheckBox
android:id="@+id/showCheckeredBackground"
style="@style/SettingHeader"
Expand All @@ -149,7 +138,7 @@
android:layout_marginTop="16dp"
android:text="Show checkered background (stickers)"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/useBlurredBackground" />
app:layout_constraintTop_toBottomOf="@+id/showConfirmationScreen" />
<TextView
android:id="@+id/renditionTitle"
style="@style/SettingHeader"
Expand Down
8 changes: 3 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.1")
classpath("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50")
classpath("com.android.tools.build:gradle:4.1.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20")
}
}

allprojects {
repositories {
jcenter()
maven("https://jitpack.io")
mavenLocal()
mavenCentral()
Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Oct 10 17:42:40 EEST 2019
#Fri Jun 18 14:08:47 EEST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 1c4f33a

Please sign in to comment.