Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,19 @@ android {
}
}

buildscript {
repositories {
mavenCentral()
}
}
allprojects {
repositories {
mavenCentral()
}
}

dependencies {
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.8'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.facebook.react:react-native:+'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

import java.lang.ref.WeakReference;

import pl.droidsonroids.gif.GifImageView;


public class RCTSplashScreen {

Expand All @@ -23,7 +25,7 @@ public class RCTSplashScreen {
public static final int UIAnimationScale = 2;

private static Dialog dialog;
private static ImageView imageView;
private static GifImageView imageView;

private static WeakReference<Activity> wr_activity;

Expand All @@ -36,10 +38,10 @@ public static void openSplashScreen(Activity activity) {
}

public static void openSplashScreen(Activity activity, boolean isFullScreen) {
openSplashScreen(activity, isFullScreen, ImageView.ScaleType.CENTER_CROP);
openSplashScreen(activity, isFullScreen, GifImageView.ScaleType.CENTER_CROP);
}

public static void openSplashScreen(final Activity activity, final boolean isFullScreen, final ImageView.ScaleType scaleType) {
public static void openSplashScreen(final Activity activity, final boolean isFullScreen, final GifImageView.ScaleType scaleType) {
if (activity == null) return;
wr_activity = new WeakReference<>(activity);
final int drawableId = getImageId();
Expand All @@ -51,7 +53,7 @@ public void run() {

if(!getActivity().isFinishing()) {
Context context = getActivity();
imageView = new ImageView(context);
imageView = new GifImageView(context);

imageView.setImageResource(drawableId);

Expand Down