theappbusiness / android-proxy-toggle

Small application to help android developers to quickly enable and disable proxy settings
MIT License
425 stars 59 forks source link

Store last used proxy and use it from the widget and tile #10

Closed fmontesino closed 4 years ago

fmontesino commented 4 years ago

Why?

When enabling the proxy from the widget or the tile, we want to use the last proxy used automatically to avoid setting up every single time.

What?

Added AppSettings interface (that potentially will grow with other settings/flags in future PR) and a SharedPrefs implementation for it. Modified the Tile and the Widget to use this last value when enabling the proxy. The SettingsDeviceManager now stores this last used value. If the proxy was not set before using the tile/widget, it will launch the app to enforce the user to setup the proxy

codecov-commenter commented 4 years ago

Codecov Report

Merging #10 into main will increase coverage by 0.15%. The diff coverage is 36.84%.

@@             Coverage Diff              @@
##               main      #10      +/-   ##
============================================
+ Coverage     42.17%   42.33%   +0.15%     
- Complexity       32       35       +3     
============================================
  Files            15       16       +1     
  Lines           147      163      +16     
  Branches         12       14       +2     
============================================
+ Hits             62       69       +7     
- Misses           84       93       +9     
  Partials          1        1              
Impacted Files Coverage Δ Complexity Δ
...reate/proxytoggle/feature/tile/ProxyTileService.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...proxytoggle/feature/widget/ToggleWidgetProvider.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...reate/proxytoggle/android/DeviceSettingsManager.kt 100.00% <100.00%> (ø) 5.00 <0.00> (ø)
...eate/proxytoggle/android/SharedPrefsAppSettings.kt 100.00% <100.00%> (ø) 3.00 <3.00> (?)
...inandcarta/create/proxytoggle/view/MainActivity.kt 14.28% <100.00%> (+14.28%) 0.00 <0.00> (ø)