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

[WIP] Multiple widgets #988

Closed
wants to merge 13 commits into from
Closed

[WIP] Multiple widgets #988

wants to merge 13 commits into from

Conversation

TBog
Copy link
Collaborator

@TBog TBog commented May 11, 2018

fix #752

WIP, do not merge

I need some feedback and help ;)

  • Get the name from the widget to display in the popup
  • Custom widget position and size
  • Scroll with the wallpaper
  • Long press widget to enter edit mode
  • Visual / drag&drop resize and position
  • Grid placement option
  • Allow for separate grid sizes for each screen / page
  • Add padding that may be negative to better position the widget in the grid
  • Re-add widget every X minutes on Oreo to force update the widget (will fix the clock widgets not updating)
  • Test that every option works as expected

@TBog TBog added the enhancement New feature label May 11, 2018
@TBog
Copy link
Collaborator Author

TBog commented May 11, 2018

Make sure to remove all widgets when you switch away from this PR or else restoreWidgets will crash

@saveman71 saveman71 added the wip label May 11, 2018
@TBog TBog force-pushed the multiple_widgets branch 3 times, most recently from e365dcc to a20aa1f Compare May 14, 2018 07:51
@TBog TBog changed the title Widget customization Multiple widgets May 15, 2018
@Neamar
Copy link
Owner

Neamar commented Jun 8, 2018

@TBog I see this PR is WIP, but just in case, are you looking for testers already?

@TBog
Copy link
Collaborator Author

TBog commented Jun 8, 2018

Yes, testing would be good.

LE: I know some people have problems with widgets not updating. Would it be ok to update all widgets when onStart is called?

@Neamar
Copy link
Owner

Neamar commented Jun 9, 2018

Regarding your question, I don't see any issue refreshing in onStart(), but I'm not sure that'll be enough since some people never restart KISS and still get the widget stuck. [let's discuss this issue in #744]

Regarding the feature itself, some questions!

  • Adding multiple widgets "stacks" them. You can change the position after, but can we infer the top position automatically?
    2018-06-09 16 19 31
  • Setting the gravity makes the widget disappear (at least on my device) :(
  • Setting the width to the minimum (which on my device is 500px, haven't checked the code yet) makes the widget disappear :(

I like the multi-widget approach and the full-customizability, but I'm curious how someone less technical will understand concepts such as "gravity".

@Neamar
Copy link
Owner

Neamar commented Jun 9, 2018

(update: on my device, changing any settings by anything will make the widget disappear)

@TBog
Copy link
Collaborator Author

TBog commented Jun 9, 2018

I'm sorry that you have encountered problems.

  • The position option will set the screen. I can drag the wallpaper to change the screens (there is an option for this). There is the left, right and middle screen.
  • Gravity is the position inside a screen.
  • The minimum width and height are provided by the widget. The maximum is the screen size.

By default the widgets should be positioned on the middle screen at the top, centered horizontally. When you said "infer the top position automatically" what did you expect to see?

Right now I seem to have problems with the settings if more than 1 widget is set, not sure what I did because when I first tested it seemed to work fine.

@TBog
Copy link
Collaborator Author

TBog commented Jul 2, 2018

If one sets the position of a widget to left or right, than please also enable "Scroll wallpaper" to be able to see the widget by dragging on the screen.
"Show history on touch" may also hinder the user experience.

@ildar
Copy link

ildar commented Jul 5, 2018 via email

@Neamar
Copy link
Owner

Neamar commented Jul 5, 2018

@ildar you can try https://1855-6047468-gh.circle-artifacts.com/0/release-apk/app-release-unsigned.apk but you'll lose any settings you have in KISS :(

@ildar
Copy link

ildar commented Jul 5, 2018 via email

@Neamar Neamar mentioned this pull request Jul 7, 2018
@ildar
Copy link

ildar commented Jul 23, 2018 via email

@ildar
Copy link

ildar commented Jul 23, 2018 via email

@TBog
Copy link
Collaborator Author

TBog commented Jul 23, 2018

Please do tell what you did that crashed it.

I don't use a grid to position the Widgets because I wanted to have full control of the position. This is why if you just add two widgets they would be overlapping. I suppose I can make the first align to TOP and the second to BOTTOM and this would delay the problem to the 3rd widget added.

How would you like to have the layouting changed/fixed?

@ildar
Copy link

ildar commented Jul 23, 2018 via email

@ildar
Copy link

ildar commented Jul 23, 2018 via email

@ildar
Copy link

ildar commented Aug 20, 2018 via email

@TBog
Copy link
Collaborator Author

TBog commented Aug 21, 2018

I have some widgets that do not update sometimes. I'm 90% sure it's not because of my changes but I don't want to be blamed ;)
Also, the setup flow seems kind of ugly imho, but I don't know how to make it better.

@ildar
Copy link

ildar commented Aug 21, 2018 via email

@ildar
Copy link

ildar commented Sep 11, 2018 via email

@ildar
Copy link

ildar commented May 22, 2019 via email

@TBog
Copy link
Collaborator Author

TBog commented May 22, 2019

I did a rebase, did not test it but I had no conflicts and it compiles.
Here is a link to the circleci artifact: https://2226-6047468-gh.circle-artifacts.com/0/debug-apk/app-debug.apk

@ildar
Copy link

ildar commented May 22, 2019 via email

@Neamar Neamar changed the title Multiple widgets [WIP] Multiple widgets May 24, 2019
@droserasprout
Copy link
Contributor

Thanks for your contribution, @TBog! I like this launcher a lot and think it's really missing multiple widgets feature. In my usecase it would be TickTick and Habbit to track todos and habbits right on home screen. But don't you thinks features declared in PR description are a bit overkill keeping in mind project goals? IMHO two menu buttons ("add [fullscreen] widget" and "remove current witget") and ability to swipe between added widgets horizontally would be enough. I've tried your current build and widget related features feels pretty complicated. What do you think about it, @Neamar?

@droserasprout
Copy link
Contributor

And also it would be great to see this project on Bountysourse to allow contributors to get paid for their work.

@ildar
Copy link

ildar commented Jul 18, 2019 via email

@Neamar
Copy link
Owner

Neamar commented Feb 19, 2020

Hey @TBog,

This PR has been blocked for some time now.

I've been considering implementing the feature on my side (something more advanced than what we have right now, but not as advanced as what you have here). Would you be OK for me to close this and start working on a new implementation?

@Dakkaron
Copy link
Contributor

I tired to update this to the current master branch and it compiles, but I keep getting the same error whenever I click any of the spinners in the widget customization panel:

Process: fr.neamar.kiss.debug, PID: 13149
android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@10d554 is not valid; is your activity running?
    at android.view.ViewRootImpl.setView(ViewRootImpl.java:679)
    at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
    at android.widget.PopupWindow.invokePopup(PopupWindow.java:1378)
    at android.widget.PopupWindow.showAsDropDown(PopupWindow.java:1234)
    at android.widget.ListPopupWindow.show(ListPopupWindow.java:671)
    at android.widget.Spinner$DropdownPopup.show(Spinner.java:1235)
    at android.widget.Spinner.performClick(Spinner.java:770)
    at android.view.View$PerformClick.run(View.java:22429)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

It seems that the context for the dropdowns is not correct. I tried to use different contexts but the exception remains. Does anyone have any ideas on that?

@ildar
Copy link

ildar commented Feb 21, 2020 via email

@TBog
Copy link
Collaborator Author

TBog commented Feb 21, 2020

@Neamar Please do. I may be able to add more customization to it after you finish. Right now what we need is a better widget management.

@Neamar
Copy link
Owner

Neamar commented Feb 21, 2020

My initial implementation is unlikely to deal with overlapping widget.
The first S in "KISS" stands for simple ;)
My plan is probably to layout widgets in a vertical LinearLayout with options to reorder and resize.

I'm closing this here, happy to reopen if you see I'm not making any progress or you have more time!

@Neamar Neamar closed this Feb 21, 2020
@Dakkaron
Copy link
Contributor

@Neamar I really like you taking on this issue! But maybe consider taking this as a base to build on, since most of the work is already done and making this here more user-friendly might be easier than to make a linear layout more configurable.

You could emulate the linear layout's behaviour with this rather easily.

For the simple mode the user would only be allowed to change the order of the widgets. This would be done in the background by setting the height and top offset values of the widgets.

The advanced mode could function similarly as it does now, only maybe with slightly modified parameter names so that it is easier to understand.

I would change the label "Position" to "Page", drop vertical gravity (the same effect can be gained from using offset top) and rename horizontal gravity to "Position".

I like the current implementation very much, except that it crashes when touching any of the dropdown menues.

@ildar ildar mentioned this pull request Apr 16, 2020
2 tasks
@TBog TBog mentioned this pull request Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple widgets
6 participants