CircuitVerse / mobile-app

Mobile App for CircuitVerse
https://play.google.com/store/apps/details?id=org.circuitverse.mobile_app
MIT License
70 stars 93 forks source link

Show a spinner when the API request for Star an repo is running #266

Open tanmoysrt opened 1 year ago

tanmoysrt commented 1 year ago

Is your feature request related to a problem? Please describe. In the project details screen, we have options to star/unstar the repo. Now the issue is , we can tap the button multiple time in a short span of time. If user's internet connectivity is not too good, then this will create confusion and send many unnecessary requests to server.

https://user-images.githubusercontent.com/57363826/221550927-66bf471c-967f-4590-992c-7d7875ae4a4d.mp4

Describe the solution you'd like To make that UI friendly, we can have a spinner, when the star/unstar function invoked, a spinner will be shown , as soon as the request executed successfully, we will remove spinner and update the state. During the requesting time, we need to reject further requests.

Are you working on this? (Yes/No) No

notbrood commented 1 year ago

Can I start workiing on this?

tanmoysrt commented 1 year ago

Can I start workiing on this?

cc : @vedant-jain03

notbrood commented 1 year ago

Hey @Tanmoy741127, do you think it would be UI friendly if there was no spinner blocking the view? I have added a bool function which checks if the request is finished, and then only allows the user to star the project again, what are your views on that?

tanmoysrt commented 1 year ago

@notbrood That will work. Try out how it will look, if you can add a little spinner or pulse type of loader in the box of the star icon

notbrood commented 1 year ago

@Tanmoy741127 Just wanted to let you know that I'm not very comfortable with the get state management aspect of our project. I could try working on it, but I don't think I have the necessary skills to do it properly.

Regarding the bool function, I'm happy to create a PR for the function, and let someone else add the spinner.

tanmoysrt commented 1 year ago

@notbrood in the mobile-app we are using Provider for state management solution and GetX is using for different purposes. So you can give it a try.

notbrood commented 1 year ago

Okay, I'll give it a try!

notbrood commented 1 year ago

I was able to, It looks UI Friendly as well!

notbrood commented 1 year ago

https://user-images.githubusercontent.com/91044746/223567890-cc30d12c-4a1a-4da5-aa35-6af3f0996e46.mp4

Here's how it looks! What are your views?

tanmoysrt commented 1 year ago

Here's how it looks! What are your views?

Great ! Try to make the size same as the star icon

notbrood commented 1 year ago

I did, how does this look?

https://user-images.githubusercontent.com/91044746/223655307-a3d6703b-598f-4abc-9433-b4a8e3a3ede7.mp4

tanmoysrt commented 1 year ago

I did, how does this look?

It's looking good now !

notbrood commented 1 year ago

Okay, I'm going to make a PR for this now!

tanmoysrt commented 1 year ago

Okay, I'm going to make a PR for this now!

I did, how does this look?

cc @manjotsidhu @aman-singh7