Skip to content

Simplify opening web pages#6887

Merged
grzesiek2010 merged 16 commits intogetodk:masterfrom
seadowg:web-view
Sep 19, 2025
Merged

Simplify opening web pages#6887
grzesiek2010 merged 16 commits intogetodk:masterfrom
seadowg:web-view

Conversation

@seadowg
Copy link
Member

@seadowg seadowg commented Sep 11, 2025

Follow up to #6886

Why is this the best possible solution? Were any other approaches considered?

This way of loading web pages was having problems with forum (Discourse) links as seen in #6879. My guess is that the double fallback it was there for (from Custom Tabs to external browser to WebView) is from a time when Custom Tabs were Chrome only (they were introduced almost 10 years ago to the day). That's no longer the case and most browsers on Android now support Custom Tabs, and it's very unlikely that a device would not have a browser installed.

We'd also ended up using WebViewActivity directly in some parts of the app, but I think that's a mistake.

Additionally, after refactoring how the web page preloading works, I realized that it was hardly being used, so I removed it. From the commit message:

This only worked with Chrome and was really only properly being used on the About screen. It doesn't feel worth maintaining code with that level of complexity for that minimal benefit.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

There should be no noticeable changes other than for devices that don't have a browser installed - they will now see a Toast error when opening a web page from the app (like the links in About).

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@seadowg seadowg changed the title Remove WebViewActivity Remove WebViewActivity Sep 11, 2025
This only worked with Chrome and was really only properly being
used on the About screen. It doesn't feel worth maintaining
code with that level of complexity for that minimal benefit.
@seadowg seadowg changed the title Remove WebViewActivity Simplify opening web pages Sep 12, 2025
@seadowg seadowg marked this pull request as ready for review September 12, 2025 10:51
Copy link
Member

@grzesiek2010 grzesiek2010 left a comment

Choose a reason for hiding this comment

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

@grzesiek2010 grzesiek2010 merged commit 6228f47 into getodk:master Sep 19, 2025
6 checks passed
@seadowg seadowg deleted the web-view branch September 19, 2025 12:42
@dbemke
Copy link

dbemke commented Sep 22, 2025

Tested with Success!

Verified on Androids: 8.1, 10

Verified cases:

  • opening links in "About" with Chrome, Brave, Mi Browser
  • trying to open links when Chrome is disabled
  • forms with external widgets

@WKobus
Copy link

WKobus commented Sep 22, 2025

Tested with success

Verified on device with Android 16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants