Skip to content

Abdalsamee/CodeAlpha_RandomQuoteGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ Quote Generator

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.


Features

  • 🎨 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 via animateColorAsState.
  • 🪄 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).

Tech Stack

  • 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

Project Structure

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)

Getting Started

Prerequisites

  • 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.

Run it

  1. Clone the repo:
    git clone https://github.com/YOUR_USERNAME/quote-generator.git
  2. Open the project in Android Studio and let Gradle sync.
  3. Select an emulator or connected device.
  4. Press Run ▶. Tap New Quote to cycle quotes and watch the gradient transition.

Build an APK

Build → Build Bundle(s) / APK(s) → Build APK(s) — the debug APK lands in app/build/outputs/apk/debug/.


How It Works

  • Quotes live in QuoteData.kt as a simple List<Quote>. Add your own by appending Quote("...", "Author").
  • Background colors live in the gradients list at the top of QuoteScreen.kt as Color pairs. 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.

Customizing

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

License

This project is released under the MIT License. See LICENSE for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages