Skip to content

Additional Android functionality#61

Closed
FeralAI wants to merge 34 commits into
wix:masterfrom
the-mx-group:master
Closed

Additional Android functionality#61
FeralAI wants to merge 34 commits into
wix:masterfrom
the-mx-group:master

Conversation

@FeralAI
Copy link
Copy Markdown

@FeralAI FeralAI commented Jun 9, 2016

I started looking into your library recently and was excited by the prospect of a single package to drive native navigation, but was a little discouraged when I saw a good portion of the example application wasn't working on Android. Given that and a little interest in RN modules I started poking around the project trying to get things working, with the result being this PR. Here's what I have so far:

  • Added Android screen API for:
    • popToRoot
    • resetTo
    • setTitle
    • setTabBadge
    • switchToTab
    • toggleNavBar
    • toggleTabs
  • Fixed modal close after 1.0.9 update (missing super call)
  • Fixed error when popping, previously allowed popping past last screen on the stack
  • Refactored example app so screens aren't platform-specific

A couple things I was having issues with (or just don't know enough about yet):

  • ActionBar show/hide animation: I was able to animate the toolbar content using .animate(), but I'm not sure why the ActionBar container isn't animating (at least on my devices).
  • Modal background is transparent: I've added a bg color for the inital modal in the example so the text doesn't overlap, but I haven't dug into this issue far enough to know the cause.

This mostly gets the example app working on par with the iOS version, except lightbox which isn't currently implemented.

Jason Skuby added 26 commits June 8, 2016 10:06
# Conflicts:
#	android/app/src/main/java/com/reactnativenavigation/activities/SingleScreenActivity.java
#	android/app/src/main/java/com/reactnativenavigation/modal/RnnModal.java
…ionStyle, is called is all derived methods
@FeralAI
Copy link
Copy Markdown
Author

FeralAI commented Jun 11, 2016

Looks like there's some bugs with this currently. I'm working on getting this integrated with an app I'm currently working on, so I'll be updating over the next few days.

@FeralAI
Copy link
Copy Markdown
Author

FeralAI commented Jun 13, 2016

Didn't mean to merge that last set of changes, but the good news is there's a basic menu implementation now. I know there's a lot of code here and it needs some cleanup, but hopefully it can be useful to get more Android features going. I've recorded a demo of the example project running against our branch here: https://youtu.be/KWcZgAyZXJw. I'm going to be integrating our branch into a project I'm currently working on, so it will start getting battle-tested over the next few weeks.

@guyca guyca self-assigned this Jun 13, 2016
@guyca
Copy link
Copy Markdown
Collaborator

guyca commented Jun 13, 2016

@jskuby Thanks a lot for the PR. I'm starting to review it, but it will take me some time to go over such a large PR.

boolean hide = params.getBoolean(KEY_HIDDEN);
boolean animated = params.getBoolean(KEY_ANIMATED);
if (hide) {
mToolbar.hideToolbar(animated);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hideToolbar and showToolbar don't animate the transition since they only change the View's visibility to GONE or VISIBLE. I'll fix it after we merge.

@MattDavies
Copy link
Copy Markdown
Contributor

I would love to see some of this get merged in. Perhaps we can break the PR up into a few chunks - e.g. pull the bug fixes out into separate PRs so we can test and merge them separately with confidence?

Worried the merge conflicts will build up pretty quickly on a PR this size as development continues on master. I'm happy to help with the splitting if you'd like :)

@adamski
Copy link
Copy Markdown
Contributor

adamski commented Jun 14, 2016

+1 on splitting it up, great work here :)

@guyca
Copy link
Copy Markdown
Collaborator

guyca commented Jun 14, 2016

@jskuby, @MattDavies has a good point. I tried reviewing the PR before other tasks I have but it wasn't possible.

Today I refactored the logic related to setting/updating navigation style after screen change in daee13f - this commit alone results in a pretty massive conflict.

I suggest we split the PR as follows:

  • Fixes and enhancements to example project
  • setNavigationTitle
  • Hide/Show tabs in BottomTabActivity
  • setTabBadge
  • Toolbar toggle
  • popToRoot
  • resetTo
  • ScreenStack addView/RemoveView issue
  • Drawer - If it's ok with you, I would like us to merge this feature in last since the review process might take some time.

If you guys are interested, we can open a channel in discord so we have a more efficient form of communication.

@guyca
Copy link
Copy Markdown
Collaborator

guyca commented Jun 15, 2016

@jskuby I'm going to start cherry picking some of your commits. Hope it's ok with you.

@FeralAI
Copy link
Copy Markdown
Author

FeralAI commented Jun 22, 2016

Sorry to disappear for a while there. Looks like some of the functionality has been integrated over the last week. If there's anything else you would like broken into separate PRs I can probably spare some time a few nights this week or this weekend to help move things along.

@guyca
Copy link
Copy Markdown
Collaborator

guyca commented Jun 22, 2016

@jskuby You got us worried for a while. I did in fact cherry pick most of your commits (Thanks a lot!)
I didn't have time to rebase + cherry pick the drawer commits.
If you could submit a separate PR for the drawer it would be great!
Thanks

@FeralAI
Copy link
Copy Markdown
Author

FeralAI commented Jun 22, 2016

That's great to hear @guyca! I'll get on the drawer PR as soon as possible.

Jason Skuby added 2 commits June 23, 2016 22:04
# Conflicts:
#	android/app/src/main/java/com/reactnativenavigation/activities/BaseReactActivity.java
#	android/app/src/main/java/com/reactnativenavigation/activities/BottomTabActivity.java
#	android/app/src/main/java/com/reactnativenavigation/activities/SingleScreenActivity.java
#	android/app/src/main/java/com/reactnativenavigation/activities/TabActivity.java
#	android/app/src/main/java/com/reactnativenavigation/core/objects/Screen.java
#	android/app/src/main/java/com/reactnativenavigation/modal/RnnModal.java
#	android/app/src/main/java/com/reactnativenavigation/modules/RctActivityModule.java
#	android/app/src/main/java/com/reactnativenavigation/views/RnnToolBar.java
#	android/app/src/main/java/com/reactnativenavigation/views/ScreenStack.java
#	src/platformSpecific.android.js
@FeralAI
Copy link
Copy Markdown
Author

FeralAI commented Jun 24, 2016

I made some progress by merging main master with my master branch. At this point, I think we close this PR and I'll do some cleanup and open separate requests for the remaining updates, which are mainly the drawer implementation and some updates to the example app.

@guyca
Copy link
Copy Markdown
Collaborator

guyca commented Jun 24, 2016

Sounds great @jskuby. Thanks!

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.

4 participants