Codereview #2 of 8 from 3#104
Codereview #2 of 8 from 3#104leopardo-rossi-developer wants to merge 9 commits intoPrandiniUniPD:CommonDemofrom
Conversation
The method's for the code review are: takePhoto() and tempFileImage().
thomasporro
left a comment
There was a problem hiding this comment.
The code is really nice to read. The only thing, you might follow more the style doc, for example the column limit of 100 characters. I added a comment in a line that I don't understand too much
| import unipd.se18.ocrcamera.forum.R; | ||
| import unipd.se18.ocrcamera.forum.RequestManager; | ||
| import unipd.se18.ocrcamera.forum.models.Post; | ||
|
|
There was a problem hiding this comment.
According to our style document:
If there are both static and non-static imports, a single blank line separates the two blocks. There are no other blank lines between import statements.
| * According to the MVVM (Model-View-ViewModel) architecture this class contains all fragment ShowPosts' logic. | ||
| * This architecture ensures that the code is more testable and organised than the classic approch to put everything | ||
| * in the activity or fragment class. | ||
| * In particular the methods that are implemented here are used to get posts from forum and to handle users' likes. The |
There was a problem hiding this comment.
Just a distraction error: users' instead of user's
| //If an error occurs while converting the post's date an error message is logged to console and | ||
| //the failure UI listener is triggered with a explanation message for the user | ||
| Log.d(LOG_TAG, e.getMessage()); | ||
| if (getPostListener != null){ getPostListener.onGetPostFailure(context.getString(R.string.requestFailedMessage)); } |
There was a problem hiding this comment.
I think it's a my problem beacause I've never used the listeners but I don't understand where the getPostListener is initialized.
| public void onSuccess(Object o) { | ||
| //If the like has correctly been added to the db the success listener is triggerd | ||
| //(In this case there's an empty string as parameter because there's no specific message to show to the user) | ||
| if (addLikeListener != null) { addLikeListener.onAddLikeSuccess(""); } |
There was a problem hiding this comment.
The same thing as above
With my group we're developing a forum for the app, where users can read useful information/article published by other users and let them know (using comments and likes) if they appreciate what is written. All this information is stored into a DB handled thanks to Firebase Firestore API.
In particular the class you have to review is the one that manages:
1- Posts download from DB.
2- Like addition to a post.