Skip to content

Android drawer implementation#82

Merged
guyca merged 3 commits into
wix:masterfrom
the-mx-group:android_drawer
Jun 25, 2016
Merged

Android drawer implementation#82
guyca merged 3 commits into
wix:masterfrom
the-mx-group:android_drawer

Conversation

@FeralAI
Copy link
Copy Markdown

@FeralAI FeralAI commented Jun 24, 2016

This is a native drawer implementation that uses the animated arrow menu icon by default. Currently only a left menu is implemented for SingleScreenActivity and BottomTabActivity. I've been using this in a client application with SingleScreenActivity for the past few weeks and it's been working well.

});
}

protected void setupDrawer(Drawer drawer, Screen screen) {
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.

can this function be defined in BaseReactActivity ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don't see why not, I was just keeping in line with the setup functions being defined in the derived classes.

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.

Let's move it to the base class then I'll merge. Looks great! Thanks a lot.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No problem at all, it was a blast to work with! I'll get on that update later today.

@guyca guyca self-assigned this Jun 24, 2016
super.onBackPressed();
}

protected void setupDrawer(Screen screen, Drawer drawer, int drawerFrameId, int drawerLayoutId) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

setupDrawer is taking in the layout IDs here since I'm not sure there's a way to get those from the base activity. I wasn't able to when initially refactoring.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Nevermind me, it makes sense. They're different layouts, so they will generate different layout IDs.

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.

We also don't have to pass the id's as params to setupDrawer since in both layout files we use the same ids for the views. findViewById will search for these views in the layout which was passed to setContentView. No biggie, I'll merge and make that minor change later.
@jskuby Thanks a lot for your work!

@guyca guyca merged commit be2bc55 into wix:master Jun 25, 2016
@FeralAI FeralAI deleted the android_drawer branch June 25, 2016 05:34
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.

2 participants