Webview Script Injection for Foldable Page Layout Adaptation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Foldable electronic devices face issues with content display when unfolded, leading to user inoperability and layout overlapping due to non-uniform scaling across different Webview kernels from various vendors, limiting the utilization of the larger screen.
Innovation Solution
A method is introduced to identify built-in Webviews and inject a script file to adaptively layout pages using an adaptive layout plug-in, enhancing user experience by ensuring consistent display across different Webview kernels.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If WebUI adaptive technology is used to scale down and rearrange page elements, then user inoperability and layout overlapping problems are resolved, but the technology cannot be used in Webview kernels of different vendors
Solution Approach 1:
The patent introduces a bridge class as an intermediary component that connects the system's adaptive layout capability with Webview kernels from different vendors. This bridge class translates and adapts the adaptive layout commands to work across multiple vendor-specific Webview implementations, thereby resolving the compatibility issue while maintaining ease of operation.
Solution Approach 2:
The patent creates a universal adaptive layout mechanism that can function across different Webview kernels from various vendors. By designing the adaptation layer to be vendor-agnostic and using standardized interfaces, the system achieves multi-functionality and broad compatibility while maintaining consistent user experience across different implementations.
2Object-generated harmful factors
If page elements are scaled down to fit the larger screen, then layout overlapping is prevented, but content may become too small to read or interact with
Solution Approach 1:
The patent implements dynamic layout adjustment that adapts page element sizes and positions based on the specific screen configuration and content type. Rather than uniform scaling, the system dynamically calculates optimal dimensions for each element to prevent overlapping while maintaining readability, adjusting the layout in real-time based on the unfolded screen's characteristics.
Solution Approach 2:
The patent applies different scaling and layout strategies to different regions and types of content on the page. Critical content areas maintain larger sizes for readability, while less critical areas are scaled down to fit the overall layout, preventing overlapping without compromising the readability of important information.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
This application provides a page display method, an electronic device, and a storage medium. The method includes: determining, in response to detecting that a page in an application is opened, whether a Webview of the application is a built-in Webview of the application; and if it is determined that the Webview of the application is the built-in Webview of the application, injecting a script file into the Webview of the application, where the script file is used to process the page. The method provided in this application helps improve page browsing experience of a user.