Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] android – Splash screen GIF in react native

Posted on November 11, 2022 By

Solution 1 :

Have you tried Lottie yet. It is not Gif but very useful

Solution 2 :

As far as I am aware, react native only allows static images for the splash page. However a workaround that I found successful is to have a static splash screen transition into a screen containing the gif/animation which then transitions to your home screen after a timeout. You can set the splash to be identical to whatever the starting frame of your gif/animation is for continuity.

Here is a tutorial outlining how this can be achieved:

https://www.youtube.com/watch?v=MY6rE5plNIc

Problem :

I am making an application with react native with native code of android and ios, in the application specifications a splash screen with a GiF is required, I have already inserted the required dependencies of the documentation of react native

dependencies {
  // If your app supports Android versions before Ice Cream Sandwich (API level 14)
  implementation 'com.facebook.fresco:animated-base-support:1.3.0'

  // For animated GIF support
  implementation 'com.facebook.fresco:animated-gif:2.0.0'

  // For WebP support, including animated WebP
  implementation 'com.facebook.fresco:animated-webp:2.1.0'
  implementation 'com.facebook.fresco:webpsupport:2.0.0'

  // For WebP support, without animations
  implementation 'com.facebook.fresco:webpsupport:2.0.0'
}

GIF support works correctly within the screen / components. However, when I try to place the GIF on the splash screen it doesn’t work, there is a static image of the GIF

import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

public class SplashActivity extends AppCompatActivity {
     @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            Intent intent = new Intent(SplashActivity.this, MainActivity.class);
            startActivity(intent);
            finish();
        }
}


<?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns_android="http://schemas.android.com/apk/res/android">
        <item>
            <bitmap
                    android_gravity="center"
                    android_src="@drawable/splash_screen2"/>
        </item>
    </layer-list>

How can I place a splash screen in gif format?

Comments

Comment posted by hg20

No, I didn’t try, I will try with Lottie. Thanks for the recommendation

Comment posted by hg20

Do you know if it is possible to convert Gif to Lottie file?

READ  [FIXED] Android Kotlin Starting Activity From Utils Class Results In SavedInstanceState Being Null
Powered by Inline Related Posts

Android Tags:android, ios, react-native

Post navigation

Previous Post: [FIXED] java – How to solve debug issue
Next Post: [FIXED] android – How to solve setting up this payment problem – paypal

Related Posts

[FIXED] android – Unable to load resource file after refreshing the activity in language change Android
[FIXED] android layout – How to put NestedScrollView between LinearLayout and MaterialButton on ConstraintLayout? Android
[FIXED] android – Showing Image in ImageButton Android
[FIXED] android – Blocked By Play Protect occurs again after updating apk with the same signature Android
[FIXED] android – Animation with hero and showDialog in flutter Android
[FIXED] java – Resetting RecyclerView to its initail onCreate state Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • What is the rising action in Julius Caesar?
  • How do you secure a rope to itself?
  • Does waterproof laminate scratch easily?
  • What makes a building prewar?
  • What can you learn in a month without alcohol?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme