Skip to content

[TASK] Create navigation root in mobile app #54

@PavMash

Description

@PavMash

Description

Start writing navigation in Android app. Create RootComponent class using Decompose framework. Integrate the component into the MainActivity. We use Decompose because it is KMP-compatible and it could make possible future migration to KMP significantly easier.

To do

  • Add Decompose dependency to the app module build.gradle.kts file: implementation "com.arkivanov.decompose:decompose:3.5.0"
  • Inside app module in src/main/java/com/examhacker/mobile directory (use Project file-tree view mode) create file RootComponent.kt. Inside of it create interface IRootComponent and class RootComponent that implements it (check Decompose docs for details).
  • IRootComponent must include public field stack that is app navigation stack and sealed class Child, which inheritors must have constructor argument of feature component type. Each inheritor of Child represents exactly one feature.
  • RootComponent must override and initialize stack field using childStack function (check docs). Also, RootComponent must include private field 'navigation' of StackNavigation type and Config sealed class that must be serializable.
  • Add rootComponent field creation to MainActivity onCreate() method. In the setContent function body use Children function to specify UI-composables for each child of RootComponent (check docs).

Notes

Decompose official repository
Decompose documentation with AI-assistant
Decompose regular documentation
A good video about Decompose basics

Acceptance Criteria

  • The project builds successfully.
  • Code is of high-quality and follows best practices.
  • RootComponent.kt and MainActivity.kt follows recommended structure from the Decompose docs.

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

Status
In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions