Skip to content

Conversation

daniel-stoneuk
Copy link
Collaborator

This PR contains how I would use the Apollo Android Library with Android Architecture components.

chapterId = chapter.id,
chapterNumber = chapter.number?.toInt() ?: -1,
chapterTitle = chapter.title
chapterTitle = if (chapter.number == null) chapter.title else getString(
Copy link
Collaborator Author

@daniel-stoneuk daniel-stoneuk Jul 13, 2020

Choose a reason for hiding this comment

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

Instead of passing in the chapter title, we generate it here before passing it to the second fragment. This means we can use this argument in the nav editor.

tools:layout="@layout/sections_fragment">
tools:layout="@layout/sections_fragment"
android:label="{chapterTitle}">

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here we set the label of the fragment to the chapterTitle argument that we pass in when navigating

@lorensr lorensr merged commit 37adaf9 into GraphQLGuide:master Jul 14, 2020
@daniel-stoneuk daniel-stoneuk deleted the add-arch-components branch July 14, 2020 11:12
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