Skip to content

Instantly share code, notes, and snippets.

@yrezgui
Last active November 20, 2023 23:53
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save yrezgui/26a1060d67bf0ec2a73fa12695166436 to your computer and use it in GitHub Desktop.
Save yrezgui/26a1060d67bf0ec2a73fa12695166436 to your computer and use it in GitHub Desktop.
Compose tutorial sample data
package com.example.compose.tutorial
object SampleData {
// Sample conversation data
val conversationSample = listOf(
Message(
"Colleague",
"Test...Test...Test..."
),
Message(
"Colleague",
"List of Android versions:\n" +
"Android KitKat (API 19)\n" +
"Android Lollipop (API 21)\n" +
"Android Marshmallow (API 23)\n" +
"Android Nougat (API 24)\n" +
"Android Oreo (API 26)\n" +
"Android Pie (API 28)\n" +
"Android 10 (API 29)\n" +
"Android 11 (API 30)\n" +
"Android 12 (API 31)\n"
),
Message(
"Colleague",
"I think Kotlin is my favorite programming language.\n" +
"It's so much fun!"
),
Message(
"Colleague",
"Searching for alternatives to XML layouts..."
),
Message(
"Colleague",
"Hey, take a look at Jetpack Compose, it's great!\n" +
"It's the Android's modern toolkit for building native UI." +
"It simplifies and accelerates UI development on Android." +
"Less code, powerful tools, and intuitive Kotlin APIs :)"
),
Message(
"Colleague",
"It's available from API 21+ :)"
),
Message(
"Colleague",
"Writing Kotlin for UI seems so natural, Compose where have you been all my life?"
),
Message(
"Colleague",
"Android Studio next version's name is Arctic Fox"
),
Message(
"Colleague",
"Android Studio Arctic Fox tooling for Compose is top notch ^_^"
),
Message(
"Colleague",
"I didn't know you can now run the emulator directly from Android Studio"
),
Message(
"Colleague",
"Compose Previews are great to check quickly how a composable layout looks like"
),
Message(
"Colleague",
"Previews are also interactive after enabling the experimental setting"
),
Message(
"Colleague",
"Have you tried writing build.gradle with KTS?"
),
)
}
@moocstudent
Copy link

thanks very much.

@oriohac
Copy link

oriohac commented Aug 18, 2023

thanks very much.

You're welcome, glad that my response helped out.

@zenikigai
Copy link

To import it right click in Project tab, Android selected in dropdown.

Right-click on app > java > dev.yourname.composetutorial then New > Kotlin Class/File and just paste content from this gist.

image image

THIS!!!! thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment