Skip to content
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

Assignment: Integrate Signup and Related Products API #3

Open
safaorhan opened this issue May 10, 2021 · 0 comments
Open

Assignment: Integrate Signup and Related Products API #3

safaorhan opened this issue May 10, 2021 · 0 comments

Comments

@safaorhan
Copy link
Owner

Background

In the lectures we've seen how to work with Retrofit to consume REST APIs. You need to apply that knowledge to integrate Signup and Related Products APIs.

You can use the Insomnia workspace to see the request and response formats.

Also we couldn't find any chance to add the circular progress indicator to our app, in this assignment you also need to add that.

Finally, you need to handle session related stuff (skipping login flow until the user logs out).

Todo

Signup API

  • Send request to /auth/local/register when user tries to sign up and all client side validations pass.
  • Handle the response and..
    • if it's successful save the jwt and navigate to product list screen, popping all the backstack.
    • for errors with 4XX status code display the returned message in a Snackbar.
    • for other status codes display Unexpected error occurred in a Snackbar.
  • Handle other connectivity problems (eg. device is not connected to internet) and show this message in a Snackbar: Please check your connection and try again.

Related Products

  • Make api request to /related-products/:id where :id is the id of the product displayed.
  • Handle 401 status code and navigate to login screen in that case.
  • When the returned list is empty (there is no related products to the product queried) then hide the related products title TextView and the RecyclerView.
  • When the returned list is non-empty fill the RecyclerView with the given list.

Circular Progress Indicator

  • In Product List screen show a circular progress indicator until the list is loaded.
  • In Product Detail screen show a circular progress indicator until the product detail and the related products are both loaded.

Logout Action

  • Add a menu which is visible only in Product List screen and show a logout action in the overflow menu.
  • When user selects this menu item, delete the token and navigate to login popping all the back stack.

Skip login flow when user is logged in

  • When user successfully logs in or signs up, do not show Signup or Login screens to the user anymore until the user logs out.
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

No branches or pull requests

1 participant