Thank you for your contribution. There are a lot of code which is commented out, it would be better if you just clean up your files.
And also where you are checking //These are sets of conditions for submit button visibility, here you have added three if else statement, I think you can actually club that in one if statement.
//These are sets of conditions for submit button visibility
if (dy > 0 && linearLayoutManager.findLastVisibleItemPosition() ==
playQuizAdapter.getItemCount() - 1) {
submitButton.setVisibility(View.VISIBLE);
} else if(dy == 0 && linearLayoutManager.findLastVisibleItemPosition() == 0 && (playQuizAdapter.getItemCount() - 1) == 0){
submitButton.setVisibility(View.VISIBLE);
} else if(dy == 0 && linearLayoutManager.findLastVisibleItemPosition() == 1 && (playQuizAdapter.getItemCount() - 1) == 1){
submitButton.setVisibility(View.VISIBLE);
} else {
submitButton.setVisibility(View.GONE);
}
You can actually check if dy >= 0 amd then inside that you can write one more if statement, thus it will save some time of execution.
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
RE: Reimplementing Android Quiz App (UPDATE 2: Update and Delete Data)