You are viewing a single comment's thread from:

RE: Reimplementing Android Quiz App (UPDATE 2: Update and Delete Data)

in #utopian-io6 years ago

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]

Sort:  

Thanks for the correction, would look into that.

Hey @codingdefined
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.

Contributing on Utopian
Learn how to contribute on our website.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.16
TRX 0.16
JST 0.030
BTC 59007.15
ETH 2493.89
USDT 1.00
SBD 2.46