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

Widgets take up more space than needed #1752

Closed
Naudiz opened this issue Feb 16, 2022 · 9 comments
Closed

Widgets take up more space than needed #1752

Naudiz opened this issue Feb 16, 2022 · 9 comments

Comments

@Naudiz
Copy link

Naudiz commented Feb 16, 2022

Describe the bug

Widgets take up too much space without the possibility to resize them to a smaller ratio. The simple search bar looks like a 5x1 widget, but demands 5x2 space on the home screen. The favorites widget has a preview picture that looks like a 5x2 widget, but takes up 5x3 space with a minimum of 2 favorites rows, opposed to the one row shown in the preview.

Screenshot_20220216-103924
Screenshot_20220216-103805

How to Reproduce

Simply place a widget on the homescreen.

Expected behavior

Search widget should have a space requirement of 5x1 only.
Favorites widget should be freely resizable with a minimum of 5x2 (search bar + one row of favorites, like in the preview)

Environment

- DDG App Version: 5.111.0
- Device: Pixel 4a (5G)
- OS: Android 12 (CalyxOS 3.2.0)
@cmonfortep
Copy link
Contributor

Hey @Naudiz this is something mostly handled by the launcher you use. We just indicate the size of our widget and the launcher calculates the required grids. Not sure why it shows 5x2 whereas we can see 5x1 on other launchers.

@bmx666
Copy link

bmx666 commented Apr 3, 2022

Hi @cmonfortep why this bug was closed without any further investigation?

I have similar issue on Sony Xperia 1 III with native Sony Xperia Home Launcher and Android 12

@cmonfortep
Copy link
Contributor

@bmx666 sony devices have their own launcher, not sure how they handle widget sizes. Do you want to share a screenshot of DDG widgets on the sony launcher widgets list? (as the first screenshot @Naudiz attached)

@bmx666
Copy link

bmx666 commented Apr 3, 2022

@cmonfortep I recompiled project and located the bug is related to minHeight attribute


android:minHeight="40dp"

If set minHeight to 31dp then Sony Launcher set size of SearchBar widget to 5x1

@bmx666
Copy link

bmx666 commented Apr 3, 2022

@cmonfortep screenshots after set minHeight to 31dp

Widget window

photo_2022-04-03 20 14 16

Launcher desk

photo_2022-04-03 20 14 13

@cmonfortep
Copy link
Contributor

I will review the values on the minheight, thanks. If I'm not wrong, our small widget uses more than 31dp.

@bmx666
Copy link

bmx666 commented Apr 3, 2022

I read Android article about widget on Android 12 -> Determine a size for your widget

I made res/xml-v31/search_widget_info.xml for Android 12 and higher, where minHeight was replaced on targetCellHeight attribute that is work perfectly. If mix minHeight with targetCellHeight then Sony Launcher displays widget as 5x2

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
    android:initialKeyguardLayout="@layout/search_widget"
    android:initialLayout="@layout/search_widget"
    android:minWidth="314dp"
    android:minResizeWidth="110dp"
    android:targetCellHeight="1"
    android:previewImage="@drawable/search_widget_preview"
    android:resizeMode="horizontal"
    android:updatePeriodMillis="86400000"
    android:widgetCategory="home_screen|keyguard" />

@Drag0nFly
Copy link

This widget took up almost half of the screen size; it could also not be moved and/or resized. It also cluttered up all the icons to make room for itself.

Along with its "smaller" companion widget, more than half the screen was unusable. After forcibly killing DuckDuckGo, and seeing the widgets persisting, the only remaining option was to uninstall it and reboot the phone.

This from a long time DuckDuckGo user. Way to go folks.

@bmx666
Copy link

bmx666 commented Jun 20, 2023

Hi @cmonfortep any updates? I provided to you a final solution year ago, why this issue is still closed? Could you re-open it?

bmx666 added a commit to bmx666/duckduckgo_android that referenced this issue Jun 20, 2023
bmx666 added a commit to bmx666/duckduckgo_android that referenced this issue Jun 20, 2023
bmx666 added a commit to bmx666/duckduckgo_android that referenced this issue Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants