Skip to content

Commit

Permalink
android: Fix animated GIFs in lightbox, by getting Fresco version aut…
Browse files Browse the repository at this point in the history
…omatically

This follows upstream's instructions:

  Note: the version listed above may not be updated in time. Please
  check `ReactAndroid/gradle.properties` in the main repo to see which
  fresco version is being used in a specific tagged version.

  https://reactnative.dev/docs/0.67/image#gif-and-webp-support-on-android

except in an automated way.  Happily this is even reasonably clean.

Fixes: #5607
  • Loading branch information
gnprice committed Dec 14, 2022
1 parent 0f5d771 commit b301e9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ def reactNativeArchitectures() {
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

// Useful for syncing dependency versions from RN upstream.
def rnProperties = new Properties()
rnProperties.load(new FileInputStream(file("../../node_modules/react-native/ReactAndroid/gradle.properties")))

android {
defaultConfig {
applicationId "com.zulipmobile"
Expand Down Expand Up @@ -219,7 +223,8 @@ dependencies {

// ==== RN-related dependencies

implementation 'com.facebook.fresco:animated-gif:2.0.0' // For animated GIF support
// For animated GIF support:
implementation "com.facebook.fresco:animated-gif:${rnProperties.get('FRESCO_VERSION')}"

// Workaround for facebook/react-native#32735; see
// https://github.com/facebook/react-native/issues/32735#issue-1077061487
Expand Down

0 comments on commit b301e9d

Please sign in to comment.