Display method and device, electronic equipment and storage medium
By generating and maintaining the information associated between the application and the display mode, the splash screen problem caused by inconsistent display modes when switching between front and back offices is solved, and timely synchronization of the operating system and application display modes is achieved, and the display effect of the interface is improved.
Patent Information
- Application Number
- CN202411946745.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-18
AI Technical Summary
When the application interface switches from the foreground to the background and then switches back to the foreground, there may be a flash screen phenomenon caused by inconsistent display modes of the operating system and the application.
By generating and maintaining the associated information between the application and the display mode, ensure that the display mode set by the operating system and the display mode of the application are kept in time during the switching process. The specific steps include determining the last display mode set by the user when the application switches from the foreground to the background, and updating the interface according to this mode when switching back to the foreground.
It effectively avoids the splashing phenomenon caused by inconsistent display modes of the operating system and application, and improves the display effect and user experience of the application interface.
Smart Images

Figure CN119847387A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic equipment, and specifically relates to a display method, device, electronic equipment and storage medium. Background Art
[0002] In order to adapt to different usage scenarios and meet personalized needs, electronic devices provide users with multiple display modes so that users can choose different display modes based on usage needs in different environments. For example, users can select the display mode of the electronic device through the setting function provided by the operating system, so that the electronic device draws the interface of the application according to the display mode selected by the user.
[0003] However, the application interface drawing thread and the setting notification thread for adjusting the display mode are two different threads, and the timing of the two cannot be guaranteed, which is an asynchronous behavior. When the setting notification thread is operated later than the interface drawing thread, the operating system will be in one display mode, while the application interface is drawn in another display mode. Since the two display modes are different, the interface will be redrawn according to the display color of the display mode set by the operating system when it is displayed, resulting in a flashing screen. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a display method, device, electronic device and storage medium, which can avoid the screen flashing phenomenon in the application interface.
[0005] In a first aspect, an embodiment of the present application provides a display method, including:
[0006] In the case of displaying the first interface of the application, generating first association information between the application and the first display mode according to the first display mode of the first interface;
[0007] In the case where the application is switched from the foreground application to the background application, determining second association information between the application and the second display mode, wherein the second association information is determined according to at least one switching of the display mode of the electronic device by the user;
[0008] When the application is switched from a background application to a foreground application, the second interface of the application is displayed according to the second display mode in the second association information.
[0009] In a second aspect, an embodiment of the present application provides a display device, including:
[0010] A generating module, configured to generate first association information between the application and the first display mode according to the first display mode of the first interface when displaying the first interface of the application;
[0011] a determination module, configured to determine second association information between the application and the second display mode when the application is switched from the foreground application to the background application;
[0012] The display module is used to display the second interface of the application according to the second display mode in the second association information when the application is switched from the background application to the foreground application.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and when the program or instruction is executed by the processor, the steps of the display method shown in the first aspect are implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the display method shown in the first aspect are implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a display interface, the display interface and the processor are coupled, and the processor is used to run programs or instructions to implement the steps of the display method shown in the first aspect.
[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the display method shown in the first aspect.
[0017] In an embodiment of the present application, when displaying the first interface of the application, first association information between the application and the first display mode is generated according to the first display mode of the first interface; when the application is switched from the foreground application to the background application, second association information between the application and the second display mode is determined, wherein the second association information is determined by the user switching the display mode of the electronic device at least once; when the application is switched from the background application to the foreground application, the second interface of the application is displayed according to the second display mode in the second association information. In this way, by establishing association information between the application and the display mode, the timely synchronization of the display mode set by the operating system and the display mode of the application is guaranteed, so that when the user switches the display mode of the electronic device at least once, such as when the application is switched from the foreground application to the background application and then switches back to the foreground application, the electronic device can display the interface of the application according to the display mode in the latest set association information, avoiding the contradiction that the operating system is set to one display mode and the application is another display mode, resulting in the flashing phenomenon of the application interface, thereby improving the display effect of the application interface. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flowchart of a display method provided for some embodiments of the present application;
[0019] Figure 2 A schematic flow chart of a display method provided for some embodiments of the present application;
[0020] Figure 3 A schematic flow chart of a display method provided for some embodiments of the present application;
[0021] Figure 4 A schematic flow chart of a display method provided for some embodiments of the present application;
[0022] Figure 5 A schematic flow chart of a display method provided for some embodiments of the present application;
[0023] Figure 6 A schematic flow chart of a display method provided for some embodiments of the present application;
[0024] Figure 7 A schematic diagram of the structure of a display device provided in some embodiments of the present application;
[0025] Figure 8 A schematic diagram of the structure of an electronic device provided for some embodiments of the present application;
[0026] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] The multiple display modes in electronic devices include dark mode and non-dark mode, where non-dark mode includes but is not limited to normal mode and reading mode. Among them, dark mode is a function that reduces the stimulation of the screen to the eyes and provides a comfortable visual experience by optimizing the contrast between the text foreground and the dark background. This mode can reduce the stimulation to the human eye by lowering the screen brightness, which not only helps protect the eyes, but also saves the power of the electronic device to a certain extent.
[0030] However, the application interface drawing thread and the operating system configuration notification thread are two different thread operations, which are asynchronous behaviors and cannot guarantee the timing of the two. When the config thread is operated later than the interface drawing thread, there will be a contradiction that the operating system is set to non-dark mode, while the application is in dark mode, so that the interface of the application will be redrawn according to the display color of the display mode set by the operating system when it is displayed, resulting in a black and white chaotic screen flashing phenomenon on the application interface.
[0031] The Config notification related to the Config notification thread in the embodiment of the present application refers to the configuration file or setting notification, which contains various parameters that control the behavior and appearance of the application. For example, the configuration file of an application may contain information such as color scheme, font size, data storage location, etc. Through these configuration files, users can adjust the behavior and appearance of the software according to their needs and preferences to meet the user's desired usage scenarios and workflows.
[0032] In the related technology, when an electronic device receives input for switching to a dark mode, it generates a config notification. At this time, the dark mode service in the application process will promptly update the display status of the application after receiving the config change, and then adjust the display status of the application's display interface according to the updated display status through the application's interface drawing thread.
[0033] The application's interface drawing thread and the operating system's config notification thread are two different thread operations, which are asynchronous behaviors, and the timing between the two cannot be fully guaranteed. When the application is a background application, if it receives input to turn on dark input and turn off dark mode in sequence, when the application switches from the background application to the foreground application, the application will receive two config changes. If the second config change is slower than the application switching back to the foreground application, there will be a contradiction that the operating system is set to non-dark mode, while the application is in dark mode, and a black and white confusion will occur.
[0034] For example, a user is using application A, clicks the Home button to return to the desktop, and turns on the dark mode. Then the user opens application B, clicks the Home button to return to the desktop, and turns off the dark mode. Then, when the user opens application A, there is a certain probability that the interface of application A will be in black and white, which seriously affects the user experience.
[0035] The fundamental reason for the above is that when application A switches from the foreground application to the background application, application A will be at the top of the background stack, and the system dark mode switching config will be sent to application A in time, and application A will enter the dark mode. When application B switches from the foreground application to the background application, application A will be pushed into the stack, and application B will be at the top of the background stack. At this time, the system dark mode switching config will not be sent until application A switches from the background application back to the foreground application. Since the interface drawing thread of application A and the config notification thread of the operating system are two threads, the timing cannot be guaranteed. Therefore, when the operation of the system config notification thread is later than the operation of the interface drawing thread, there will be a contradiction that the operating system is set to a non-dark mode, while the application is in dark mode, resulting in a black and white chaotic screen flashing phenomenon on the display interface of application A.
[0036] In order to solve the problems in the related technology, the embodiments of the present application provide a display method, an apparatus and an electronic device, which ensure the timely synchronization of the display mode set by the operating system and the display mode of the application, so that after the application is switched from a foreground application to a background application and then switched back to the foreground application, the application interface is displayed according to the display mode in the latest set associated information, avoiding the contradiction that the operating system is set to a non-dark mode while the application is in a dark mode, resulting in a chaotic black and white flashing screen phenomenon on the application interface.
[0037] The following is combined with Figures 1 to 6 , the display method provided in the embodiment of the present application is described in detail through specific embodiments and their application scenarios.
[0038] First, combine Figure 1 A display method provided in an embodiment of the present application is described in detail.
[0039] Figure 1 A flowchart of a display method provided for some embodiments of the present application.
[0040] like Figure 1 As shown, the display method provided in the embodiment of the present application can be applied to an electronic device. Based on this, the display method can include step 110 and step 130 as shown below.
[0041] Step 110, when displaying the first interface of the application, generating first association information between the application and the first display mode according to the first display mode of the first interface; Step 120, when the application is switched from a foreground application to a background application, determining second association information between the application and the second display mode, wherein the second association information is determined based on the user switching the display mode of the electronic device at least once; Step 130, when the application is switched from a background application to a foreground application, displaying the second interface of the application according to the second display mode in the second association information.
[0042] Exemplarily, when the user is using application A, the electronic device may display the first interface of application A. At this time, the first display mode of the first interface may be non-dark mode, and the first display mode of application A is recorded as non-dark mode, that is, application A-non-dark mode.
[0043] Next, when application A switches from a foreground application to a background application, the user can adjust the display mode of the electronic device to a dark mode. Based on this, when a second input is received for the user to switch the display mode of the electronic device once, the display mode of the electronic device switched this time, such as a dark mode, is obtained. Alternatively, when a second input is received for the user to switch the display mode of the electronic device at least twice, the display mode of the electronic device switched last time, such as a dark mode, is obtained. The display mode of the electronic device switched last time or at least twice, i.e., the dark mode, is compared with the first display mode in the first association information. If the first display mode information is a dark mode, there is no need to adjust the first association information, i.e., the first association information is determined as the second association information. If the first display mode is not a dark mode, the first display mode in the first association information is adjusted to the second display mode, i.e., application A-non-dark mode is adjusted to application A-dark mode, and its application A-dark mode is determined as the second association information. At this point, application A is still a background application.
[0044] Then, when the user input to re-view the interface of application A is received, that is, when application A is switched from a background application to a foreground application, the interface in application A can be redrawn according to the dark mode in application A-dark mode to obtain the second interface of the application, thereby displaying the second interface.
[0045] Therefore, by establishing association information between the application and the display mode, timely synchronization between the display mode set by the operating system and the display mode of the application is guaranteed, so that when the user switches the display mode of the electronic device at least once, such as after the application switches from the foreground application to the background application and then switches back to the foreground application, the electronic device can display the application interface according to the display mode in the latest set association information, avoiding the contradiction that the operating system is set to one display mode such as non-dark mode and the application is another display mode such as dark mode, which causes the application interface to appear in a flashing screen such as black and white confusion, thereby improving the display effect of the application interface.
[0046] The above steps are described in detail below, as shown below.
[0047] Regarding step 110 , in some embodiments of the present application, step 110 may specifically include step 1101 and step 1102 .
[0048] Step 1101: Create a new key-value pair in the system status table of the electronic device operating system according to the first display mode of the first interface, where the key-value pair includes a key element and a value element.
[0049] For example, Figure 2 As shown, when application A is started and displays the first interface, the operating system of the electronic device will first read the configuration of the current application A and filter out the first display mode of the first interface in application A, such as non-dark mode. At this time, the operating system will create a new key-value pair in the system status table.
[0050] Step 1102: determine the first application as a key element and the first display mode as a value element, and obtain first association information between the application and the first display mode.
[0051] Exemplarily, the key element in the key-value pair can be used to uniquely identify the data item, so application A can be determined as the key element. The value element in the key-value pair can be used to associate data associated with the key element, so non-dark mode can be determined as the key-value pair.
[0052] In this way, by establishing association information between the application and the display mode and storing the first association information through key values, timely synchronization between the display mode set by the operating system and the display mode of the application is ensured, and the speed of searching for the first display mode can be improved.
[0053] In step 120, in some embodiments of the present application, the first input in the embodiments of the present application may be an input for a user to switch the display mode of the electronic device once, or may be an input for a user to switch the display mode of the electronic device at least twice. In the case where the first input is an input for a user to switch the display mode of the electronic device at least twice, the first input may include at least two sub-inputs, and the input for switching the display mode of the electronic device each time in the at least two times corresponds to each of the at least two sub-inputs.
[0054] It should be noted that the display modes of the electronic devices involved in the embodiments of the present application include but are not limited to: non-dark mode, dark mode, and user-defined mode. In the embodiments of the present application, non-dark mode and dark mode are used for exemplary explanation.
[0055] In some embodiments of the present application, step 120 may specifically include step 1201 and step 1202 .
[0056] Step 1201: According to at least one switching of the display mode of the electronic device, determine the second display mode of the electronic device that was last switched in at least one switching.
[0057] For example, Figure 3 As shown, after application A switches from the foreground application to the background application, if the user switches the display mode of the electronic device once, then the display mode of the electronic device switched this time is directly determined as the second display mode; if the user switches the display mode of the electronic device at least twice, then the display mode of the electronic device switched for the last time in at least two times is determined as the second display mode.
[0058] Step 1202: When the second display mode and the first display mode are different display modes, adjust the first display mode in the first association information to the second display mode to obtain second association information.
[0059] For example, Figure 3 As shown, the display mode of the electronic device that was switched for the last time, or at least twice, i.e., the dark mode, is compared with the first display mode in the first association information. If the first display mode information is the dark mode, there is no need to adjust the first association information, i.e., the first association information is determined as the second association information. If the first display mode is not the dark mode, the first display mode in the first association information is adjusted to the second display mode, i.e., application A-non-dark mode is adjusted to application A-dark mode, and its application A-dark mode is determined as the second association information.
[0060] Therefore, by adjusting the association information between the application and the display mode, timely synchronization between the display mode set by the operating system and the display mode of the application is guaranteed, so that after the application switches from a foreground application to a background application and then switches back to the foreground application, the application interface is displayed according to the display mode in the latest set association information, avoiding the contradiction that the operating system is set to a non-dark mode while the application is in a dark mode, resulting in a chaotic black and white flashing screen phenomenon on the application interface, thereby improving the display effect of the application interface.
[0061] In some embodiments of the present application, step 120 may specifically include step 1203 and step 1204 .
[0062] Step 1203: According to at least one switching of the display mode of the electronic device by the user, determining the second display mode of the electronic device that was last switched in the at least one switching.
[0063] Here, the principle is the same as that of the aforementioned step 1201. The specific process is detailed in the aforementioned step 1201 and will not be repeated here.
[0064] Step 1204: when the second display mode and the first display mode are the same display mode, determine the first associated information as the second associated information.
[0065] Exemplarily, if the first display mode is not the dark mode, the first display mode in the first associated information is adjusted to the second display mode, that is, application A-non-dark mode is adjusted to application A-dark mode, and its application A-dark mode is determined as the second associated information.
[0066] In this way, if the display mode of the application program has not changed or remains in the first display mode after a change, there is no need to modify the first association information, thereby reducing the cost of the electronic device maintaining the association relationship between the application program and its display mode.
[0067] Regarding step 130 , in some embodiments of the present application, the first display mode and the second display mode are different display modes. Based on this, step 130 may specifically include step 1301 and step 1302 .
[0068] Step 1301: When the application is switched from a background application to a foreground application, the interface of the application is redrawn according to the second display mode in the second association information to obtain a second interface of the application.
[0069] Among them, the interface redrawing in the application in the embodiment of the present application refers to the process of redrawing the interface elements of the application due to the change of style when the interface layout remains unchanged. This processing only involves redrawing the elements of the calculated layout and does not involve the calculation of the layout.
[0070] Exemplarily, the color theme and related interface elements of the interface in the application can be redrawn. Redrawing the interface in the application may include the following aspects, such as using a dark but not pure black background to reduce eye stimulation of the screen; using light colors for the main text and darker colors for the secondary text; icons should also use light or contrasting colors to ensure clear visibility on a dark background; use contrasting colors to adjust buttons and interactive elements so that users can easily click and identify them.
[0071] Step 1302, display the second interface.
[0072] Therefore, by adjusting the association information between the application and the display mode, timely synchronization between the display mode set by the operating system and the display mode of the application is guaranteed, so that after the application switches from a foreground application to a background application and then switches back to the foreground application, the application interface is displayed according to the display mode in the latest set association information, avoiding the contradiction that the operating system is set to a non-dark mode while the application is in a dark mode, resulting in a chaotic black and white flashing screen phenomenon on the application interface, thereby improving the display effect of the application interface.
[0073] In addition, after step 130 , the display method provided in the embodiment of the present application may further include steps 1401 and 1402 .
[0074] Step 1401: Receive a first input from a user to exit an application.
[0075] Step 1402: in response to the first input, stop running the application and delete the associated information associated with the application, where the associated information includes at least one of the following: first associated information and second associated information.
[0076] In this way, the operating system can clear the information associated with application A in the system status table after the user exits application A, so that when the user starts application A next time, the first association information is regenerated through the above step 110 to avoid invalid association information occupying the memory of the electronic device.
[0077] In order to better illustrate the display method provided by the embodiment of the present application, Figures 2 to 6 Taking the display method provided in the embodiment of the present application as an example, the display method is illustrated.
[0078] First, if Figure 2 As shown, S1, application A (hereinafter referred to as application A) is started, referring to Figure 3 As shown in step 1.
[0079] S2, after application A is started, refers to Figure 3 As shown in step 2, the operating system (hereinafter referred to as the system) will first read the current configuration information of application A, and then filter out the status related to the dark mode, and refer to Figure 3 As shown in step 3, the current dark state is recorded in the system state table, for example, application A: dark off.
[0080] S3, at this time, application A returns to the background, you can refer to Figure 4 As shown in step 1, the system switches to dark mode, and the "system config notification thread" sends the latest config to application A.
[0081] S4, please refer to Figure 4 As shown in step 2, application A receives the latest configuration information, namely the dark mode. At this time, the system can read the latest configuration information from application A and compare it with the configuration information last received by application A in the system status table, for example, application A: whether the dark mode is switched off. Here, you can refer to Figure 4 As shown in step 3, the system may compare the config information received by application A with the last config information of application A stored in the system status table to determine whether the config information of application A is switched.
[0082] If there is no switch, that is, A: dark color off is still applied, S7 can be executed; conversely, if there is a switch, that is, A: dark color on is applied, S5 can be executed.
[0083] S5, please refer to Figure 4 As shown in step 4, if the config information of application A changes, the system sets a "dark color changed" flag for application A.
[0084] S6, the system updates the latest config information of Application A, i.e., Application A: Dark Off - Dark Switched, Dark On - to the system status table.
[0085] S7, the system switches to dark mode again. Here, you can refer to Figure 5 As shown in step 1 in the above example, application A is still in the background and the system switches to dark mode again. Figure 5 As shown in step 2, read the config information of application A. Figure 5 As shown in step 3, determine whether the dark color has changed, continue to set the "dark color has changed" flag, and refresh the dark color status bit in the system table.
[0086] S8, receiving input from application A switching to the foreground application, refer to Figure 6 As shown in step 1 in , the application returns to the foreground.
[0087] S9, in response to the input of S8, the system status table is refreshed, and it is determined whether the configuration information of application A has a mark indicating that the dark color has been changed. If there is a mark indicating that the dark color has been changed, S10 is executed; if there is no mark indicating that the dark color has been changed, S12 is executed.
[0088] S10, refer to Figure 6 As shown in step 2 in the system, the system refreshes the config information of application A in the system status table.
[0089] S11, reference Figure 6 As shown in step 3 in , the interface of application A is redrawn according to the latest config information to display the interface of the application.
[0090] S12, displaying the interface of application A.
[0091] In this way, the embodiment of the present application solves the problems in the related art, and reduces the probability of the black and white chaotic screen flashing phenomenon on the display interface of application A from 20% to 0, and the increase in performance consumption is almost 0. In addition, the display method provided by the embodiment of the present application avoids both the problem of thread synchronization and the problem of cross-process, so that after the application is switched from the foreground application to the background application, and then switched back to the foreground application, the interface of the application is displayed according to the display mode in the latest set association information, avoiding the contradiction that the operating system is set to a non-dark mode and the application is in a dark mode, resulting in the black and white chaotic screen flashing phenomenon on the application interface, which not only improves the display effect of the application interface, but also reduces the resource consumption of the electronic device, greatly improves the stability of the dark mode, and improves the user experience of using the electronic device.
[0092] It should be noted that the display method provided in the embodiments of the present application can be executed by electronic devices such as mobile phones, tablet computers, laptop computers, PDAs, wearable devices, etc. In some embodiments of the present application, the display method provided in the embodiments of the present application is described by taking the electronic device as the execution subject to execute the display method as an example.
[0093] The display method provided in the embodiment of the present application can be executed by a display device. In the embodiment of the present application, a display device executing the display method is taken as an example to illustrate the device of the display method provided in the embodiment of the present application.
[0094] The present application also provides a display device. Figure 7 Provide detailed explanation.
[0095] Figure 7 A schematic diagram of the structure of a display device provided in some embodiments of the present application.
[0096] like Figure 7 As shown, the display device 70 can be applied to electronic equipment, and the display device 70 can specifically include:
[0097] A generating module 701, configured to generate first association information between an application and a first display mode according to a first display mode of the first interface when displaying the first interface of the application;
[0098] A determination module 702, configured to determine second association information between the application and the second display mode when the application is switched from the foreground application to the background application, wherein the second association information is determined by the user switching the display mode of the electronic device at least once;
[0099] The display module 703 is used to display the second interface of the application according to the second display mode in the second association information when the application is switched from the background application to the foreground application.
[0100] The display device 70 in the embodiment of the present application is described in detail below, as shown below.
[0101] In some embodiments of the present application, the determination module 702 is specifically used to determine the second display mode of the electronic device that was last switched in at least one switching of the display mode of the electronic device by the user at least once;
[0102] When the second display mode and the first display mode are different display modes, the first display mode in the first associated information is adjusted to the second display mode to obtain the second associated information.
[0103] In some embodiments of the present application, the determination module 702 is specifically used to determine the second display mode of the electronic device that was last switched in at least one switching of the display mode of the electronic device by the user at least once;
[0104] When the second display mode and the first display mode are the same display mode, the first related information is determined as the second related information.
[0105] In some embodiments of the present application, the display device 70 further includes a redrawing module, which is used to redraw the interface in the application according to the second display mode in the second association information to obtain a second interface of the application when the first display mode and the second display mode are different display modes and the application is switched from a background application to a foreground application;
[0106] The display module 703 is also used to display the second interface.
[0107] In some embodiments of the present application, the display device 70 further includes a receiving module for receiving a first input from a user to exit the application;
[0108] The display device 70 further includes a stop module, which is used to stop running the application program in response to the first input, and delete the associated information associated with the application program, where the associated information includes at least one of the following: first associated information and second associated information.
[0109] In some embodiments of the present application, the generating module 701 is specifically used to create a key-value pair in the system state table of the electronic device operating system according to the first display mode of the first interface, where the key-value pair includes a key element and a value element;
[0110] The first application is determined as a key element, and the first display mode is determined as a value element, to obtain first association information between the application and the first display mode.
[0111] The display device in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0112] The display device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0113] The display device provided in the embodiment of the present application can achieve Figures 1 to 6The various processes implemented in the display method embodiment shown achieve the same technical effect, and will not be described again here to avoid repetition.
[0114] Based on this, the display device provided by the embodiment of the present application generates first association information between the application and the first display mode according to the first display mode of the first interface when displaying the first interface of the application; when the application is switched from the foreground application to the background application, the second association information between the application and the second display mode is determined, wherein the second association information is determined by the user switching the display mode of the electronic device at least once; when the application is switched from the background application to the foreground application, the second interface of the application is displayed according to the second display mode in the second association information. In this way, by establishing association information between the application and the display mode, the timely synchronization of the display mode set by the operating system and the display mode of the application is guaranteed, so that when the user switches the display mode of the electronic device at least once, such as when the application is switched from the foreground application to the background application and then switches back to the foreground application, the electronic device can display the interface of the application according to the display mode in the latest set association information, avoiding the contradiction that the operating system is set to one display mode and the application is another display mode, resulting in the flashing screen phenomenon of the application interface, thereby improving the display effect of the application interface.
[0115] Optional, such as Figure 8 As shown, an embodiment of the present application further provides an electronic device 80, including a processor 801 and a memory 802, wherein the memory 802 stores programs or instructions that can be executed on the processor 801, and when the program or instructions are executed by the processor 801, the various steps of the above-mentioned display method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0116] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0117] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0118] The electronic device 900 includes but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, a processor 910 and other components.
[0119] Those skilled in the art will appreciate that the electronic device 900 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 910 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system.
[0120] Fig. 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0121] Among them, in the embodiment of the present application, the processor 910 is used to generate first association information between the application and the first display mode according to the first display mode of the first interface when displaying the first interface of the application. The processor 910 can also be used to determine the second association information between the application and the second display mode when the application is switched from the foreground application to the background application, wherein the second association information is determined according to the user switching the display mode of the electronic device at least once. The display unit 906 is used to display the second interface of the application according to the second display mode in the second association information when the application is switched from the background application to the foreground application.
[0122] The electronic device 900 is described in detail below, as shown below.
[0123] In some embodiments of the present application, the processor 910 is specifically configured to determine the second display mode of the electronic device that was last switched in at least one switching of the display mode of the electronic device by the user at least once;
[0124] When the second display mode and the first display mode are different display modes, the first display mode in the first associated information is adjusted to the second display mode to obtain the second associated information.
[0125] In some embodiments of the present application, the processor 910 is specifically configured to determine the second display mode of the electronic device that was last switched in at least one switching of the display mode of the electronic device by the user at least once;
[0126] When the second display mode and the first display mode are the same display mode, the first related information is determined as the second related information.
[0127] In some embodiments of the present application, the processor 910 may also be configured to, when the first display mode and the second display mode are different display modes and the application is switched from a background application to a foreground application, redraw the interface in the application according to the second display mode in the second association information to obtain a second interface of the application;
[0128] The display unit 906 can also be used to display a second interface.
[0129] In some embodiments of the present application, the user input unit 907 is used to receive a first input from a user to exit the application;
[0130] The processor 910 may also be configured to, in response to the first input, stop running the application and delete association information associated with the application, where the association information includes at least one of the following: first association information and second association information.
[0131] In some embodiments of the present application, the processor 910 is specifically configured to create a key-value pair in a system state table of an operating system of an electronic device according to a first display mode of the first interface, where the key-value pair includes a key element and a value element;
[0132] The first application is determined as a key element, and the first display mode is determined as a value element, to obtain first association information between the application and the first display mode.
[0133] It should be understood that the input unit 904 may include a graphics processing unit (GPU) 9041 and a microphone 9042, and the graphics processor 9041 processes the image data of a static image or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 906 may include a display panel, and the display panel may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 907 includes a touch panel 9071 and at least one of other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include two parts: a touch detection device and a touch display. Other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (such as a volume display button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0134] The memory 909 can be used to store software programs and various data. The memory 909 can mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area can store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 909 can include a volatile memory or a non-volatile memory, or the memory 909 can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 909 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0135] The processor 910 may include one or more processing units; optionally, the processor 910 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless display signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 910.
[0136] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned display method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0137] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0138] In addition, an embodiment of the present application further provides a chip, which includes a processor and a display interface, the display interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned display method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0139] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0140] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned display method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0141] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0142] In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
[0143] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0144] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A display method, characterized in that: include: In the case of displaying a first interface of an application, generating first association information between the application and the first display mode according to a first display mode of the first interface; In the case where the application is switched from a foreground application to a background application, determining second association information between the application and a second display mode, wherein the second association information is determined according to at least one switching of the display mode of the electronic device by the user; When the application is switched from a background application to a foreground application, the second interface of the application is displayed according to the second display mode in the second association information.
2. The method according to claim 1, characterized in that: The determining the second association information between the application and the second display mode includes: According to at least one switching of the display mode of the electronic device by the user, determining the last switching of the second display mode of the electronic device in the at least one switching; In a case where the second display mode and the first display mode are different display modes, the first display mode in the first associated information is adjusted to the second display mode to obtain second associated information.
3. The method according to claim 1, characterized in that: The determining the second association information between the application and the second display mode includes: According to at least one switching of the display mode of the electronic device by the user, determining the last switching of the second display mode of the electronic device in the at least one switching; When the second display mode and the first display mode are the same display mode, the first associated information is determined as the second associated information.
4. The method according to claim 1, characterized in that: The first display mode and the second display mode are different display modes; When the application is switched from a background application to a foreground application, displaying the second interface of the application according to the second display mode in the second association information includes: When the application is switched from the background application to the foreground application, redrawing the interface of the application according to the second display mode in the second association information to obtain a second interface of the application; The second interface is displayed.
5. The method according to claim 1, characterized in that The method further comprises: Receive a first input from a user to exit the application; In response to the first input, the application is stopped from running, and the associated information associated with the application is deleted, where the associated information includes at least one of the following: the first associated information and the second associated information.
6. The method according to any one of claims 1 to 5, characterized in that The generating, according to the first display mode of the first interface, first association information between the application and the first display mode includes: According to the first display mode of the first interface, creating a key-value pair in the system status table of the electronic device operating system, the key-value pair including a key element and a value element; The first application is determined as the key element, and the first display mode is determined as the value element, to obtain first association information between the application and the first display mode.
7. A display device, characterized in that: include: a generating module, configured to generate first association information between the application and the first display mode according to a first display mode of the first interface when displaying the first interface of the application; a determination module, configured to determine second association information between the application and the second display mode when the application is switched from a foreground application to a background application, wherein the second association information is determined by a user switching the display mode of the electronic device at least once; The display module is used to display the second interface of the application according to the second display mode in the second association information when the application is switched from the background application to the foreground application.
8. The device according to claim 7, characterized in that The generating module is specifically configured to create a new key-value pair in the system status table of the electronic device operating system according to the first display mode of the first interface, wherein the key-value pair includes a key element and a value element; The first application is determined as the key element, and the first display mode is determined as the value element, to obtain first association information between the application and the first display mode.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the display method according to any one of claims 1 to 6 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the display method according to any one of claims 1 to 6 are implemented.
11. A computer program product, characterized in that The program product is stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the display method according to any one of claims 1 to 6.