Skip to content

Implement Widget UI #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 9, 2020
Merged

Implement Widget UI #20

merged 6 commits into from
Jul 9, 2020

Conversation

fmontesino
Copy link
Contributor

Why?

We had a placeholder widget while waiting for the designs

What?

Implemented the widget UI, making it a bit resizable.
Added widget preview on the widget selector

Bonus

Fixed a small bug on the tile while launching a new intent.

Some screenshots:
image
image
image
image

@@ -1,20 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
Copy link
Contributor Author

@fmontesino fmontesino Jul 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Widgets have a limited set of Views that you can use, definitely not a ConstraintLayout :(

@codecov-commenter
Copy link

Codecov Report

Merging #20 into main will decrease coverage by 2.53%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               main      #20      +/-   ##
============================================
- Coverage     39.22%   36.69%   -2.54%     
  Complexity       54       54              
============================================
  Files            17       17              
  Lines           232      248      +16     
  Branches         26       27       +1     
============================================
  Hits             91       91              
- Misses          140      156      +16     
  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> (ø)

android:minHeight="@dimen/widget_min_height"
android:minResizeWidth="@dimen/widget_min_resizable_width"
android:minResizeHeight="@dimen/widget_min_resizable_height"
android:previewImage="@drawable/widget_preview"
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="86400000"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this update period how often the widget is going to sync with the new saved proxy?
If this is once a day and you change the proxy in the meantime from the app,
will the widget show the right proxy?

Copy link
Contributor Author

@fmontesino fmontesino Jul 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it's a required value when creating the widget to automatically refresh, set as once a day to save battery.
The proxy is updated in real time via a broadcast sent every time you update the proxy from other sources (app, tile, etc)

@fmontesino fmontesino merged commit b0d0b1f into main Jul 9, 2020
@fmontesino fmontesino deleted the feature/widget-ui branch July 9, 2020 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants