Skip to content

refactor(database): use Jetpack's Navigation Component #1252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 1, 2021

Conversation

thatfiredev
Copy link
Member

@thatfiredev thatfiredev commented Jan 28, 2021

Part of #1217, this should implement the Navigation Component in our database quickstart.

Extra changes

In order to accommodate the Navigation implementation, some extra changes took place here:

  • deleted the NewPostTest unit test class which was testing one of our activities that no longer exists.
  • edited the AppTheme.NoActionBar theme because it was causing the systembar to disappear.
  • the fragment package which contains the fragments used in a TabLayout was renamed to listfragments to avoid any confusion.
  • moved the CommentViewHolder out of the PostDetailActivity class and into a separate class in the viewholder package (now sitting pretty alongside its brother PostViewHolder).

Snippets moved to firebase/snippets-android

See firebase/snippets-android#275

@samtstern there are some snippets that are present in this repo, but I can't find them in the docs.
For example, the my_top_posts_query, which is similar to another snippet already present in snippets-android:

quickstart-android

// [START my_top_posts_query]
// My top posts by number of stars
String myUserId = getUid();
Query myTopPostsQuery = databaseReference.child("user-posts").child(myUserId)
.orderByChild("starCount");
// [END my_top_posts_query]

snippets-android

https://github.com/firebase/snippets-android/blob/45ba4822eb111609be2951c944142e3bbe891472/database/app/src/main/java/com/google/firebase/referencecode/database/QueryActivity.java#L98-L113

I can see its usage in the docs: https://firebase.google.com/docs/database/android/lists-of-data#sort_data

Snippets in a similar situation include: comment_class, single_value_read and declare_database_ref. Is it possible to check these against the snippet registry?

@thatfiredev thatfiredev marked this pull request as ready for review January 28, 2021 16:26
@thatfiredev thatfiredev mentioned this pull request Jan 28, 2021
16 tasks
@samtstern
Copy link
Contributor

@rosariopfernandes thank you so much for being so careful about snippets as you do this. That's really helpful.

So here's what we'll do:

  1. Merge your snippets-android change
  2. Make the docs point to the new snippets (internal change)
  3. Merge this one.

@samtstern
Copy link
Contributor

This one is ready to go! Internal change is in so this should be safe.

@samtstern samtstern merged commit 474888e into firebase:master Feb 1, 2021
@thatfiredev thatfiredev deleted the rpf-database-navigation branch March 15, 2021 06:37
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