Skip to content
Snippets Groups Projects

Moved MainActivity to MVP

Merged HashikD requested to merge HashikD/snowflake-mobile:mainactivity-mvp into master
2 unresolved threads

closes #17 (closed)

Edited by HashikD

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 package org.torproject.snowflake.constants;
2
3 public class AppPreferenceConstants {
  • This is a nitpick, but can we change this to AppPreferenceKeys? It increases code readability slightly, otherwise it looks like we're declaring the counts of users served or the date as final constants.

  • Please register or sign in to reply
    • Okay, thanks for working on this! Just writing here for my own notes to make sure I understand the design:

      You've separated the main activity into two parts: the presenter (that takes care of responding to user inputs and getting the information to the user), and the model (which acts as an interface between the presenter and storage).

    • Author Maintainer

      Almost right, but little changes...

      View(UI where user interacts) <=> Presenter <=> model(Fetches data and makes network calls)

      The presenter mediates between the model and view. For instance, If the user clicks on the "refresh page", the View will tell the presenter and presenter will tell Model to fetch new content after model fetches the content asynchronously it calls a method on presenter and presenter will, in turn, say to the UI to update giving it the latest data.

      Let me know if it wasn't clear, I know I can be bad at explaining things so don't hesitate.

    • Okay great, thanks! And the view will be added later with the UI implementation, right?

    • Author Maintainer

      Actually, it is already implemented if you look at the MainActivity class, it implements the View interface from MainActivityMVP (Which is called as a Contract Interface) so MainActivity is the View now.

    • Please register or sign in to reply
  • HashikD mentioned in merge request !13 (merged)

    mentioned in merge request !13 (merged)

  • Please register or sign in to reply
    Loading