Code Monkey home page Code Monkey logo

wellingtoncabral / android-compose-mvi-navigation Goto Github PK

View Code? Open in Web Editor NEW
92.0 92.0 16.0 11.59 MB

GithubCompose is a sample project that uses Compose + MVI + Navigation Component to presents a modern approach to Android app development.

Kotlin 100.00%
android coil coil-kotlin coroutines-android coroutines-flow coroutines-flow-mvi jetpack-compose kotlin kotlin-android material-design mvi mvi-android navigation-architecture-component retrofit

android-compose-mvi-navigation's People

Contributors

wellingtoncabral avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

android-compose-mvi-navigation's Issues

Navigation screens composed multiple times

First of all: thanks for this fine application architecture!

I have copied the architectural approach for my project (a Virtual Run App similar to Zwift) and everything runs fine, except for one thing: I noticed that when navigating to a different screen the start screen is recomposed even though it is not visible.
Since I'm an absolute newbie in Kotlin/Koin/Compose/Navigation (but experienced Linux kernel programmer), I checked to see if this issue also is present in the "master" code.

If I add 'Log.d' calls to 'AppNavigation.kt`, and start the app, then the logs show:

D/VRUN: AppNavigation: navigateToRepos - wycats
D/VRUN: AppNavigation: NavHost - Users
D/VRUN: AppNavigation: NavHost - Repos
D/VRUN: AppNavigation: NavHost - Repos
D/MIUIInput: [KeyEvent] ViewRootImpl KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x48, repeatCount=0, eventTime=1659049858, downTime=1659049858, deviceId=-1, source=0x101, displayId=0 }
D/MIUIInput: [KeyEvent] ViewRootImpl KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x48, repeatCount=0, eventTime=1659049952, downTime=1659049858, deviceId=-1, source=0x101, displayId=0 }
D/VRUN: AppNavigation: NavHost - Repos
D/VRUN: AppNavigation: NavHost - Users
D/VRUN: AppNavigation: NavHost - Users
D/VRUN: AppNavigation: navigateToRepos - ivey
D/VRUN: AppNavigation: NavHost - Users
D/VRUN: AppNavigation: NavHost - Repos
D/VRUN: AppNavigation: NavHost - Repos

So navigation to user wycats is invoking the USERS screen again before calling REPOS twice.
Also when going back, the sequence also seems strange: REPOS again and then USERS twice.
And of course, as the screen is recomposed, all composables down the tree are also recomposed.

This does not seem right...
Thanks in advance,
Ewald

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.