Skip to content

Implement Headlines landing screen with Jetpack Compose MVVM architecture#5

Draft
Copilot wants to merge 7 commits intomasterfrom
copilot/create-landing-screen
Draft

Implement Headlines landing screen with Jetpack Compose MVVM architecture#5
Copilot wants to merge 7 commits intomasterfrom
copilot/create-landing-screen

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 20, 2025

Creates the initial Headlines screen as the app's first landing view, displaying article headlines with sample data.

Implementation

UI Layer

  • HeadlinesScreen composable with LazyColumn for article list
  • ArticleItem card component showing title, description, author, source, thumbnail (80x80dp via Coil), and save button
  • Material 3 theming with dynamic colors
  • State handling for loading/error/success

Business Logic

  • HeadlinesViewModel with StateFlow<HeadlinesUiState> for reactive state management
  • Sample data initialization (5 articles across tech, climate, business, health, science)
  • saveArticle() stub ready for Room integration

Navigation & Infrastructure

  • MainActivity with bottom nav (Headlines/Sources/Saved) and NavHost
  • Hilt DI configured (@HiltAndroidApp, @HiltViewModel)
  • Navigation sealed class for type-safe routes
  • Placeholder screens for Sources and Saved tabs

Testing

  • 6 unit tests for HeadlinesViewModel covering state, data structure, business logic

Example Usage

@Composable
fun HeadlinesScreen(
    viewModel: HeadlinesViewModel = hiltViewModel(),
    onArticleClick: (Article) -> Unit
) {
    val uiState by viewModel.uiState.collectAsState()
    
    when {
        uiState.articles.isNotEmpty() -> ArticlesList(...)
        uiState.isLoading -> CircularProgressIndicator()
        uiState.error != null -> ErrorMessage(...)
    }
}

Ready for Integration

  • Retrofit/NewsAPI: Add ArticleRepository and inject into ViewModel
  • Room: Implement saveArticle() with DAO
  • DataStore: Configure source selection persistence
  • WebView: Wire onArticleClick to Accompanist WebView screen

Documentation

Added 8 markdown files covering architecture diagrams, setup instructions, UI specifications, and visual previews.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.2-bin/bbg7u40eoinfdyxsxr3z4i7ta/gradle-8.2/lib/gradle-launcher-8.2.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.2-bin/bbg7u40eoinfdyxsxr3z4i7ta/gradle-8.2/lib/agents/gradle-instrumentation-agent-8.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.2 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

write the first landing screen of android app on the basis of the prolem statement given in the readme.md


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 6 commits November 20, 2025 00:34
Co-authored-by: param-virsingh <178531836+param-virsingh@users.noreply.github.com>
Co-authored-by: param-virsingh <178531836+param-virsingh@users.noreply.github.com>
Co-authored-by: param-virsingh <178531836+param-virsingh@users.noreply.github.com>
Co-authored-by: param-virsingh <178531836+param-virsingh@users.noreply.github.com>
Co-authored-by: param-virsingh <178531836+param-virsingh@users.noreply.github.com>
Copilot AI changed the title [WIP] Add first landing screen for Android app Implement Headlines landing screen with Jetpack Compose MVVM architecture Nov 20, 2025
Copilot AI requested a review from param-virsingh November 20, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants