ConorOkus / uMlando-wallet

Lightning Dev Kit Android Demo Wallet
17 stars 9 forks source link

Add navigation and a few screens #11

Closed thunderbiscuit closed 1 year ago

thunderbiscuit commented 1 year ago

I really tried to keep this PR from getting too big but clearly it got away from me. Not only that, but I also had to do a rebase on commits I had not brought in when I started; I'm sorry if this is a bit of a pain to review.

Overall, I aimed to keep the UI very simple and mostly just bring the structure required for further changes. My main idea was to create a bottom navbar with two core screens: a wallet/balance screen to eventually make transactions, and a settings screen with all of the options and extra things that a user needs to do. Each of those options/settings is a button that leads you to a dedicated screen for that feature (opening a channel, connecting to a peer, etc.)

Here is basically what it brings in:

Here are the cliff notes:

  1. The onchain wallet is now being created/restored automatically upon startup in the DispatchActivity. If the file with the mnemonic exists it uses it and restores the wallet, otherwise it creates a new mnemonic and uses that.
  2. The bottom bar works the following way: I have a container screen called HomeScreen, which contains a bottom nav bar and a sort empty container space above it, in which we place the other screens. The two screens available from the navbar are the Wallet and the Settings. From the settings screen, you can launch into different small sort of "sub-screens" (some of those could be turned into bottom sheets at some point too). The interesting file to take a look at is Navigation.kt. This is the core of the new navigation system using the Compose libraries.
  3. I removed a few unused imports, added 3 icons.
ConorOkus commented 1 year ago

tACK

This is fantastic thanks for contributing to this. It's very timely as we move towards the end of building out the very basic functionality. I've skimmed through and it looks mostly straightforward so will attempt to add in a few of screens using the same pattern!