Display control method, display control device, storage medium and electronic equipment

文档序号:1875102 发布日期:2021-11-23 浏览:18次 中文

阅读说明:本技术 显示控制方法、装置、存储介质及电子设备 (Display control method, display control device, storage medium and electronic equipment ) 是由 陈彪 于 2020-05-18 设计创作,主要内容包括:本申请实施例公开了一种显示控制方法、装置、存储介质及电子设备,其中,本申请实施例应用于包含有可伸缩的柔性显示屏的电子设备,在柔性显示屏进行伸缩的过程中,检测伸缩长度并根据伸缩长度确定屏幕有效显示尺寸;确定前台运行的应用程序,并按照有效显示尺寸调整窗口管理服务中应用程序的窗口尺寸参数;按照调整后的窗口尺寸参数,对应用程序的窗口进行重新布局;根据重新布局后的窗口,在屏幕上重新绘制和显示应用程序的显示界面。通过该方案,随着柔性显示屏的伸缩,不断地对窗口尺寸参数进行调整,以使运行在前台的应用程序能够适应性地、动态地调整显示界面的布局,以适应伸缩后的显示区域。(The embodiment of the application discloses a display control method, a display control device, a storage medium and electronic equipment, wherein the embodiment of the application is applied to the electronic equipment comprising a telescopic flexible display screen, and in the process of stretching the flexible display screen, the stretching length is detected and the effective display size of the screen is determined according to the stretching length; determining an application program operated in a foreground, and adjusting window size parameters of the application program in the window management service according to the effective display size; re-arranging the window of the application program according to the adjusted window size parameter; and redrawing and displaying the display interface of the application program on the screen according to the window after the layout is completed. According to the scheme, the window size parameters are continuously adjusted along with the expansion and contraction of the flexible display screen, so that an application program running in a foreground can adaptively and dynamically adjust the layout of a display interface to adapt to the expanded display area.)

1. A display control method is applied to an electronic device comprising a flexible display screen which can be stretched, and comprises the following steps:

in the process of stretching the flexible display screen, detecting the stretching length and determining the effective display size of the screen according to the stretching length;

determining an application program operated in a foreground, and adjusting window size parameters of the application program in a window management service according to the effective display size;

re-arranging the window of the application program according to the adjusted window size parameter;

and redrawing and displaying the display interface of the application program on the screen according to the window subjected to the layout again.

2. The method of claim 1, wherein the determining the foreground-running application and adjusting the window size parameter of the application in the window management service according to the effective display size comprises:

determining an application program operated in a foreground;

determining window state data corresponding to the application program according to window management service;

and modifying the related variable of the window state data and the screen display size to be consistent with the effective display size.

3. The display control method according to claim 2, wherein said rearranging the window of the application program according to the adjusted window size parameter includes:

adjusting the display size of the root view of the application program according to the adjusted window size parameter;

and re-laying out the display elements in the window of the application program according to the adjusted display size of the root view and the layout attribute of the display elements in the window.

4. The display control method according to claim 3, further comprising, after the re-laying out of the display elements in the window of the application program:

and when the content display area in the display element subjected to the re-layout is changed, acquiring the display content corresponding to the content display area, and loading the display content in the corresponding display element.

5. The display control method according to any one of claims 1 to 4, wherein the electronic device includes a position detection sensor; the detecting of the stretching length and the determining of the effective display size of the screen according to the stretching length comprise:

detecting the stretching direction and the stretching length of the flexible display screen according to the position sensor;

acquiring a recorded historical display size, and calculating to obtain an effective display size after stretching according to the stretching length, the stretching direction and the historical display size;

and updating the historical display size of the record according to the effective display size.

6. The display control method according to claim 5, wherein the flexible display screen includes a reel, and the position detection sensor is an angular velocity sensor connected to the reel; according to position sensor detects flexible display screen's flexible direction and flexible length, include:

detecting the rotation angle and the rotation direction of the reel according to the angular velocity sensor;

and calculating the telescopic length of the flexible display screen according to the rotation angle, and determining the telescopic direction of the flexible display screen according to the rotation direction.

7. The display control method according to claim 5, wherein after detecting the telescopic length and determining the screen effective display size according to the telescopic length, further comprising:

judging whether the difference value between the effective display size and the historical display size is within a preset range;

and if not, executing the application program which is determined to be operated in the foreground, and adjusting the window size parameter of the application program in the window management service according to the effective display size.

8. A display control apparatus, wherein the apparatus is applied to an electronic device including a flexible display screen that is retractable, the apparatus comprising:

the flexible display screen comprises a flexible display screen body, a telescopic detection module and a display module, wherein the flexible display screen body is used for displaying a display screen;

the parameter adjusting module is used for determining an application program running in the foreground and adjusting the window size parameter of the application program in the window management service according to the effective display size;

the window layout module is used for re-laying the windows of the application program according to the adjusted window size parameters;

and the interface drawing module is used for redrawing and displaying the display interface of the application program on the screen according to the window after the layout is changed.

9. A storage medium having stored thereon a computer program, characterized in that when the computer program runs on a computer, the computer is caused to execute the display control method according to any one of claims 1 to 7.

10. An electronic device comprising a processor and a memory, the memory storing a computer program, wherein the processor is configured to execute the display control method according to any one of claims 1 to 7 by calling the computer program.

Technical Field

The present application relates to the field of electronic device technologies, and in particular, to a display control method and apparatus, a storage medium, and an electronic device.

Background

With the development of electronic equipment technology, display screens of intelligent terminals such as smart phones and tablet computers are developed in a growing way, and because a larger display screen can present richer contents, human-computer interaction is more vivid and efficient, and more excellent user experience is brought; meanwhile, in order to enable the intelligent terminal to be carried more easily, a foldable terminal and a flexible screen terminal are born, and the portability requirement of the intelligent terminal with a large display screen is met to a great extent.

Disclosure of Invention

The embodiment of the application provides a display control method and device, a storage medium and electronic equipment, which can realize self-adaptive adjustment of application layout along with expansion and contraction of a display screen.

In a first aspect, an embodiment of the present application provides a display control method, where the method is applied to an electronic device including a flexible display screen that is retractable, and the method includes:

in the process of stretching the flexible display screen, detecting the stretching length and determining the effective display size of the screen according to the stretching length;

determining an application program operated in a foreground, and adjusting window size parameters of the application program in a window management service according to the effective display size;

re-arranging the window of the application program according to the adjusted window size parameter;

and redrawing and displaying the display interface of the application program on the screen according to the window subjected to the layout again.

In a second aspect, an embodiment of the present application further provides a display control apparatus, where the apparatus is applied to an electronic device including a flexible display screen that is retractable, and the apparatus includes:

the flexible display screen comprises a flexible display screen body, a telescopic detection module and a display module, wherein the flexible display screen body is used for displaying a display screen;

the parameter adjusting module is used for determining an application program running in the foreground and adjusting the window size parameter of the application program in the window management service according to the effective display size;

the window layout module is used for re-laying the windows of the application program according to the adjusted window size parameters;

and the interface drawing module is used for redrawing and displaying the display interface of the application program on the screen according to the window after the layout is changed.

In a third aspect, embodiments of the present application further provide a storage medium having a computer program stored thereon, where the computer program is executed on a computer, so that the computer executes a display control method according to any of the embodiments of the present application.

In a fourth aspect, an embodiment of the present application further provides an electronic device, which includes a processor and a memory, where the memory has a computer program, and the processor is configured to execute the display control method according to any embodiment of the present application by calling the computer program.

The technical scheme provided by the embodiment of the application is applied to the electronic equipment comprising a telescopic flexible display screen, the electronic equipment detects the telescopic length in the process of stretching the flexible display screen, determines the effective display size of the screen after stretching according to the detected telescopic length, namely the new size of the display area of the display screen after stretching, adjusts the window size parameter of a foreground application program according to the effective display size based on a window management service, re-arranges the window of the application program based on the adjusted window size parameter, redraws and displays the display interface of the application program on the screen, and continuously adjusts the window size parameter along with the stretching of the flexible display screen so that the application program running on the foreground can adaptively and dynamically adjust the layout of the display interface, to accommodate the zoomed display area.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;

fig. 2 is another schematic structural diagram of an electronic device according to an embodiment of the present application;

fig. 3 is a perspective exploded schematic view of an electronic device according to an embodiment of the present application;

FIG. 4 is a cross-sectional view of the electronic device of FIG. 1 taken along lines V1-V1;

FIG. 5 is a cross-sectional view of the electronic device of FIG. 2 taken along lines V2-V2;

fig. 6 is a schematic view of an application scenario of a display control method according to an embodiment of the present application;

fig. 7 is a schematic view of a window of an application in the display control method according to the embodiment of the present application;

fig. 8 is a schematic diagram of a window layout in the display control method according to the embodiment of the present application;

fig. 9 is another schematic diagram of a window layout in the display control method according to the embodiment of the present application;

fig. 10 is a further schematic diagram of a window layout in the display control method according to the embodiment of the present application;

fig. 11 is another schematic diagram of a window layout in the display control method according to the embodiment of the present application;

fig. 12 is a further schematic diagram of a window layout in the display control method according to the embodiment of the present application;

fig. 13 is a schematic structural diagram of a display control apparatus according to an embodiment of the present application;

fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present application;

fig. 15 is a schematic structural diagram of an electronic device according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, are within the scope of the present application.

Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.

An execution main body of the display control method may be the display control device provided in the embodiment of the present application, or an electronic device integrated with the display control device, where the display control device may be implemented in a hardware or software manner.

The embodiment of the application provides a display control method, which is applied to electronic equipment comprising a telescopic flexible display screen. Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device may be a smart phone, a tablet computer, a palm computer, a notebook computer, or a desktop computer. In the example of fig. 1, the electronic device has a flexible display screen with one end disposed on a spool such that a portion of the flexible display screen may be wound around the spool, the spool operable to wind up and release the flexible display screen to expand the display portion of the flexible display screen assembly. The flexible display screen can be extended or retracted in a direction perpendicular to the scroll. For example, please refer to fig. 2, fig. 2 is a second structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device shown in fig. 2 has a flexible display screen in an extended state. The user can expand the display part of flexible display screen when needs use the large screen and experience in order to improve user's operation, simultaneously, when need not use the large screen, can not expand display part to make the complete machine size less, conveniently carry.

It should be noted that the telescopic direction of the flexible display screen in fig. 1 is only an example, and in other embodiments, the flexible display screen may also be configured to be telescopic along a vertical direction when a user holds the device vertically.

When the display screen of the electronic device is in a display state, if the flexible display screen is stretched or retracted, the display interface is rearranged and drawn according to the display control method provided by the embodiment of the application, so that the display interface can adapt to the stretched screen. For example, in the process of stretching the flexible display screen, the stretching length is detected, and the effective display size of the screen is determined according to the stretching length; determining an application program operated in a foreground, and adjusting window size parameters of the application program in the window management service according to the effective display size; re-arranging the window of the application program according to the adjusted window size parameter; and redrawing and displaying the display interface of the application program on the screen according to the window after the layout is completed. In this way, as the flexible display screen expands and contracts, the window size parameter is continuously adjusted, so that the application program running in the foreground can adaptively and dynamically adjust the layout of the display interface to adapt to the expanded and contracted display area.

Referring to fig. 1 to fig. 3, an electronic device 100 of the present embodiment includes a housing assembly 10, a flexible display 30, a driver 50, and a driving mechanism 70.

The shell assembly 10 is a hollow structure; the components of the driver 50, the drive mechanism 70, and the camera 60 may all be disposed in the housing assembly 10. It is understood that the electronic device 100 according to the embodiment of the present disclosure includes, but is not limited to, a mobile terminal such as a mobile phone, a tablet computer, or other portable electronic devices, and the electronic device 100 is taken as an example of a mobile phone herein.

In the present embodiment, the housing assembly 10 includes a first housing 12 and a second housing 14, and the first housing 12 and the second housing 14 are relatively movable. Specifically, in the present embodiment, the first housing 12 and the second housing 14 are slidably connected, that is, the second housing 14 is slidable relative to the first housing 12.

Specifically, referring to fig. 4 and 5, the first casing 12 and the second casing 14 together form an accommodating space 16. The accommodating space 16 can be used for accommodating components such as the driver 50, the camera 60, the driving mechanism 70 and the like. The housing assembly 10 may further include a rear cover 18, and the rear cover 18 and the first and second housings 12 and 14 together form an accommodating space 16.

The driving element 50 is disposed on the second housing 14, one end of the flexible display 30 is disposed on the first housing 12, the flexible display 30 bypasses the driving element 50, and the other end of the flexible display is disposed in the accommodating space 16, so that a part of the flexible display is hidden in the accommodating space 16, and a part of the flexible display 30 hidden in the accommodating space 16 may not be lighted. When the first housing 12 and the second housing 14 are relatively far away from each other, the driving member 50 can drive the flexible display 30 to unfold, so that more flexible display 30 are exposed out of the accommodating space 16. The portion of the flexible display screen 30 exposed outside the accommodating space 16 is lighted up, so that the display area presented by the electronic device 100 is enlarged.

The driving member 50 may be a rotating shaft structure with teeth 52 on the outside, the flexible display 30 is linked with the driving member 50 by engaging, and when the first casing 12 and the second casing 14 are relatively far away from each other, the driving member 50 drives a portion of the flexible display 30 engaged with the driving member 50 to move and unfold.

It is understood that the driver 50 can also be a circular shaft without the belt 52, and when the first casing 12 and the second casing 14 are relatively far away from each other, the driver 50 can stretch the portion of the flexible display screen 30 wound around the driver 50, so that more flexible display screen is exposed out of the accommodating space 16 and is in a flat state. Specifically, the driving member 50 is rotatably disposed on the second housing 14, and the driving member 50 can rotate along with the movement of the flexible display 30 when the flexible display 30 is gradually opened. In other embodiments, the driver 50 may be fixed to the second housing 14, and the driver 50 may have a smooth surface. When the flexible display 30 is spread, the driver 50 is slidably contacted with the flexible display 30 through its smooth surface.

When the first housing 12 and the second housing 14 are relatively close to each other, the flexible display screen can be retracted by the driving member 50. Alternatively, the electronic device 100 further includes a reset element (not shown), one end of the flexible display screen, which is accommodated in the accommodating space 16, is linked with the reset element, and when the first shell 12 and the second shell 14 are relatively close to each other, the reset element drives the flexible display screen 30 to reset, so that a part of the flexible display screen is retracted into the accommodating space 16.

In this embodiment, the driving mechanism 70 may be disposed in the accommodating space 16, the driving mechanism 70 may be linked with the second housing 14, and the driving mechanism 70 is configured to drive the second housing 14 to move away from the first housing 12, so as to drive the flexible display panel assembly 30 to extend. It will be appreciated that the drive mechanism 70 may be omitted and the user may directly move the first and second housings relative to one another, manually, etc.

Referring to fig. 6, fig. 6 is a first flowchart illustrating a display control method according to an embodiment of the present disclosure. The specific flow of the display control method provided by the embodiment of the application can be as follows:

in 101, in the process of stretching the flexible display screen, the stretching length is detected and the effective display size of the screen is determined according to the stretching length.

In the embodiment of the application, the operating system of the electronic device may be an android operating system or an ios operating system, and the application does not specifically limit the operating system of the electronic device, and for any operation, the electronic device has a corresponding window management service for managing window display. In order to facilitate the reader to understand the embodiment of the present application, the following description takes an android operating system as an example.

The android system is divided into four layers, namely an application program layer, an application program frame layer, a system operation library layer and a kernel layer from top to bottom. The kernel layer provides underlying drivers for various hardware of the electronic device, such as display, audio, camera, bluetooth, WI-FI, power management, and the like. The system operation library layer comprises a system library and an operation, and characteristic support is provided for the android system mainly through some c/c + + libraries. The Application framework layer mainly provides various APIs (Application programming interfaces) which may be used when the Application is constructed, and the activity management service (activity ma nager service) and the window management service (windows manager service) which are referred to in the following are both provided by the Application framework layer. All the applications installed on the electronic device are in an application layer, and include applications carried by the mobile phone and applications for android automatically by the user, such as WeChat, games and the like.

For the android system, windows (windows) is an abstraction that is used to draw user interfaces and respond to user input events. From the perspective of the application framework layer, the interface of the android system is composed of one or more windows, and the windows are managed by a window management service.

It should be noted that the windows referred to hereinafter include both application windows, such as a dialog box for WeChat, a browser search interface, etc., and system-level windows, such as a recently launched dialog box, a shutdown dialog box, a status bar drop-down bar, a lock screen interface, etc.

Further, in the android system, Activity is an application component that provides an interface through which a user can interact. An Activity corresponds to an application window on which interface elements, such as controls, etc., can be displayed and which can listen to user processing events. An application may have multiple activities. The Activity corresponding to the interface of the application program in the following text can be understood as the Activity corresponding to the interface. For example, the Activity corresponding to the dialog interface of the WeChat can be understood as the Activity corresponding to the dialog interface in the application program of the WeChat. The lifecycle of an Activity is managed by an Activity management service (activitymanager service) in the android system, and in a lifecycle of an Activity, there may be the following states: running: activity (at the top of the task stack) currently displayed on the screen, visible to the user; poused: still the user is visible, but interface focus has been lost, this Activity cannot interact with the user; stopping: the user can not see the current interface and can not interact with the user to be completely covered; and (3) Killed: the interface is destroyed.

Based on the android architecture and the window management service provided by the android system, a scheme of the embodiment of the application is explained next. In the related art, when parameters such as the height or the width of the display screen are changed, the physical size and the resolution of the display screen are changed, and the mainstream technology generally adapts the changes from the application program itself, which requires a software engineer to spend a lot of time and effort on adapting the layout. Each application in the end product needs to be adapted and the workload is very high.

According to the method and the device, adaptation development of the application program is not needed, and the display of the window is optimized based on the window management service from a system framework layer, so that the layout of the display interface can be adaptively adjusted by the application program along with the expansion and contraction of the flexible display screen, and the flexible display screen after the display interface of the application program can be adapted and contracted is achieved.

When the flexible display screen stretches, the size of the screen can be changed, namely the size of the display area of the display screen can be changed correspondingly. Therefore, once the flexible display screen is detected to start to execute the telescopic operation, the telescopic operation is monitored in real time, the telescopic length is obtained, and the effective display size of the screen is determined according to the telescopic length. Taking the flexible display screen to perform the stretching operation as an example, if the flexible display screen performs the stretching operation, the screen becomes large, and it is necessary to correspondingly increase each display element in the window of the application program currently displayed in the foreground and the adaptive adjustment window.

In order to realize that the display content of the screen can be adaptively changed along with the screen in real time in the expansion and contraction process of the display screen, the interface needs to be continuously laid out and drawn along with the expansion or contraction of the flexible screen. Therefore, the determination of the screen effective display size according to the telescopic length in 101 may be performed when the telescopic length is detected to be an effective telescopic length. The effective stretching length is a threshold value at which human eyes can perceive the change of the length or the width of the screen, and the threshold value can be an empirical value. When the stretching length is less than the threshold, the human eye may not feel the change of the screen length or width, and when the stretching length is greater than or equal to the threshold, the human eye may feel the change of the screen length or width.

Or, in another embodiment, after detecting the stretching length and determining the effective display size of the screen according to the stretching length, the method further includes: judging whether the difference value between the effective display size and the historical display size is within a preset range or not; if not, 102 is executed.

In this embodiment, each time the window layout is adjusted, the current effective display size is recorded as the history display size. When the layout is readjusted next time, according to whether the difference between the effective display size and the historical display size is larger than the preset range, if so, the human eyes can feel the change of the length or the width of the screen, and in order to realize that the display content of the screen can be adaptively changed along with the screen in real time in the expansion and contraction process of the display screen, the displayed window needs to be adaptively adjusted.

For example, when a user controls a screen to extend from 1080 pixel points to 1280 pixel points along the length direction, the user performs re-layout and drawing once every time the user detects that the user extends 4 pixel points, so that the window layout of the application program in the foreground is dynamically changed along with the expansion operation process, and the user can visually see that the length of the screen is increased along with the extension of the display screen.

Wherein, the effective display size is the length of the display screen in the telescopic direction. For example, if the flexible display screen is laterally stretched as shown in fig. 2, the effective display size is the width of the screen, and if the flexible display screen is vertically stretched, the effective display size is the length of the screen. The stretch length may be a positive value or a negative value. When the flexible display screen retracts inwards, the telescopic length is a negative value, and when the flexible display screen extends outwards, the telescopic length is a positive value.

There are various implementations for the detection of the telescoping length and the calculation of the effective display size. For example, in one embodiment, the electronic device is provided with a position sensor, and the telescopic direction and the telescopic length of the flexible display screen are detected according to the position sensor; acquiring a recorded historical display size, and calculating to obtain an effective display size after stretching according to the stretching length, the stretching direction and the historical display size; and updating the historical display size of the record according to the effective display size.

For example, the position sensor is an angular velocity sensor, the flexible display screen scroll is connected with the angular velocity sensor, and the flexible display screen is rolled by external force to stretch. Detecting the rotation angle and the rotation direction of the reel according to an angular velocity sensor; and calculating the telescopic length of the flexible display screen according to the rotation angle, and determining the telescopic direction of the flexible display screen according to the rotation direction.

In this embodiment, each time the window layout is adjusted, the current effective display size is recorded as the history display size. When the layout is readjusted next time, the effective display size is calculated according to the historical display size, the stretching length and the stretching direction. In the rolling process of the flexible display screen, the angular velocity sensor can record the rolling number of turns of the flexible display screen and the rotating degree of the flexible display screen, and the diameter of the flexible display screen is known according to the reel of the flexible display screen. Based on the formula S × N × pi × D/360, the stretch length can be calculated. N is the rotation angle of the flexible display screen, if the rotation degree is 390 degrees, the rotation is 30 degrees after the scroll rotates 1 circle. D is the diameter of the reel, and S is the length of the extension and contraction. The angular velocity sensor can recognize the rotation direction of the reel, for example, clockwise rotation or counterclockwise rotation, and thus, the telescopic direction of the flexible display screen can be known. After the telescopic length is determined, calculating according to the historical display size of the flexible display screen before the flexible display screen is telescopic and the telescopic length to obtain the effective display size after the flexible display screen is telescopic. Wherein the unit of the telescopic length may be expressed in inches or pixels.

Alternatively, in another embodiment, the electronic device is provided with a light-sensitive detector, and the rollable portion of the flexible display screen is provided with marks, and the light-sensitive detector determines the telescopic length of the flexible display screen by recognizing the marks.

At 102, the foreground-running application is determined and the window size parameters of the application in the window management service are adjusted according to the effective display size.

For a running application, there is window state data (window) of the application in the window management service, which represents all attributes of a window, including window size parameters, such as the length and width of the window.

For example, in one embodiment, determining a foreground-running application and adjusting a window size parameter of the application in the window management service according to the effective display size includes: determining an application program operated in a foreground; determining window state data corresponding to the application program according to the window management service; and modifying the variables related to the screen display size in the window state data to be consistent with the effective display size.

In the embodiment of the present application, the window adopts a relative layout (relatedlayout) rule, that is, a fixed length is not used to represent the height or length of the layout, but attributes such as match _ parent, wrap _ content, and the like are used to represent the height or length of a specific display element. match _ parent indicates the size of its parent node, and wrap _ content indicates the same length as the content of itself. For example, if the height of the root node of the layout file of an application is defined as match _ parent, the height of the root view of the application is the height of the screen of the system.

The system framework layer adjusts the window size parameters of the application program in the window management service according to the effective display size without the need of adjusting by the application itself. For example, before the flexible display is zoomed, the window size parameter parent of the application in the window management service is [0,0], [720,1320 ]. Where 70 is the width of the screen and 1320 is the length of the screen. If the flexible display screen is extended by 10 pixel points along the length direction. The related variable in the window status data with respect to the screen display size is modified to coincide with the effective display size, for example, the parent parameter is modified to [0,0], [720,1330 ].

At 103, the window of the application is re-laid out according to the adjusted window size parameter.

At 104, the display interface of the application is redrawn and displayed on the screen according to the window after the layout is completed.

In an embodiment, the rearranging the window of the application program according to the adjusted window size parameter includes: adjusting the display size of the root view of the application program according to the adjusted window size parameter; and re-laying out the display elements in the window of the application program according to the adjusted display size of the root view and the layout attribute of the display elements in the window.

After adjusting the window size parameter of the application in the management service, the system framework layer sends a notification message to the activity of the application running in the foreground. And after the activity of the application program receives the notification information, the activity management service performs re-layout and drawing on the window. Because the window management service and the activity management service both work in the system framework layer, the scheme can realize the optimized management of the display of the window from the system framework layer, and does not need a software engineer to spend a great deal of time and energy on the application layout adaptation.

Referring to fig. 7, fig. 7 is a schematic view of a window of an application. The windows are laid out in a tree structure. The window includes a root view, the root view corresponds to a root container, and the layout attribute of the root container may be match _ parent, that is, when the root container determines the display size, the root container determines the size of the root view according to a parent parameter in the windows state data of the window management service, for example, if the parent is [0,0], [720,1330], then the root view size is 720 × 1330.

In the interface shown in fig. 7, the function bar 1, the function bar 2, the content data, the button 1, and the button 2 are sibling components, the root container is a parent container of the components, and each component has a corresponding display element, such as a picture, a button, text, and the like. These components also employ relative layout rules, that is, the position and attribute of each component are not written as fixed values, but the position is set according to the relative layout rules. For example, the layout property of the ribbon 1 is set to align with the top of the parent container; the layout property of the ribbon 2 is set to align with the bottom of the parent container. For another example, the button 1 is set to 150dp × 60dp in size, and is set to 200dp from the bottom of the parent container and 180dp from the left boundary of the parent container. If the size of the parent container changes, the position of the button 1 on the interface also changes adaptively based on the constraint relationship of the relative position. For another example, button 2 is laid out according to the position of its sibling component button 1, the size of button 2 is set to 50dp × 30dp, its position is set to 180dp from the right border of button 1, and 200dp from the parent container bottom. When the layout of the button 1 and the parent container is changed, the layout of the button 2 is also changed as the layout of the button 1 and the parent container is changed.

Where dp (density independent pixels) is a length unit for development, and 1dp represents a 1px (pixel) length at a screen pixel density of 160 ppi. Specifically, when there are 160 pixels per inch of screen, 1dp and 1px are equivalent. Thus, dp may be used to determine the number of pixels that a component corresponds to in different sized screens (where dpi of the screen is different). For example, if the length of any one component is 1dp, then on a screen with dpi of 160, the length of the component is 1 px; if the length of the component is 1 × 240/160 to 1.5 pixels on a 240dpi screen. That is, the length of dp is not a fixed value, but changes as the resolution of the screen changes.

Referring to fig. 8, fig. 8 is a schematic view of a window layout in a display control method according to an embodiment of the present disclosure. The flexible display screen in this illustration is vertically retractable, and a floating window is displayed over the window, with the layout attribute of the floating window being centered, i.e., displayed in the middle of the window. When the flexible display screen is extended and the length is increased, the position of the floating window on the whole screen can be adjusted along with the flexible display screen, and the floating window is always located in the middle of the window.

In addition, it should be noted that, although another window below the floating window is out of focus and in a Poused state, the window is still visible to the user in the foreground, so the size of the window is also adjusted correspondingly along the length of the screen.

Referring to fig. 9, fig. 9 is another schematic diagram of a window layout in a display control method according to an embodiment of the present application. The flexible display screen in the figure can be stretched in the vertical direction, an image is displayed in the window, and the layout of components corresponding to the image is set to be filled with the components according to display contents. Therefore, before the flexible display screen is stretched, the image itself has an aspect ratio much larger than that of the screen, and the image does not fill the screen in the width direction, while the aspect ratio of the screen increases as the flexible display screen is stretched, and the image is enlarged in equal proportion to fill the entire screen, and gradually fills the screen in the width direction.

In some embodiments, after the re-layout of the display elements in the window of the application program, the method further includes: and when the content display area in the display element subjected to the re-layout is changed, acquiring the display content corresponding to the content display area, and loading the display content in the corresponding display element.

Referring to fig. 10, fig. 10 is another schematic view of a window layout in the display control method according to the embodiment of the present application. The window is a browser search interface, wherein the function bar 1 is a search bar, the function bar 2 is a function space bar of the browser, the content data is a search result page, and the search result page can be displayed on the page in a waterfall flow or information list mode. The layout property of the ribbon 1 is aligned with the top of the parent container and the layout property of the ribbon 2 is aligned with the bottom of the parent container. Thus, as the flexible display is extended, the position of the ribbon 1 does not change, while the position of the ribbon 2 moves downward and always aligns with the bottom of the root view.

Due to the stretching of the screen, the displayable length of the content display area where the content data displayed in the form of the waterfall flow or the information list is located in the length direction of the screen is longer, and the content which can be displayed in the content display area is also increased, so that more content which is not displayed in the current page can be displayed in the area. That is, the content data may be displayed on the interface as more content is pulled out like a drawer while the screen is stretched.

The scheme shown in fig. 10 may be applied to a scene in which a plurality of windows include function bars and content data and the content data is displayed in a waterfall stream or an information list.

Referring to fig. 11, fig. 11 is another schematic view of a window layout in a display control method according to an embodiment of the present application. The flexible display screen in this illustration is laterally retractable. Similar to the principle of the window shown in fig. 8, as the flexible display screen is stretched laterally, the position of the floating window on the whole screen is adjusted and always stays at the middle of the window when the width of the floating window is widened.

Referring to fig. 12, fig. 12 is another schematic view of a window layout in the display control method according to the embodiment of the present application. The flexible display screen in this illustration is laterally retractable. Similar to the principle of the window shown in fig. 10. The difference is that the layout property of the function bar 1 is aligned with the parent container top, left boundary and right boundary, and the size of the function bar 1 has a fixed dp value in the vertical direction. The layout properties of the ribbon 2 are aligned with the parent container bottom, left boundary, and right boundary, and the size of the ribbon 2 has a fixed dp value in the vertical direction. When the width of the screen becomes wider as the flexible display screen is laterally extended, the widths of the function bar 1 and the function bar 2 are adaptively adjusted to be consistent with the width of the screen. And the displayable width of the content display area where the content data displayed in the waterfall flow or information list mode is located in the screen width direction is widened, and the display mode of each piece of information or data in the area on the screen is correspondingly adjusted. As shown in fig. 12, if the content data is text data, more words can be displayed per line.

It should be noted that the layout properties and the illustrations listed in the above embodiments are only examples, and in other embodiments, a scheme of performing layout while observing relative layout rules may be included in the scope of the embodiments of the present application. In addition, the above embodiment is described by taking the screen as an example, and when the flexible display screen is folded and retracted and the screen becomes smaller, the same principle is used, and only the values of the relevant parameters are reduced, which is not described herein again.

And after the window of the application program is rearranged based on the mode according to the adjusted window size parameter, redrawing and displaying the display interface of the application program on the screen according to the window after being rearranged so as to adapt to the stretched screen. If the scaling operation continues, the process returns to the step 101 to 104, and the process is circulated to realize the dynamic adjustment of the window layout until the scaling operation is terminated.

In addition, in order to quickly implement dynamic adjustment of the display interface layout, only the window layout of the application program in the foreground is adjusted, and for the application programs in the background, when the application programs are switched to the foreground, the activity management service detects that the states of the application programs are changed, and the application programs are rearranged and drawn.

In particular implementation, the present application is not limited by the execution sequence of the described steps, and some steps may be performed in other sequences or simultaneously without conflict.

From the above, the display control method provided in the embodiment of the present application is applied to an electronic device including a flexible display screen that is capable of being extended and retracted, wherein during the extension and retraction of the flexible display screen, the electronic device detects the extension and retraction length, determines the effective display size of the screen after the extension and retraction occurs, that is, the new size of the display area of the display screen after the extension and retraction occurs, adjusts the window size parameter of a foreground application according to the effective display size based on a window management service, re-lays the window of the application based on the adjusted window size parameter, and re-draws and displays the display interface of the application on the screen, and according to the scheme, the window size parameter is continuously adjusted along with the extension and retraction of the flexible display screen, so that the application running on the foreground can adaptively and dynamically adjust the layout of the display interface, to accommodate the zoomed display area.

In one embodiment, a display control apparatus is also provided. Referring to fig. 13, fig. 13 is a schematic structural diagram of a display control apparatus 300 according to an embodiment of the present disclosure. The display control apparatus 300 is applied to an electronic device, and the display control apparatus 300 includes a telescopic detection module 301, a parameter adjustment module 302, a window layout module 303, and an interface drawing module 304, as follows:

the flexible display screen comprises a telescopic detection module 301, a display module and a display module, wherein the telescopic detection module 301 is used for detecting the telescopic length and determining the effective display size of the screen according to the telescopic length in the process of stretching the flexible display screen;

a parameter adjusting module 302, configured to determine an application program running in a foreground, and adjust a window size parameter of the application program in a window management service according to the effective display size;

a window layout module 303, configured to re-layout the window of the application program according to the adjusted window size parameter;

and the interface drawing module 304 is used for redrawing and displaying the display interface of the application program on the screen according to the window after the layout is completed.

In some embodiments, the parameter adjustment module 302 is further configured to: determining an application program operated in a foreground; determining window state data corresponding to the application program according to window management service; and modifying the related variable of the window state data and the screen display size to be consistent with the effective display size.

In some embodiments, the window layout module 303 is further configured to: adjusting the display size of the root view of the application program according to the adjusted window size parameter; and re-laying out the display elements in the window of the application program according to the adjusted display size of the root view and the layout attribute of the display elements in the window.

In some embodiments, the interface rendering module 304 is further configured to: and when the content display area in the display element subjected to the re-layout is changed, acquiring the display content corresponding to the content display area, and loading the display content in the corresponding display element.

In some embodiments, the electronic device includes a position detection sensor; the telescoping detection module 301 is further configured to: detecting the stretching direction and the stretching length of the flexible display screen according to the position sensor; acquiring a recorded historical display size, and calculating to obtain an effective display size after stretching according to the stretching length, the stretching direction and the historical display size; and updating the historical display size of the record according to the effective display size.

In some embodiments, the flexible display screen comprises a reel, and the position detection sensor is an angular velocity sensor connected to the reel; the telescoping detection module 301 is further configured to: detecting the rotation angle and the rotation direction of the reel according to the angular velocity sensor; and calculating the telescopic length of the flexible display screen according to the rotation angle, and determining the telescopic direction of the flexible display screen according to the rotation direction.

In some embodiments, the parameter adjustment module 302 is further configured to: judging whether the difference value between the effective display size and the historical display size is within a preset range; and if not, executing the application program which is determined to be operated in the foreground, and adjusting the window size parameter of the application program in the window management service according to the effective display size.

It should be noted that the display control device provided in the embodiment of the present application and the display control method in the foregoing embodiments belong to the same concept, and any method provided in the embodiment of the display control method can be implemented by the display control device, and the specific implementation process thereof is described in detail in the embodiment of the display control method, and is not described herein again.

As can be seen from the above, the display control apparatus provided in this embodiment of the application includes a flexible display screen, a telescopic detection module 301, a parameter adjustment module 302, a window layout module 303, and an interface drawing module 304, wherein in the process of telescopic operation of the flexible display screen, the telescopic detection module 301 detects the telescopic length, and determines the effective display size of the screen after telescopic operation, i.e. the new size of the display area of the display screen after telescopic operation, according to the detected telescopic length, the parameter adjustment module 302 adjusts the window size parameter of the foreground application program according to the effective display size based on the window management service, the window layout module 303 performs re-layout on the window of the application program based on the adjusted window size parameter, the interface drawing module 304 redraws and displays the display interface of the application program on the screen, and according to this scheme, along with the telescopic operation of the flexible display screen, the window size parameter is continuously adjusted, so that an application program running in the foreground can adaptively and dynamically adjust the layout of the display interface to adapt to the telescopic display area.

The embodiment of the application also provides the electronic equipment. The electronic device can be a smart phone, a tablet computer and the like. Referring to fig. 14, fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device 400 comprises a processor 401 and a memory 402. The processor 401 is electrically connected to the memory 402.

The processor 401 is a control center of the electronic device 400, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or calling a computer program stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device.

Memory 402 may be used to store computer programs and data. The memory 402 stores computer programs containing instructions executable in the processor. The computer program may constitute various functional modules. The processor 401 executes various functional applications and data processing by calling a computer program stored in the memory 402.

In this embodiment, the processor 401 in the electronic device 400 loads instructions corresponding to one or more processes of the computer program into the memory 402 according to the following steps, and the processor 401 runs the computer program stored in the memory 402, so as to implement various functions:

in the process of stretching the flexible display screen, detecting the stretching length and determining the effective display size of the screen according to the stretching length;

determining an application program operated in a foreground, and adjusting window size parameters of the application program in a window management service according to the effective display size;

re-arranging the window of the application program according to the adjusted window size parameter;

and redrawing and displaying the display interface of the application program on the screen according to the window subjected to the layout again.

In some embodiments, please refer to fig. 15, and fig. 15 is a second structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device 400 further comprises: radio frequency circuit 403, display 404, control circuit 405, input unit 406, audio circuit 407, sensor 408, and power supply 409. The processor 401 is electrically connected to the radio frequency circuit 403, the display 404, the control circuit 405, the input unit 406, the audio circuit 407, the sensor 408, and the power source 409.

The radio frequency circuit 403 is used for transceiving radio frequency signals to communicate with a network device or other electronic devices through wireless communication.

The flexible display screen 404 may be used to display information input by or provided to a user as well as various graphical user interfaces of the electronic device, which may be comprised of images, text, icons, video, and any combination thereof.

The control circuit 405 is electrically connected to the display screen 404, and is configured to control the display screen 404 to display information.

The input unit 406 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. The input unit 406 may include a fingerprint recognition module.

The audio circuit 407 may provide an audio interface between the user and the electronic device through a speaker, microphone. Wherein the audio circuit 407 comprises a microphone. The microphone is electrically connected to the processor 401. The microphone is used for receiving voice information input by a user.

The sensor 408 is used to collect external environmental information. The sensors 408 may include one or more of ambient light sensors, acceleration sensors, gyroscopes, etc.

The power supply 409 is used to power the various components of the electronic device 400. In some embodiments, the power source 409 may be logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are implemented through the power management system.

Although not shown in the drawings, the electronic device 400 may further include a camera, a bluetooth module, and the like, which are not described in detail herein.

In this embodiment, the processor 401 in the electronic device 400 loads instructions corresponding to one or more processes of the computer program into the memory 402 according to the following steps, and the processor 401 runs the computer program stored in the memory 402, so as to implement various functions:

in the process of stretching the flexible display screen, detecting the stretching length and determining the effective display size of the screen according to the stretching length;

determining an application program operated in a foreground, and adjusting window size parameters of the application program in a window management service according to the effective display size;

re-arranging the window of the application program according to the adjusted window size parameter;

and redrawing and displaying the display interface of the application program on the screen according to the window subjected to the layout again.

From the above, embodiments of the present application provide an electronic device, which, during the process of extending and retracting the flexible display screen, detecting the stretching length, determining the effective display size of the stretched screen according to the detected stretching length, i.e. the new size of the display area after the expansion and contraction of the display screen, based on the window management service, the window size parameter of the foreground application program is adjusted according to the effective display size, based on the adjusted window size parameter, the window of the application program is rearranged, and the display interface of the application program is redrawn and displayed on the screen, by the proposal, the window size parameter is continuously adjusted along with the expansion and contraction of the flexible display screen, so that the application program running in the foreground can adaptively and dynamically adjust the layout of the display interface to adapt to the display area after expansion and contraction.

An embodiment of the present application further provides a storage medium, where a computer program is stored in the storage medium, and when the computer program runs on a computer, the computer executes the display control method according to any one of the above embodiments.

It should be noted that, all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, which may include, but is not limited to: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.

Furthermore, the terms "first", "second", and "third", etc. in this application are used to distinguish different objects, and are not used to describe a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to only those steps or modules listed, but rather, some embodiments may include other steps or modules not listed or inherent to such process, method, article, or apparatus.

The display control method, the display control apparatus, the storage medium, and the electronic device provided in the embodiments of the present application are described in detail above. The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

24页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种用于情绪调节的人机交互方法及设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类