Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/js-bhavyansh/splashscreen

A Jetpack Compose Android app demonstrating an animated splash screen using the Splash Screen API and Animated Vector Drawables created with ShapeShifter.io.
https://github.com/js-bhavyansh/splashscreen

android-application jetpack-compose kotlin splashscreenapi

Last synced: 25 days ago
JSON representation

A Jetpack Compose Android app demonstrating an animated splash screen using the Splash Screen API and Animated Vector Drawables created with ShapeShifter.io.

Awesome Lists containing this project

README

        

# Animated Splash Screen in Jetpack Compose

Welcome to the repository for the Animated Splash Screen in Jetpack Compose project. This project demonstrates how to create an animated splash screen in a Jetpack Compose application using Kotlin in Android Studio. The splash screen is created using the new Splash Screen API and an animated vector drawable exported from ShapeShifter.io.

## Features

- Jetpack Compose for modern Android UI development.
- Splash Screen API for seamless splash screen integration.
- Animated Vector Drawable (AVD) for smooth and eye-catching animations.

## Getting Started

### Steps to Create the Project

1. **Create a New Project in Android Studio**
- Open Android Studio and create a new project.
- Choose an empty activity template and name your project.

2. **Add Splash Screen API Dependency**
- Open `build.gradle` (app-level) and add the Splash Screen API dependency:
```gradle
dependencies {
implementation 'androidx.core:core-splashscreen:1.0.0'
}
```
- Sync the project.

3. **Create a 192x192 Icon in Figma**
- Design your splash screen icon in Figma which should be under dimensions 192x192.
- Export the icon as an SVG file.

4. **Animate the Icon Using ShapeShifter.io**
- Open [ShapeShifter.io](https://shapeshifter.design/).
- Import the SVG file and create the desired animation.
- Export the animation as an Animated Vector Drawable (AVD).

5. **Add the AVD to Android Studio**
- Place the exported AVD file in the `res/drawable` directory of your project.

6. **Create Day and Night Themes**
- In the `res/values` directory, create two XML files, for example, `splash_theme.xml` and `splash_theme_night.xml`.
- Define a new theme in each file:
```xml



<item name="windowSplashScreenBackground">@color/white</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/avd_splashscreen</item>
<item name="windowSplashScreenAnimationDuration">1000</item>
<item name="postSplashScreenTheme">@style/Theme.Splash</item>




<item name="windowSplashScreenBackground">@color/white</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/avd_splashscreen</item>
<item name="windowSplashScreenAnimationDuration">1000</item>
<item name="postSplashScreenTheme">@style/Theme.Splash</item>


```

7. **Update AndroidManifest.xml**
- Set the new splash screen theme as the theme for your main activity:
```xml

// Here change the theme.





```

8. **Initialize Splash Screen in MainActivity**
- In `MainActivity.kt`, call `installSplashScreen()`:
```kotlin
package com.example.splash

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.example.splash.ui.theme.SplashTheme

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

// Installing Splash Screen :->
installSplashScreen()

enableEdgeToEdge()
setContent {
SplashTheme {}
}
}
}
```

## Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

1.> Fork the Project.\
2.> Create your Feature Branch `git checkout -b feature/AmazingFeature`.\
3.> Commit your Changes `git commit -m 'Add some AmazingFeature'`.\
4.> Push to the Branch `git push origin feature/AmazingFeature`.\
5.> Open a Pull Request

## Acknowledgements

- Inspiration from various Android development tutorials and documentation.
## Contact

For questions or feedback, please contact [@Bhavyansh03-tech](https://github.com/Bhavyansh03-tech).