Jetpack compose App Intro

Overview

App Intro (Experimental)

Jetpack compose App Intro.

Google

License Profile


Who's using App Intro?

👉 Check out who's using App Intro

Include in your project

Maven Central

Gradle

Add the dependency below to your module's build.gradle file:

dependencies {
    implementation("io.github.androidpoet:appintro:1.0.0")
}

Create AppIntro

Create an instance of the AppIntro.

Screen1() Screens.Screen2 -> Screen2() Screens.Screen3 -> Screen3() } } ">
	    
  var targetScreen by remember { mutableStateOf(Screens.Screen1) }

    val transition = updateTransition(targetScreen, label = "")
    transition.AppIntro(
      modifier = Modifier
        .fillMaxSize()
        .weight(0.8f),
      transitionSpec = {
        EnterExitTransition(
          getEnterAnimation(500, Easing.LinearEasing, EnterAnimation.SharedAxisXForward),
          getExitAnimation(500, Easing.LinearEasing, ExitAnimation.SharedAxisXBackward)
        )
      }
    ) {
      when (it) {
        Screens.Screen1 -> Screen1()
        Screens.Screen2 -> Screen2()
        Screens.Screen3 -> Screen3()
      }
    }
	  
	  

Create Enum for Composable

Create an instance of the Screens and Composable.

enum class Screens {
  Screen1,
  Screen2,
  Screen3
}

val items = OnBoardingItem.get()

@Composable
fun Screen1() {
  OnBoardingItem(items[0])
}

@Composable
fun Screen2() {
  OnBoardingItem(items[1])
}

@Composable
fun Screen3() {
  OnBoardingItem(items[2])
}
  

Create Data for Composable

Create an instance of the `Composable Data.

class OnBoardingItem(
  var title: Int,
  var text: Int,
  var image: Int,
) {

  companion object {

    fun get(): List<OnBoardingItem> {
      return listOf(
        OnBoardingItem(R.string.onBoardingTitle1, R.string.onBoardingText1, R.drawable.undraw_a),
        OnBoardingItem(R.string.onBoardingTitle2, R.string.onBoardingText2, R.drawable.undraw_b),
        OnBoardingItem(R.string.onBoardingTitle3, R.string.onBoardingText3, R.drawable.undraw_c),
      )
    }
  }
}

@Composable
fun OnBoardingItem(
  item: OnBoardingItem
) {
  Column(
    horizontalAlignment = Alignment.CenterHorizontally,
    verticalArrangement = Arrangement.Center,
    modifier = Modifier.fillMaxSize()
  ) {
    Image(painter = painterResource(item.image), contentDescription = null)

    Text(
      text = stringResource(item.title),
      fontSize = 24.sp,
      color = MaterialTheme.colors.onBackground,
      fontWeight = FontWeight.Bold
    )

    Text(
      text = stringResource(item.text),
      color = MaterialTheme.colors.onBackground.copy(alpha = 0.8f),
      textAlign = TextAlign.Center
    )
  }
}

  

Supported Animations

Enter Animations

 EnterAnimation.FadeIn
 EnterAnimation.SharedAxisXForward
 EnterAnimation.SharedAxisYForward
 EnterAnimation.SharedAxisZForward
 EnterAnimation.ElevationScale
 EnterAnimation.SlideIn
 EnterAnimation.SlideInHorizontally
 EnterAnimation.SlideInVertically
 EnterAnimation.ScaleIn
 EnterAnimation.ExpandIn
 EnterAnimation.ExpandHorizontally
 EnterAnimation.ExpandVertically

Exit Animations

 ExitAnimation.FadeOut
 ExitAnimation.SharedAxisXBackward
 ExitAnimation.SharedAxisYBackward
 ExitAnimation.SharedAxisZBackward
 ExitAnimation.ElevationScale
 ExitAnimation.SlideOut
 ExitAnimation.SlideOutHorizontally
 ExitAnimation.SlideOutVertically
 ExitAnimation.ScaleOut
 ExitAnimation.ShrinkOut
 ExitAnimation.ShrinkHorizontally
 ExitAnimation.ShrinkVertically

Easing

Easing.FastOutSlowInEasing
Easing.LinearOutSlowInEasing
Easing.FastOutLinearInEasing
Easing.LinearEasing

Demo

Find this repository useful? ❤️

Support it by joining stargazers for this repository.
Also, follow me on GitHub for cool projects! 🤩

Inspiration

This library was inspired by Repo.

License

Copyright 2022 AndroidPoet (Ranbir Singh)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
 limitations under the License.
You might also like...
An application that i developed with a aim of learning Jetpack compose and many other jetpack libraries
An application that i developed with a aim of learning Jetpack compose and many other jetpack libraries

An application that i developed with a aim of learning Jetpack compose and many other jetpack libraries, The application make use of jikan Api which displays a list of animations,there more details and even trailers of the animations.

A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many compose features are not yet available.
A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many compose features are not yet available.

Multiplatform Compose A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many comp

K5-compose is a sketchy port of p5.js for Jetpack Compose
K5-compose is a sketchy port of p5.js for Jetpack Compose

k5-compose k5-compose is a sketchy port of P5.js for Jetpack Compose Desktop. This library provides you a playground to play with your sketches so you

Jetpack Compose based project, used to stress-testing compose features / integrations and explore non-trivial functionality

Project containing Jetpack Compose samples For pagination & network images it uses CATAAS. Known issues Navigation-Compose Issue with fast tapping on

Pokedex Compose is an independent re-write of a demo application by the name of Pokedex, but written in jetpack compose.
Pokedex Compose is an independent re-write of a demo application by the name of Pokedex, but written in jetpack compose.

Pokedex Compose Pokedex Compose is an independent re-write of a similar project by the name of Pokedex. I am recreating the UI but I am doing it using

Compose-Instagram-Profile-UI - Instagram profile screen UI using android jetpack compose
Compose-Instagram-Profile-UI - Instagram profile screen UI using android jetpack compose

Compose-Intsgram-Profile-UI Instagram profile screen UI using android jetpack co

List-programminglanguage-compose - Simple implementation of a list of programming languages using LazyColumn and Coil in Jetpack Compose Lock Screen-Compose - Lock Screen with Jetpack Compose
Lock Screen-Compose - Lock Screen with Jetpack Compose

Lock_Screen-Compose 此專案為Jetpack Compose練習題.

Compose-Ratingbar-library - A simple implementation for rating bar in Jetpack Compose

Compose-Ratingbar-library - A simple implementation for rating bar in Jetpack Compose

Releases(1.0.0)
Owner
Ranbir Singh
Android Developer • Android Poet•Open Source Contributor•Obsessed with Animations. #DevelopWithGoogle
Ranbir Singh
This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.

JetBMICalculator This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Co

BHAVNA THACKER 3 Dec 31, 2022
Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

MindOrks 382 Jan 5, 2023
Jetpack Compose Boids | Flocking Insect 🐜. bird or Fish simulation using Jetpack Compose Desktop 🚀, using Canvas API 🎨

?? ?? ?? Compose flocking Ants(boids) ?? ?? ?? Jetpack compose Boids | Flocking Insect. bird or Fish simulation using Jetpack Compose Desktop ?? , usi

Chetan Gupta 38 Sep 25, 2022
A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Why Not Compose! A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Md. Mahmudul Hasan Shohag 186 Jan 1, 2023
Jetpack-Compose-Demo - Instagram Profile UI using Jetpack Compose

Jetpack-Compose-Demo Instagram Profile UI using Jetpack Compose

omar 1 Aug 11, 2022
Jetpack-compose-animations-examples - Cool animations implemented with Jetpack compose

Jetpack-compose-animations-examples This repository consists of 4 animations: St

Canopas Software 180 Jan 2, 2023
Compose-navigation - Set of utils to help with integrating Jetpack Compose and Jetpack's Navigation

Jetpack Compose Navigation Set of utils to help with integrating Jetpack Compose

Adam Kobus 5 Apr 5, 2022
Jetpack-compose-uis - A collection of some UIs using Jetpack Compose. built using Katalog

Jetpack Compose UIs This is a collection of some UIs using Jetpack Compose. It i

Mori Atsushi 3 Dec 15, 2022
A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose

Authentication A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose Scree

Felix Kariuki 5 Dec 29, 2022
A Simple Blog App using Jetpack Compose, Flow, Navigation Compose, Room and Firebase

BlogCompose A Simple Blog App using Jetpack Compose, Flow, Navigation Compose, Room and Firebase Instructions Download your Firebase configuration fil

null 4 Oct 10, 2022