coding-blocks / DigitalOceanApp

Admin Console for Digital Ocean
GNU General Public License v3.0
56 stars 75 forks source link

Fixed Issue #43: Fixed issues with Additional Options in DetailDropletActivity #44

Closed ojasvajain closed 7 years ago

ojasvajain commented 7 years ago

Issue 1- The snackbar doesn't always show up when an option is enabled/disabled.

How did I Fix - Earlier the snackbar would show up only when response code received was 200, but according to official documentation of DigitalOcean API, "In general, if the status returned is in the 200 range, it indicates that the request was fulfilled successfully and that no error was encountered." So I changed the code to show the snackbar if the response code is between 200 and 299 (both inclusive).

Issue 2- If an option is enabled/disabled from DetailDropletActivity, if we open DetailDropletActivity again, the switch corresponding to that option remains off, always.

How did I Fix - Modified the code to receive list of features when receiving droplet information from the API and made use of an interface to refresh the information every time an option is enabled/disabled.

Issue 3- Since private networking and IPv6 can not be disabled once they are enabled, the app should restrict the user from switching off those options if they are enabled and show appropriate message in snackbar.

How did I Fix - Changing the state of the switch back to ON state, if user tries to switch off IPv6 or Private Network.

2017_06_07_20_09_42

Please review PR