Git Product home page Git Product logo

compose-fractal-nav's People

Contributors

zach-klippenstein 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

compose-fractal-nav's Issues

Add support for multiplatform

This library looks cool, going through the dependencies, it seems that you don't depend on android only code, it could be migrated to compose-jb to make it available for Desktop as well(web and iOS in the future).

Support restoring navigation state from saved state

  • FractalNavState should have a Saver implementation that stores only the string key of the active child.
  • When restoring it puts that key in a property in the state: childToRestore: String.
  • When FractalNavChild is called it checks if the state has a key to restore. If that key matches its key, then during composition it updates the state to look as though a zoom in just finished: sets the state's activeChild and snaps the zoom factor to 1 (direction is left null). Since activeChild is now the current child, it won't call its movable content in place.
  • When the content finishes composing, the host will compose the now-active child itself, and immediately recompose to remove the content from the composition.
  • The content should have a layout modifier that checks if the content is about to be removed for this restore case and, if so, doesn't measure or place it.
  • If the content doesn't use SubcomposeLayout, that's it. When the content finishes
  • Otherwise, there are two more cases to handle since the child to restore might only be composed during the measure or placement phases.
  • If the content's layout modifier sees that the child to restore hasn't been composed yet, it should measure the content, then check again.
  • If the active child has been set after measure, that means it was subcomposed during measure. It should not place the content. The next composition will compose the child in the main composition.
  • If no active child has been set after measure, then place it and check again to see if it was subcomposed during placement.

In addition,

  • The content should check after every phase (composition, measure, placement) to see if a child is being restored, and only participate in as many phases as necessary to determine that. Subsequent phases should be skipped (don't measure, don't place, don't draw) to avoid unnecessary work but more importantly to avoid drawing the content on the first frame.
  • If the child to restore is subcomposed after the initial composition pass, then we need to make sure the child's movable content is actually present in the composition somewhere. We can still have it draw for the first frame: The host's composition should check if it is trying to restore a child but the child has not been composed yet after the content composable returns. If so, it should compose a SubcomposeLayout that checks for the child to restore after measure and placement passes, and if it finds one, subcomposes its movable content to fill the viewport. On the next frame, the subcompose layout will be removed and the movable content will be moved to the main composition.

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.