coding-blocks / DigitalOceanApp

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

Fixes the issue brought up in #68 #69

Closed 4lch4 closed 6 years ago

4lch4 commented 6 years ago

PR Request to fix issue #68

What's it do?

As the heading states, this PR will fix the issue brought up by vinayakkgarg, where they discovered the Settings button in the toolbar was not doing anything when clicked.

What was wrong?

After looking into the code, I realized when a user clicks the button, the method it hits returns true without actually doing anything:

@Override 
public boolean onOptionsItemSelected(MenuItem item) { 
    // Handle action bar item clicks here. The action bar will 
    // automatically handle clicks on the Home/Up button, so long 
    // as you specify a parent activity in AndroidManifest.xml. 
    int id = item.getItemId(); 

    //noinspection SimplifiableIfStatement 
    if (id == R.id.action_settings) { 
        return true; 
    } 

    return super.onOptionsItemSelected(item); 
}

How's it fix it?

  1. I tried removing the menu and the code associated (such as the method shown above) but then the toolbar was looking wonky and out of shape.

  2. To fix the toolbar I downloaded an svg of the DigitalOcean logo and after cleaning it up a bit added it to the project for the new _@drawable/icdigitalocean.

  3. Lastly, I had to adjust the measurements for the toolbar in order to have margins on smaller screens so it's not too cramped.

codecov[bot] commented 6 years ago

Codecov Report

Merging #69 into master will decrease coverage by 0.06%. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #69      +/-   ##
============================================
- Coverage     12.74%   12.67%   -0.07%     
+ Complexity       48       47       -1     
============================================
  Files            82       82              
  Lines          1868     1862       -6     
  Branches         92       91       -1     
============================================
- Hits            238      236       -2     
+ Misses         1618     1614       -4     
  Partials         12       12
Impacted Files Coverage Δ Complexity Δ
...sc/digitaloceanapp/activities/DropletActivity.java 40.86% <ø> (+0.37%) 5 <0> (-1) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 98ddba5...b34ac40. Read the comment docs.

championswimmer commented 6 years ago

Thank you @Alcha !!

4lch4 commented 6 years ago

No problem @championswimmer, just happy to help!