Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Known bug fixes and improvements #359

Open
wants to merge 46 commits into
base: develop
Choose a base branch
from

Conversation

azuo
Copy link

@azuo azuo commented Sep 27, 2021

Location & weather

  • Geolocation support on Android 11 devices
  • Corrected weather information
  • New weather providers: HERE.com and AccuWeather.com

Calendar & events

  • Show and hide calendar events very accurately, never need to manually refresh any more
  • Optimized background updating algorithm for more battery saving
  • Correct handling of calendar events with multiple instances

Widget UI

  • Make remote grid views (widget_sans.xml) perfectly overlap the bitmap generated from the binding view (widget.xml), so that taps can trigger proper pending intents
  • Correctly display the clock, text and icons at any text size

Miscellaneous

  • Fix FontRequest thread leaks; fix RenderScript leaks
  • Replace font assets with font resources, replace Realm with Room, to significantly reduce the size of the apk (~28M smaller!)
  • Various UI-related bug fixes and improvements

Fixed issues

#288, #293, #318, #321, #326, #328, #330, #338, #340, #342, #343, #353

azuo added 30 commits August 12, 2021 14:12
…ar rather than the event details (tap the event title for the details).
1. UpdateCalendarService will fetch all events from now to the next fetch time + Preferences.showUntil, so that EventRepository holds all events need to be shown before the next fetch;
2. Every event is updated 1 minute after the corresponding time span, to make the actual time difference consistent with the displayed getRelativeTimeSpanString;
3. Update events only when necessary, eliminate redundant alarms; cancel all update alarms when showEvents is turned off.
# Conflicts:
#	app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/AlignedWidget.kt
#	app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/StandardWidget.kt
Adjust the layout carefully, so that remote grid views perfectly overlap the bitmap generated from the binding view, whether left-aligned, right-aligned or centered, and regardless of the size of the widget, text, margins or spacing.

Display the clock in the correct text size.
@tommasoberlose
Copy link
Owner

Hi @azuo! I'm absolutely astonished by the major changes that you've added to this PR, thank you so much for helping me.

I've quickly gone through all the commits you pushed and I'll run some tests asap but, in the meantime, I have a few questions for you:

  • have you considered that the AccuWeather API needs two different calls to be able to access the weather information? A free account would possibly run out of the daily limit, do you think we should address that inside the provider info?
  • I already tried to release a version of the application using the permission to access the location in the background but it's been rejected due to the fact we should use some kind of foreground service. At the same time, those kinds of services will be "deprecated" in Android 12 so we probably need to support the new solutions that are suggested.

Thank you again for the major work you've done.

@azuo
Copy link
Author

azuo commented Sep 30, 2021

This widget is great, and I like it so much that I can't resist fixing any bugs I encountered while using it. But in order not to interfere or conflict with your ideas, I just make fixes or patches, but try to avoid adding, removing or refactoring any features.

Migrating to Androd 12 may involve some changes that go well beyond "fixes" or "patches", but I will be happy to help if I can.

@tommasoberlose
Copy link
Owner

Any help is always appreciated! I'll handle the Android 12 transition in a specific branch once I'll have time to work on the widget for a while. Because I want to integrate the dynamic color feature inside the app as the first step and then moving forward to integrate it inside the widget customization system.

In the meantime, we definitely have to find another way to get the location of the devices while in the background, without using the permissions to access it from the background or the FINE_ACCESS one. Would be feasible for you to revert only the changes that cover this part to the way they were before?

1. Replace foreground services with Workers
2. Support approximate location
3. Fallback to inexact alarms if the SCHEDULE_EXACT_ALARM permission is revoked
4. Specify the mutability of each PendingIntent
5. Explicitly declare the android:exported attribute for app components that use intent filters
@azuo
Copy link
Author

azuo commented Oct 3, 2021

@tommasoberlose, Play Store has rejected a version due to the use of some kind of foreground service to access the location, right? But specifically because of foreground service or access the location in the background? Well, the foreground service can be replaced with a Worker, and ACCESS_FINE_LOCATION can be replaced with ACCESS_COARSE_LOCATION, but why can't we use ACCESS_BACKGROUND_LOCATION?

I think ACCESS_BACKGROUND_LOCATION is an absolute must. Without using geolocation in the background, the weather information would be very inaccurate, if not completely useless.

I investigated several top-ranking widget apps in Play Store that show weather, all of them use both ACCESS_FINE_LOCATION and ACCESS_BACKGROUND_LOCATION permissions, for example, Weather & Clock Widget for Android (API 29, 50M+ installs),
Transparent clock and weather forecast & radar (API 30, 50M+ installs) and Weather Widget & Weather Radar (API 30, Editor's Choice).

As with the above apps, it might be helpful to display a prominent prompt immediately after the app is launched?

azuo added 2 commits October 7, 2021 16:03
1. Adapt the location callback in WeatherWorker to coroutines
2. Merge EventListenerJob into UpdateCalendarWorker
3. Remove BatteryListenerJob, as it's impossible to use Jobs to detect battery status
@VladWinner
Copy link

@azuo I sincerely admire the comprehensive work you have done. Thanks!

@tjsuominen
Copy link

Wow, can't wait update to arrive to play store! Amazing work!

@coxackie
Copy link

Is this going to be merged for a new version?

@JoshuaKimsey
Copy link

Dang, you've done a lot of work on this! Hope to see these changes get pushed to the main branch soon! :)

@tjsuominen
Copy link

Hoping for the release push :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants