Skip to content
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

StackView Widgets (#45) #346

Merged
merged 5 commits into from
Jun 17, 2018
Merged

StackView Widgets (#45) #346

merged 5 commits into from
Jun 17, 2018

Conversation

vyu1
Copy link
Contributor

@vyu1 vyu1 commented Oct 16, 2017

I enjoy using the checkmark widget and really like it's transparent design, but having 5-7 checkmark widgets takes up way too much screen space on my home screen. I implemented a StackView style for the existing Checkmark widget. This new feature is related to #45.
To test my changes, place down a checkmark widget and a new HabitPicker dialog should appear. This dialog allows you to select up to as many habits as you prefer. If you only select 1, then the app will create the familiar Checkmark widget we have today. If you select multiple, then the app creates a StackView-style Checkmark widget in which you can scroll through the specific habits you selected.
There are a few things to be discussed:

  1. All the widgets themes are opaque right now instead of transparent. I'm not really sure how I can change the Context theme for just the StackView-styled Checkmark widget.
  2. I left a TODO comment in the code about this one. If the adapter for the StackView is empty or hasn't been retrieved by the OS, an "empty view" appears as a placeholder. Right now, the empty view consists of just a TextView that says, "Checkmark Stack Widget."

I would love any and all feedback!

@vyu1 vyu1 changed the title New Feature related to Issue 45: StackView Checkmark Widget StackView Checkmark Widget (#45) Oct 16, 2017
@iSoron
Copy link
Owner

iSoron commented Oct 27, 2017

Hi Victor, thank you for the pull request! I think this is a great feature. The StackView worked even better than I expected. I have been testing this on the emulator and I came across two glitches:

  1. When the user clicks a widget, sometimes the entire stackview disappears for a second and is replaced by a loading text. See the screen capture below. Do you know what might be causing this, and have you tried to fix it? I can have a look into it myself if you would like.

  2. When the user adds two stacks of checkmark buttons, they both end up with the same cards. Even if the widget is first removed and then re-added, it seems like habits that were selected for the first stack still show up.

device

@vyu1
Copy link
Contributor Author

vyu1 commented Nov 9, 2017

@iSoron Details of the changes I just pushed:

  1. At the time you tested this new feature, I allowed the user to pick which habits they wanted in their stack-view widget. You pointed out an error with this feature (the 2nd glitch you commented above with). I realized that this feature will not be possible. The method setRemoteAdapter updates any widgets with the same layout all exactly the same way. If you look in the RemoteViews API, you can see that there is a setRemoteAdapter method that can set the adapter for widgets individually, but it's deprecated and, if used, will simply ignore the value of the widget id we pass it.
  2. I think I made a pretty cool change since last time, which was supporting the "stack view" widget design for all the widget types we have now! To test, place down a home screen widget, click the new "create a stack view widget" button at the top of the dialog that opens up, and you should see a stack view widget for any widget type you choose.
  3. Lastly, I have actually spent most of my time trying to fix glitch Allow user to specify which days of the week should a habit be repeated #1 you mentioned above, but have not been able to fix it. I think the "flash" that we see is because onDataSetChanged() is being called in StackWidgetService.

Please let me know what you think of these points!

@vyu1 vyu1 changed the title StackView Checkmark Widget (#45) StackView Widgets (#45) Nov 26, 2017
@iSoron iSoron merged commit def71d8 into iSoron:dev Jun 17, 2018
@iSoron
Copy link
Owner

iSoron commented Jun 17, 2018

Hi @vyu1, sorry about the long delay. I finally had some time to work on this, and I was able to reduce the flicker problem considerably. It's not perfect, but I think it's good enough. I went ahead and merged your patches into the dev branch. Thank you a lot for your help; I'm sure the users will also appreciate it. Also, please let me know if you would like to work on anything else.

@vyu1
Copy link
Contributor Author

vyu1 commented Jul 20, 2018

Hey @iSoron, sorry I haven't responded to this message in over a month!! I'm so excited to hear this has been merged in and I appreciate your thanks! Hopefully I can find another thing to work on and contribute to, thanks again 😄

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.

None yet

2 participants