Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/js-bhavyansh/splashscreen
- Owner: js-bhavyansh
- Created: 2024-06-24T15:00:09.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-06-24T16:03:58.000Z (8 months ago)
- Last Synced: 2024-11-18T07:27:50.326Z (3 months ago)
- Topics: android-application, jetpack-compose, kotlin, splashscreenapi
- Language: Kotlin
- Homepage:
- Size: 115 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.splashimport 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.
## ContactFor questions or feedback, please contact [@Bhavyansh03-tech](https://github.com/Bhavyansh03-tech).