A clean, minimal Random Quote Generator for Android — built entirely with Jetpack Compose and Material 3, with premium touches: an animated pastel gradient background, a frosted-glass quote card, and elegant serif typography. 100% offline, no APIs, no network.
- 🎨 Animated gradient background — every new quote smoothly transitions the screen to a new soft pastel gradient, with blurred decorative orbs for depth.
- 💎 Frosted-glass card — translucent surface, thin light border, soft shadow, and rounded 28.dp corners, with a large faint quotation mark behind the text.
- ✒️ Editorial serif typography — prominent serif quote text with comfortable line height; italic author aligned bottom-right with an em dash.
- 🔄 Smooth motion — the quote fades and gently slides on each change via
AnimatedContent; the gradient blends viaanimateColorAsState. - 🪄 Bouncy primary button — the "New Quote" button scales down with a spring on press.
- 📋 Copy to clipboard and 📤 native Android share sheet.
- 📦 Fully offline — 15 curated quotes hardcoded locally. No external API, no network permission.
- ➖ Zero extra icon dependencies — uses only built-in Material icons plus one inline vector (no
material-icons-extended).
- Language: Kotlin
- UI Toolkit: Jetpack Compose
- Design System: Material 3
- Animation: Compose Animation APIs (
AnimatedContent,animateColorAsState,animateFloatAsState) - State:
remember+mutableIntStateOf - Build: Gradle (Kotlin DSL) with version catalog
com.example.quotegenerator/
├── MainActivity.kt // Entry point — wires theme to the screen
├── data/
│ ├── Quote.kt // data class Quote(text, author)
│ └── QuoteData.kt // the 15 quotes
├── ui/
│ ├── QuoteCard.kt // frosted serif quote card + text transition
│ └── QuoteScreen.kt // gradient background, orbs, state, controls
└── layout/theme/
├── Color.kt // color palette
├── Type.kt // typography
└── Theme.kt // QuoteGeneratorTheme (Material You + light/dark)
- Android Studio (latest stable)
- Android SDK with minimum API 24 (Android 7.0)
Note: the blurred background orbs render as true blur on Android 12+ (API 31+); on older devices they appear as soft translucent circles.
- Clone the repo:
git clone https://github.com/YOUR_USERNAME/quote-generator.git
- Open the project in Android Studio and let Gradle sync.
- Select an emulator or connected device.
- Press Run ▶. Tap New Quote to cycle quotes and watch the gradient transition.
Build → Build Bundle(s) / APK(s) → Build APK(s) — the debug APK lands in app/build/outputs/apk/debug/.
- Quotes live in
QuoteData.ktas a simpleList<Quote>. Add your own by appendingQuote("...", "Author"). - Background colors live in the
gradientslist at the top ofQuoteScreen.ktasColorpairs. Each "New Quote" picks a new pair, and the two endpoint colors animate to produce a smooth gradient blend. - State is held with
remember { mutableIntStateOf(...) }for the current quote index and gradient index;showNextQuote()advances both to new random values different from the current ones.
| Want to change... | Edit... |
|---|---|
| The quotes | quotes list in data/QuoteData.kt |
| Background colors | gradients list in ui/QuoteScreen.kt |
| Card style / fonts | QuoteCard.kt |
| App theme / Material You | layout/theme/Theme.kt |
| App name | app_name in res/values/strings.xml |
This project is released under the MIT License. See LICENSE for details.