Interface display method and electronic device
By using a thread different from the main thread in the host APP of the electronic device to obtain the information of the application widget, the problem of stuck when the host APP loads the application widget is solved, and the fluency and response speed are improved.
Patent Information
- Application Number
- CN202310682212.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-06-08
AI Technical Summary
In electronic devices, the host APP may cause lagging when loading application widgets, affecting user experience and fluency.
By starting a thread different from the main thread in the host APP of the electronic device to obtain the layout information and content information of the application widget, other tasks can be executed in parallel on the main thread, reducing the pressure on the main thread and avoiding lagging.
It effectively reduces the host APP's lag during loading application widgets, and improves the host APP's running smoothness and response speed.
Smart Images

Figure CN117724825B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to an interface display method and an electronic device. Background Art
[0002] With the development of electronic devices, various applications (APPs) emerge in an endless stream, allowing users to handle many things through applications on electronic devices, providing convenience for users. For example, users can chat with friends through social APPs, learn about various information through news APPs, and so on.
[0003] Application widgets, also known as window widgets or application widgets, refer to small programs that can be directly displayed on the host APP of an electronic device (for example, a desktop APP or a negative one-screen APP, etc.). For example, an electronic device loads application widgets such as a calendar application widget, a weather application widget, or a search application widget into a desktop application for use. The use of application widgets facilitates the interaction between users and electronic devices. However, when the host APP loads the application widget, there may be a freeze in the host APP due to reasons such as slow startup or update of the application widget. Summary of the invention
[0004] The embodiments of the present application provide an interface display method and an electronic device, which can reduce the lag phenomenon of a host APP during the process of the host APP loading an application widget, thereby improving the smoothness of the operation of the host APP.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, an interface display method is provided, which may include: during a process in which an electronic device displays a first interface, a first operation of a user is detected, and the electronic device obtains layout information of an application widget based on a first thread newly started by a host APP that is different from a main thread, to display a second interface including a first display page of the application widget, wherein the first display page is displayed based on the layout information.
[0007] The first interface can be the main interface of the electronic device, or the negative first screen, or the interface of a certain application, which is not limited here. The first operation is used to control the electronic device to display the second interface including the application widget. For example, the first operation can be the user's operation on the icon of the host APP, or a sliding operation on the main interface, etc., which is not limited here.
[0008] It can be understood that when the host APP of an electronic device loads an application widget, the host APP starts a first thread different from the main thread to perform the operation of obtaining the layout information of the application widget. The main thread and the first thread of the host APP execute corresponding tasks in parallel, which alleviates the pressure on the main thread of the host APP and solves the problem of lag in the process of the host APP loading the application widget.
[0009] In a possible implementation manner of the first aspect, before the electronic device obtains the layout information of the application widget based on the first thread of the host application APP, the above-mentioned interface display method may also include: the electronic device starts the first thread through the host APP.
[0010] It can be understood that the electronic device starts a first thread different from the main thread through the host APP, so that the host APP uses the first thread to execute the task of obtaining the layout information of the application widget, which reduces the pressure on the host APP when loading the application widget and solves the problem of lag in the process of the host APP loading the application widget.
[0011] In another possible implementation manner of the first aspect, after the electronic device displays the second interface, the interface display method may further include:
[0012] After the electronic device obtains the first content information of the application widget based on the host APP, the electronic device displays a third interface, where the third interface includes a second display page of the application widget, and the first content information is displayed on the second display page.
[0013] In one possible case, the electronic device may obtain the first content information of the application widget based on the main thread of the host APP, and may also obtain the first content information of the application widget based on the first thread of the host APP, which is not limited here.
[0014] It can be understood that during the host APP startup process, when the host APP loads the application widget, the electronic device obtains the first content information of the application widget based on the first thread of the host APP, thereby avoiding the problem of slow or non-responsive host APP caused by the main thread being blocked during the host APP startup process, and improving the fluency of the host APP loading the application widget.
[0015] That is, after the default layout of the application widget is displayed in the host APP of the electronic device, the electronic device displays the initial view of the application widget in the host APP based on the first content information corresponding to the initial view of the application widget obtained by the host APP. Thus, the electronic device obtains the first content information of the application widget based on the first thread of the host APP, so that the first thread and the main thread of the host APP execute corresponding tasks in parallel, avoiding the phenomenon of freezing of the host APP during the process of the host APP loading the application widget.
[0016] When the host APP loads the application widget, after the first thread of the host APP executes to obtain the layout information of the default layout, the host APP can release the first thread, and the subsequent process of the host APP loading the application widget is executed by the main thread of the host APP, that is, the main thread of the host APP executes the operation of obtaining the first content information of the application widget. Therefore, the host APP releases the first thread in time, avoiding the first thread from occupying too many resources.
[0017] In another possible implementation manner of the first aspect, the first content information is acquired by a first thread of the host APP; and the electronic device displays the third interface, which may include:
[0018] After the electronic device sends the first content information to the main thread of the host APP based on the first thread of the host APP, the electronic device displays the third interface based on the first content information received by the main thread of the host APP.
[0019] It can be understood that after the first thread of the host APP executes the operation of obtaining the first content information, the first content information is sent to the main thread, and the main thread executes the operation of displaying the second display page of the application widget based on the first content information. As a result, the host APP releases the first thread in time, avoiding the first thread started by the host APP from occupying too many resources.
[0020] In another possible implementation manner of the first aspect, the electronic device displays the third interface, which may include:
[0021] The electronic device displays the third interface based on the first content information obtained by the first thread or the main thread of the host APP. That is, after the first thread of the host APP executes the operation of obtaining the first content information, the first thread directly executes the operation of displaying the second display page of the application widget based on the first content information. Alternatively, after the main thread of the host APP executes the operation of obtaining the first content information, the main thread directly executes the operation of displaying the second display page of the application widget based on the first content information.
[0022] In another possible implementation of the first aspect, before the electronic device displays the third interface, the interface display method may further include:
[0023] After the electronic device determines that the main thread of the host APP has received at least one update request, the main thread of the host APP stores the at least one update request in a request queue, where the update request is used to indicate an update of content information in the application widget;
[0024] After the electronic device displays the third interface, the electronic device displays the fourth interface based on the update request obtained by the main thread of the host APP from the request queue. The fourth interface includes the third display page of the application widget, and the third display page displays the second content information corresponding to the update request.
[0025] It can be understood that, in the process of the host APP displaying the default layout and initial view of the application widget, the main thread of the host APP receives an update request for the display content of the application widget, and the host APP stores the update request in the request queue. After displaying the initial view of the application widget in the host APP, the main thread of the host APP executes the update request, ensuring that each update request stored in the request queue can be executed in the expected order, avoiding the situation where the update request is not executed.
[0026] In another possible implementation of the first aspect, before the electronic device displays the second interface, the interface display method may further include:
[0027] After the electronic device determines that the main thread of the host APP has received at least one update request, the main thread of the host APP stores the at least one update request in a request queue, where the update request is used to indicate an update of content information in the application widget;
[0028] After the electronic device displays the second interface, the electronic device obtains an update request from the request queue based on the main thread of the host application APP, and then, the electronic device displays the fourth interface based on the update request obtained from the request queue by the main thread of the host APP.
[0029] It can be understood that, in the process of the host APP displaying the default layout of the application widget, the main thread of the host APP receives an update request for the display content of the application widget, and the host APP stores the update request in the request queue. After displaying the default layout of the application widget in the host APP, the main thread of the host APP executes the update request, ensuring that each update request stored in the request queue can be executed in the expected order, avoiding the situation where the update request is not executed.
[0030] In addition, after displaying the default layout of the app widget in the host APP, the updated view of the app widget is directly displayed, which improves the display efficiency of the app widget.
[0031] In another possible implementation of the first aspect, the update request obtained by the electronic device from the request queue based on the main thread of the host application APP may include:
[0032] The electronic device sequentially obtains the update requests from the request queue based on the storage order of at least one update request stored in the request queue by the main thread of the host APP.
[0033] It can be understood that the main thread of the host APP obtains the update requests in sequence according to the storage order of the update requests stored in the request queue, so that each update request stored in the request queue can be executed in the expected order, ensuring the display order of the updated content in the updated view of the application widget.
[0034] In another possible implementation of the first aspect, before the electronic device displays the third interface, the interface display method may further include:
[0035] After the electronic device determines that the first thread of the host APP receives at least one update request, the first thread of the host APP stores the at least one update request in a request queue, where the update request is used to indicate updating content information in the application widget;
[0036] After the electronic device displays the third interface, the electronic device obtains an update request from the request queue based on the first thread of the host APP and displays a fourth interface, which includes the third display page of the application widget.
[0037] It can be understood that, when the host APP displays the default layout and initial view of the application widget, after receiving the update request, the first thread of the host APP stores the update request in the request queue, and after displaying the initial view of the application widget in the host APP, the first thread of the host APP executes the update request. Thus, the first thread of the host APP executes the update process of the application widget, ensuring that the main thread of the host APP can execute other tasks in a timely manner, thereby improving the smoothness of the operation of the host APP.
[0038] In another possible implementation of the first aspect, before the electronic device displays the second interface, the interface display method may further include:
[0039] After the electronic device determines that the first thread of the host APP receives at least one update request, the first thread of the host APP stores the at least one update request in a request queue, where the update request is used to indicate updating content information in the application widget;
[0040] After the electronic device displays the second interface, the electronic device displays the fourth interface based on the update request obtained by the first thread of the host APP from the request queue.
[0041] It can be understood that, during the process of the host APP displaying the default layout of the application widget, the first thread of the host APP receives an update request for the display content of the application widget, and the host APP stores the update request in the request queue. After the default layout of the application widget is displayed in the host APP, the first thread of the host APP executes the update request. Thus, the first thread of the host APP executes the update process of the application widget, ensuring that the main thread of the host APP can execute other tasks in a timely manner, thereby improving the smoothness of the operation of the host APP.
[0042] In another possible implementation of the first aspect, the update request obtained by the electronic device from the request queue based on the first thread of the host APP may include:
[0043] The electronic device sequentially obtains the update requests from the request queue based on the storage order of at least one update request stored in the request queue by the first thread of the host APP.
[0044] It can be understood that the first thread of the host APP obtains the update requests in sequence according to the storage order of the update requests stored in the request queue, so that each update request stored in the request queue can be executed in the expected order, ensuring the display order of the updated content in the updated view of the application widget.
[0045] In another possible implementation of the first aspect, before the electronic device displays the third interface, the interface display method may further include:
[0046] A host APP of the electronic device receives a first task, and the electronic device executes the first task based on a main thread of the host APP. The first task is different from a task of the host APP loading an application widget.
[0047] It can be understood that, in the process of the host APP loading the application widget, the host APP receives a task different from loading the application widget. The main thread of the host APP can execute the first task in a timely manner, avoiding the host APP from being stuck and providing the smooth operation of the host APP.
[0048] In a second aspect, the present application provides another interface display method, which may include: an electronic device receiving a first operation; in response to the first operation, the electronic device obtains interface information of an application widget based on a first thread of a host APP, and the electronic device displays the user interface of the application widget according to the interface information.
[0049] The above-mentioned first operation is used to control the user interface of the electronic device to display the application widget. For example, the first operation can be the user's operation on the icon of the host APP, or it can be a sliding operation on the main interface, or it can be the user's voice control operation, etc. The specific form of the first operation is not limited here.
[0050] It can be understood that, in the process of an electronic device loading an application widget through a host APP, the host APP starts a new first thread to execute the operation of obtaining the interface information of the application widget, which alleviates the pressure on the main thread of the host APP to execute tasks and improves the smoothness of the host APP loading the application widget.
[0051] In a possible implementation of the second aspect, the interface information may include layout information of the application widget. The electronic device displays a user interface of the application widget according to the interface information, which may include:
[0052] The host APP of the electronic device displays the first display page of the application widget according to the layout information of the application widget.
[0053] It can be understood that after the electronic device obtains the layout information corresponding to the default layout of the application widget through the first thread newly started by the host APP, the electronic device displays the interface corresponding to the default layout of the application widget.
[0054] In another possible implementation of the second aspect, the interface information may include layout information and first content information of the application widget. The electronic device displays a user interface of the application widget according to the interface information, which may include:
[0055] The electronic device displays the third interface. The user interface of the application widget displayed in the third interface may be an interface corresponding to the initial view of the application widget loaded with the first content information.
[0056] It can be understood that after the electronic device obtains the layout information corresponding to the default layout of the application widget and the first content information corresponding to the initial view through the first thread of the host APP, the electronic device directly displays the interface corresponding to the initial view loaded with the default layout, thereby improving the speed at which the host APP loads the application widget.
[0057] In a third aspect, the present application provides an electronic device, comprising: a touch screen, the touch screen comprising a touch sensor and a display screen; one or more processors; a memory; wherein the memory stores one or more computer programs, the one or more computer programs comprising instructions, which, when executed by the electronic device, enable the electronic device to execute an interface display method as described in any one of the first aspects above.
[0058] In a fourth aspect, the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the interface display method as described in any one of the first aspects.
[0059] In a fifth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the interface display method as described in any one of the first aspects.
[0060] It can be understood that the electronic device described in the third aspect, the computer storage medium described in the fourth aspect, and the computer program product described in the fifth aspect are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 This is an example diagram of loading an application widget into a host APP in the related art;
[0062] Figure 2 A timing diagram of a host APP loading an application widget in the related art;
[0063] Figure 3 This is an example diagram of loading a note application widget into a host APP in the related art;
[0064] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0065] Figure 5 A software structure diagram of an electronic device provided in an embodiment of the present application;
[0066] Figure 6 An example diagram of an application widget displayed in a host APP provided in an embodiment of the present application;
[0067] Figure 7 Example of setting an application widget to the main interface provided in the embodiment of the present application Figure 1 ;
[0068] Figure 8 An example diagram of loading an application widget into a host APP provided in an embodiment of the present application;
[0069] Fig. 9 Example of setting an application widget to the main interface provided in the embodiment of the present application Figure 2 ;
[0070] Fig.10An example diagram of the position movement of an application widget provided in an embodiment of the present application;
[0071] Fig.11 An example diagram of deleting an application widget provided in an embodiment of the present application;
[0072] Fig.12 Timing of loading application widgets in the host APP provided in the embodiment of the present application Figure 1 ;
[0073] Fig.13 Timing of loading application widgets in the host APP provided in the embodiment of the present application Figure 2 ;
[0074] Fig.14 An example diagram of loading an application widget into a host APP provided in an embodiment of the present application;
[0075] Fig.15 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 1 ;
[0076] Fig.16 Example of updating application widgets for the host APP provided in the embodiment of the present application Figure 1 ;
[0077] Fig.17 Example of updating application widgets for the host APP provided in the embodiment of the present application Figure 2 ;
[0078] Fig.18 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 2 ;
[0079] Fig.19 Example of updating application widgets for the host APP provided in the embodiment of the present application Figure 3 ;
[0080] Fig. 20 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 3 ;
[0081] Fig.21 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 4 ;
[0082] Fig. 22 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 5 ;
[0083] Fig.23Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 6 ;
[0084] Fig.24 An example diagram of deleting an application widget provided in an embodiment of the present application;
[0085] Fig.25 Another schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0086] The technical solution in the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application. In the description of the embodiment of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0087] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0088] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0089] When the electronic device loads the application widget into the host APP, the main thread of the host APP first creates a view corresponding to the default layout of the application widget in the user interface of the host APP. Then, after the main thread of the host APP obtains the initial content information to be displayed by the application widget, it updates the initial view used to display the initial content information of the application widget to the view corresponding to the default layout of the application widget in the user interface of the host APP.
[0090] For example, Figure 1 This is an example diagram of loading an application widget into a host APP in the related art. Figure 1 As shown in the figure, when the mobile phone loads the calendar application widget into the desktop APP, the desktop APP first Figure 1In the interface 101 shown in (a) of FIG. 1 , a display page corresponding to the default layout of the calendar application widget 102 is created. The display page corresponding to the default layout is used to load the content to be displayed by the calendar application widget. Then, the desktop APP loads the content information corresponding to the initial view of the calendar application widget into the display page corresponding to the default layout. The calendar application widget loaded with the content information of the initial view is shown in FIG. Figure 1 The calendar application widget 104 is shown in the interface 103 shown in (b) .
[0091] It can be understood that the above Figure 1 The process of loading the calendar application widget to the desktop APP is executed on the main thread of the desktop APP. During the process of loading the calendar application widget, the main thread of the desktop APP handles many tasks related to the loading of the application widget, making it impossible for the main thread to respond to other tasks in time. For example, during the process of loading the calendar application widget, if the desktop APP receives a trigger operation for the phone icon, the main thread of the desktop APP will execute the trigger operation after the calendar application widget is loaded in the desktop APP, and the display will be Figure 1 Interface 105 shown in (c) in the figure. It can be seen that when the desktop APP is loading the calendar application widget, after the mobile phone detects the user's triggering operation on the icons of other applications in the desktop APP, the desktop APP responds slowly. For example, when the main thread of the desktop APP is loading the calendar application widget, the desktop APP receives the user's sliding operation on the desktop, but the desktop APP does not respond at all, resulting in the problem of unsmooth desktop response when the user uses the mobile phone.
[0092] For example, Figure 2 This is a timing diagram of the host APP loading the application widget in the related technology. Figure 2As shown, in the scenario where an application widget is loaded for the first time in a host APP in an electronic device, the main thread of the host APP calls the create view function based on the application widget class to create the host view of the application widget. For example, the main thread of the host APP calls the createView function based on the AppWidgetHost class to create the host view of the application widget. The main thread of the host APP creates a new host view based on the application widget class. Then, the main thread of the host APP sets the corresponding information of the application widget based on the application widget class. For example, the main thread of the host APP calls the setAppWidget (widgetid, providerinfo) function based on the AppWidgetHost class to set the identification information of the application widget and the attribute information of the application widget. Among them, widgetid is used to set the identification information of the application widget, and the identification information is used to uniquely identify the application widget. Providerinfo is used to set the attribute information of the application widget, and the attribute information of the application widget includes but is not limited to the shape, size, content to be displayed, content update frequency, and native APP that provides content displayed by the application widget in the host APP. The main thread of the host APP sends the identification information and attribute information of the application widget to the host view class based on the application widget class. After the main thread of the host APP sets a host view based on the host view class according to the identification information and attribute information of the obtained application widget, the main thread of the host APP can update the application widget based on the application widget class. For example, the main thread of the host APP calls the updateAppWidget function based on the AppWidgetHost class to trigger the process of updating the application widget displayed in the host APP. After the main thread of the host APP obtains the default layout of the application widget based on the host view class, the default layout of the application widget is displayed in the host APP. For example, after the main thread of the host APP calls the getDefaultView function based on the AppWidgetHostView class to obtain the default layout of the application widget, the default layout of the application widget is displayed in the host APP. Figure 1 Default layout of the calendar application widget 102 displayed in the interface 101 in (a).
[0093] After that, the main thread of the host APP obtains the content information to be displayed of the application widget based on the host view class to display the content information of the application widget in the default layout. For example, the main thread of the host APP calls the applyContent(defaultView) function based on the AppWidgetHostView class to load the content information of the application widget into the default layout to display the content information of the application widget in the host APP.
[0094] Above Figure 2 The entire process of loading application widgets in the host APP of the electronic device shown in the figure is synchronously executed by the main thread of the host APP. Therefore, in the process of loading application widgets in the main thread of the host APP, if there are pending user interaction tasks or other tasks such as interface updates, the main thread of the host APP may be blocked due to the inability of the main thread of the host APP to execute user interaction tasks, interface updates or other tasks in time, which may cause the host APP to respond slowly or even not respond, thereby causing the host APP to freeze.
[0095] Similarly, when the main thread of the host APP executes the update or modification of the configuration information of the application widget, if the main thread of the host APP receives other tasks such as user interaction tasks or interface updates, the main thread of the host APP may be blocked due to the execution of the task of updating or modifying the configuration information of the application widget, and the host APP may be unable to execute other tasks in time, which may cause the host APP to respond slowly or even not respond, resulting in the host APP to freeze.
[0096] Exemplarily, suppose that the electronic device pre-sets a timed reminder task in the calendar APP in response to the user's operation. Subsequently, when the electronic device determines that the current time is the preset time, the calendar application widget is actively loaded in the desktop APP, and the content corresponding to the timed reminder task is displayed in the calendar application widget. For example, a meeting reminder task at 7 o'clock in the evening is set in the calendar APP. When the electronic device determines that the current time is 7 o'clock in the evening, the calendar application widget is actively loaded in the desktop APP of the electronic device, and the meeting reminder task at 7 o'clock in the evening is displayed in the calendar application widget. However, in the process of loading the calendar application widget in the desktop APP of the electronic device, the desktop APP cannot execute other tasks synchronously, resulting in a slow response of the desktop APP.
[0097] In the related art, when the main thread of the host APP receives multiple update requests for updating the application widget at the same time, it is possible that the main thread of the host APP does not execute the multiple update requests in sequence. For example, the host APP may only execute the most recently received update request, resulting in incomplete display of the update content of the application widget.
[0098] For example, Figure 3 The desktop APP in the interface 301 shown in the figure has loaded the note application widget. When three new records are added to the native APP of the note, the desktop APP receives three update requests. However, the main thread of the desktop APP only executes the latest update request, resulting in only the content corresponding to the latest update request being displayed in the host APP.
[0099] In order to solve the above problems, an embodiment of the present application provides an interface display method that can be applied to an electronic device. The electronic device receives a first operation from a user, and the electronic device obtains the layout information of the application widget based on a first thread of the host APP that is different from the main thread, so as to display a second interface including a first display page of the application widget according to the layout information. Thus, in the process of loading the application widget in the host APP, the host APP starts a new first thread to execute the operation of obtaining the layout information of the application widget, that is, part of the tasks in the process of loading the application widget are handed over to the first thread for execution, so as not to affect the main thread of the host APP to execute other tasks. The main thread and the first thread of the host APP are executed in parallel, which can reduce the processing workload of the main thread and avoid the main thread of the host APP from being blocked, causing the host APP to freeze.
[0100] Exemplarily, the interface display method provided in the embodiments of the present application can be applied to mobile phones, tablet computers, personal computers (PCs), personal digital assistants (PDAs), smart watches, netbooks, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, vehicle-mounted devices, smart cars, smart speakers and other electronic devices with display screens, and the embodiments of the present application do not impose any restrictions on this.
[0101] like Figure 4 As shown, Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0102] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0103] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0104] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0105] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0106] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0107] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0108] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0109] The charging management module 140 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.
[0110] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.
[0111] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0112] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0113] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.
[0114] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194.
[0115] The wireless communication module 160 can provide wireless communication solutions for application in the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0116] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).
[0117] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0118] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0119] In the embodiment of the present application, the display screen 194 may be an integrated flexible display screen, or a spliced display screen consisting of two rigid screens and a flexible screen located between the two rigid screens.
[0120] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0121] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0122] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0123] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0124] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0125] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0126] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0127] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0128] In the embodiment of the present application, the storage data area can store data created during the use of the electronic device 100 (such as images, videos, content in the user interface of the APP, content in the application widget), etc. For example, the internal memory 121 can be used to store relevant information of the application widget and relevant information of the host APP, etc.
[0129] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0130] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0131] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0132] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.
[0133] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0134] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes a system with a layered architecture as an example to exemplify the software structure of the electronic device.
[0135] Figure 5 A software structure diagram of an electronic device provided in an embodiment of the present application.
[0136] It is understandable that the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system may include an application layer (referred to as the application layer), an application framework layer (referred to as the framework layer), a system library, and a kernel layer.
[0137] The application layer may include a host APP and a content provider (i.e., a native APP). Both the host APP and the native APP may be system applications or third-party applications. Alternatively, the host APP may be a system application and the native APP may be a third-party application. Alternatively, the native APP may be a system application and the host APP may be a third-party application. This is not limited here.
[0138] Among them, system applications refer to applications that are set in electronic devices before leaving the factory. For example, system applications may include programs such as desktop, camera, gallery, calendar, music, memo, and weather. Third-party applications refer to applications that users install after downloading the installation package from an application store (or application market). For example, map applications, food delivery applications, reading applications (such as e-books), social applications, and travel applications.
[0139] For example, the host APP can be a desktop and the native APP can be a calendar; for another example, the host APP can be a desktop and the native APP can be a map application; for another example, the host APP can be a social application and the native APP can be a map application; for another example, the host APP can be a social application and the native APP can be a calendar.
[0140] The application framework layer provides an application programming interface (API) and a programming framework for the application programs in the application layer. The application framework layer includes some predefined functions.
[0141] like Figure 5 As shown, the application framework layer may include an application widget system, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0142] In the embodiment of the present application, the host APP and the native APP cannot communicate directly, and the application widget system can serve as a communication bridge between the host APP and the native APP. Here, the native APP can be the content provider of the application widget, and the native APP can call the AppWidgetProvider class to pass information with the AppWidgetHostView class called by the application widget system to achieve communication between the native APP and the application widget system. The application widget system can call the AppWidgetHostView class to pass information with the AppWidgetHost class called by the host APP to achieve communication between the host APP and the application widget system.
[0143] For example, Figure 5 As shown, when an application widget is loaded in a host APP, the host APP can send a request to create an application widget to the application widget system (e.g., AppWidgetHostView class) based on the application widget class (e.g., AppWidgetHost class). After the application widget system receives the request to create an application widget, the application widget system obtains the layout information of the default layout of the application widget from the native APP, and sends the layout information corresponding to the default layout of the application widget to the host APP. The host APP displays the default layout of the application widget according to the received layout information.
[0144] When the native APP updates the content, the native APP sends an update request for updating the application widget to the host APP through the application widget system. After receiving the update request, the host APP stores the update request in the request queue. After displaying the default layout and / or initial view of the application widget in the host APP, the host APP executes the update request. The host APP sends an update request to the native APP through the application widget system. After receiving the update request, the native APP sends the updated content information to the application widget system, and the application widget system sends the updated content information to the host APP. The host APP updates the display content of the application widget according to the updated content information.
[0145] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0146] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0147] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0148] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).
[0149] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0150] The notification manager allows applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a reminder sound is emitted, the phone vibrates, the indicator light flashes, etc.
[0151] Runtime includes core libraries and virtual machines. Runtime is responsible for system scheduling and management.
[0152] The core library consists of two parts: one is the function that the Java language needs to call, and the other is the core library of the system.
[0153] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0154] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0155] The surface manager is used to manage the display subsystem and provide the fusion of two-dimensional and three-dimensional layers for multiple applications.
[0156] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0157] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0158] A 2D graphics engine is a drawing engine for 2D drawings.
[0159] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver and sensor driver.
[0160] The electronic device in the embodiment of the present application may be installed with one or more applications, and the icons of the applications installed in the electronic device may be displayed on the desktop displayed on the display screen of the electronic device. Among them, the application in the embodiment of the present application may be an embedded application (i.e., a system application of the electronic device) or a downloadable application. An embedded application is an application provided as part of the implementation of an electronic device. A downloadable application may be an application that can provide an Internet protocol multimedia subsystem (IMS) connection, and the downloadable application may be an application pre-installed in the electronic device, or a third-party application downloaded and installed in the electronic device by a user, which is not limited here.
[0161] Among them, the display screen of the electronic device can display a page or a screen of the desktop application. The desktop application may include multiple pages (page) or multiple screens. Among them, multiple elements (element) can be displayed or placed on each page, and multiple elements can be displayed or placed on each screen. Among them, the element can be an icon, a group (for example, a folder) or an application widget of the application. In addition, the electronic device can also switch between different pages of the desktop application. Among them, the icon of the application can also be called an application icon or simply an icon.
[0162] In addition, the page on the desktop of the electronic device may also include a negative screen, and elements may also be displayed on the negative screen. For example, the negative screen may display icons of applications installed in the electronic device (e.g., memos, calendars, etc.) or application widgets (e.g., health application widgets, news application widgets, or settings application widgets, etc.). Normally, the negative screen may display icons or application widgets of applications frequently used by the user. Among them, the above-mentioned negative screen may refer to an interface entered by the user swiping right from the main screen, or it may be an interface entered by the user swiping right from the lock screen interface. The embodiment of the present application does not limit the method of entering the negative screen.
[0163] In addition, the negative first screen may also display icons of applications to be installed recommended by the electronic device, such as icons of video applications, icons of dating applications, or icons of news applications, etc. The elements displayed in the negative first screen are not limited in the embodiment of the present application.
[0164] As can be seen from the above, the application widget can be located on the negative one screen of the desktop of the electronic device, the desktop or the interface of a certain APP. The embodiment of the present application does not limit the location of the application widget. For example, the main interface can be Figure 6 The interface 600 shown in (a) of FIG. 6 includes a time application widget 601. For example, the negative first screen may be Figure 6 The interface 602 shown in (b) in FIG. 6 includes a search application widget 603 and a health application widget 604 . It can be understood that the electronic device can display the interface 602 in response to the user sliding operation to the right on the interface 600 .
[0165] For another example, taking the host APP as a calendar, the calendar interface can be Figure 6 The interface 605 shown in (c) may include a weather application widget 606 and a schedule application widget 607 .
[0166] In the embodiments of the present application, there is no limitation on the number of application widgets displayed in the host APP. Figure 6 As shown in (a) in the figure, an application widget can be displayed in the desktop APP. Figure 6As shown in (c) in FIG. 1 , a weather application widget 606 and a schedule application widget 607 may be displayed in the calendar APP. In addition, an application widget may be displayed in multiple host APPs, for example, a calendar application widget may be displayed in a desktop APP and may also be displayed on the negative one screen.
[0167] The host APP is an APP that can load and run application widgets. The host APP can be a desktop APP, a negative one screen APP, or other APPs, which are not limited here. For example, assuming the main interface is Figure 6 In the interface 600 shown in (a) of FIG. 1 , the interface 600 includes a time widget 601, and the host APP of the time widget 601 is a desktop APP. For another example, assuming that the negative one screen is Figure 6 In the interface 602 shown in (b), the interface 602 includes a search application widget 603 and a health application widget 604, and the host APP of the search application widget 603 and the health application widget 604 is a negative one screen APP. For another example, Figure 6 The calendar interface 605 in (c) includes a weather widget 606, and the host APP of the weather widget 606 is the calendar.
[0168] In the embodiment of the present application, the electronic device can load one or more application widgets into the host APP in response to the user's operation. For example, the embodiment of the present application can set the calendar application widget to the main interface so that the electronic device can display the current calendar when displaying the main interface; for another example, the embodiment of the present application can set the health application widget to the negative one screen so that the electronic device can display information such as the current step count when displaying the negative one screen.
[0169] For example, Figure 7 Example of setting an application widget to the main interface provided in the embodiment of the present application Figure 1 .like Figure 7 As shown, the main interface of the desktop application can be Figure 7 In the interface 700 shown in (a) of FIG. 1 , after the electronic device detects a user triggering operation (e.g., a long press operation) at any position in the main interface 700, in response to the user's triggering operation, the electronic device displays Figure 7 After the electronic device detects the user's trigger operation on the desktop card control 702 in the interface 701, in response to the trigger operation, the electronic device displays Figure 7 The interface 703 shown in (c) of FIG. In the interface 703, a plurality of application widgets are displayed, for example, Figure 7(c) may include a gallery application widget, a calendar application widget, or a recorder application widget, etc. The electronic device detects a user trigger operation (such as a click operation or a touch operation, etc.) on the calendar application widget 704 in the interface 703, and in response to the trigger operation, the electronic device displays Figure 7 The interface 705 shown in (d) in FIG. 705 includes a calendar application widget 706 added to the interface 705 .
[0170] Here, Figure 7 The application widgets shown in (c) are only used as an exemplary description, and the embodiments of the present application are not limited thereto. When the application widgets currently displayed in the interface 703 do not include the application widgets to be added to the desktop, the electronic device receives a user trigger operation on the search control 707 in the interface 703, and in response to the trigger operation, the electronic device displays the searched application widgets. In response to the user's trigger operation, the electronic device can add the searched application widgets to any page of the desktop.
[0171] It is understandable that the above Figure 7 The electronic device shown in the figure adds a calendar application widget to the main interface of the desktop is only an example. The electronic device can add a calendar application widget to any page of the desktop. The display position of the calendar application widget on the desktop is not limited in the embodiment of the present application.
[0172] In an embodiment of the present application, when an electronic device adds an application widget to a host APP, the electronic device may set application widgets of different shapes and / or sizes to be displayed in the host APP.
[0173] For example, Figure 8 As shown, the electronic device responds to the user's trigger operation and displays Figure 8 The interface 800 shown in (a) of FIG. 800 includes multiple application widgets. The electronic device detects a user triggering operation (e.g., a click operation or a touch operation, etc.) on the weather application widget 801 in the interface 800. In response to the triggering operation, the electronic device displays Figure 8 Interface 802 shown in (b) of FIG. 802 displays weather application widgets of different shapes and sizes. The electronic device detects a leftward sliding operation of the user on interface 802, and in response to the sliding operation, the electronic device displays Figure 8In the interface 803 shown in (c), a weather application widget is displayed in the interface 803, and the shape and size of the weather application widget displayed in the interface 803 are different from those of the weather application widget displayed in the interface 802. When the electronic device detects a trigger operation (such as a single click operation, a double click operation, or a touch operation, etc.) of the user on the add to desktop control 804 displayed in the interface 803, in response to the trigger operation, the electronic device displays the following Figure 8 The interface 805 shown in (d) in the figure, wherein the interface 805 displays a weather application widget 806, and the weather application widget 806 has the same shape and size as the weather application widget displayed in the interface 803.
[0174] In an embodiment of the present application, after the electronic device adds the application widget to the host APP, that is, after the application widget is displayed in the host APP, the electronic device can also set the shape and / or size of the application widget displayed in the host APP.
[0175] Exemplarily, the electronic device detects that the user Figure 8 (d) shows an interface for triggering the weather application widget 806 (e.g., a long press operation or a double-click operation, etc.). The electronic device can set the shape and / or size of the weather application widget 806. The electronic device can set the shape and / or size of the weather application widget 806 in response to the user's operation.
[0176] The application widgets shown in the above examples are only used as an exemplary description, and the specific shape and form of the application widgets displayed in the host APP are not limited in the embodiments of the present application. For example, the application widgets displayed in the host APP can be oval, circular, star or square.
[0177] In an embodiment of the present application, after the icon of the native APP corresponding to the application widget on the desktop of the electronic device responds to the user's trigger operation (for example, a long press operation or a double-click operation, etc.), a floating card is displayed on the icon of the native APP, and in response to the user's operation on the floating card, the desktop of the electronic device is displayed with the application widget.
[0178] For example, Fig. 9 Example of setting an application widget to the main interface provided in the embodiment of the present application Figure 2 .like Fig. 9 As shown, the main interface of the desktop application can be Fig. 9 In the interface 900 shown in (a), after the electronic device desktop detects the user's long press operation on the weather icon 901 in the interface 900, the electronic device displays Fig. 9The interface 902 shown in (b) in FIG. 1 is a diagram showing a weather icon 901 in the interface 902, and a floating card 903 is displayed on the weather icon 901 in the interface 902. The electronic device detects the user's control operation on the "service card" in the floating card 903, and in response to the control operation, the electronic device displays Fig. 9 The interface 904 shown in (c) in FIG. 1 shows a weather application widget 905. The control operation includes but is not limited to single-clicking, double-clicking or long-pressing the "service card" in the floating card 903.
[0179] Above Figure 7 and Fig. 9 The method of loading an application widget into a host APP shown in the description is only an exemplary description and is only a possible implementation method in the embodiments of the present application. The method of loading an application widget into a host APP in the embodiments of the present application is not limited. For example, the icon of the native APP of the application widget can be displayed floating on the icon of the native APP in response to the user's control operation. After the application widget displayed floating on the icon of the native APP responds to the user's double-click or drag operation, the application widget is displayed on the desktop of the electronic device.
[0180] In the embodiment of the present application, after the electronic device loads the application widget into the host APP, the electronic device can adjust the display position of the application widget in the host APP in response to the user's operation. For example, after the electronic device detects the user's drag operation on the application widget, in response to the drag operation, the electronic device can move the application widget to the user-specified position.
[0181] For example, Fig.10 This is an example diagram of the position movement of an application widget provided in an embodiment of the present application. Fig.10 As shown, the main interface of the desktop application can be Fig.10 The interface 1001 shown in (a) of FIG. 1001 displays a calendar application widget 1002. After the electronic device detects that the user drags the calendar application widget 1002 to the right, the electronic device can Fig.10 The calendar application widget 1002 is displayed in the interface 1003 shown in (b) of FIG. 1 . The electronic device can also display the calendar application widget 1002 in the interface 1003 shown in FIG. Fig.10 The calendar application widget 1002 is displayed in the interface 1004 shown in (c) .
[0182] It needs to be explained that Fig.10The display position of the calendar application widget 1002 shown in the figure is only for exemplary description, and the calendar application widget 1002 can be displayed at any display position of the electronic device. The display position of the calendar application widget 1002 is not limited in the embodiment of the present application. The electronic device can move the calendar application widget 1002 to any position on the desktop for display in response to the user's drag operation.
[0183] It is also necessary to explain that after an electronic device loads an application widget into a host APP for the first time and the host APP displays an application widget of a certain shape and size, after the electronic device is restarted or the host APP is updated, the shape and position of the application widget in the host APP remain unchanged. Fig.10 In (a), a calendar application widget 1002 is displayed. After the mobile phone is restarted in response to the user's operation, the calendar application widget 1002 is still displayed. Fig.10 The position in (a) in the figure, and the shape and size of the calendar application widget 1002 are the same as the shape and size of the calendar application widget 1002 displayed on the desktop before the mobile phone is restarted.
[0184] In an embodiment of the present application, after the electronic device loads the application widget into the host APP, the electronic device can delete the application widget in the host APP in response to the user's operation. For example, after the application widget displayed in the host APP receives a long press operation from the user, the electronic device removes the application widget in the host APP in response to the long press operation. For another example, after the application widget displayed in the host APP receives a drag operation from the user, the electronic device drags the application widget in the host APP to a preset area (e.g., the upper side, left side, or right side area of the electronic device, etc.) in response to the drag operation of the user to remove the application widget.
[0185] For example, Fig.11 This is an example diagram of deleting an application widget provided in an embodiment of the present application. Fig.11 In the interface 1101 in (a), a calendar application widget 1102 is displayed. The mobile phone detects that the user has long-pressed the calendar application widget 1102. In response to the long-pressing operation, the mobile phone displays Fig.11 The mobile phone detects a user's trigger operation (such as a click operation, a double-click operation, or a long press operation, etc.) on the removal control 1104. In response to the trigger operation, the mobile phone removes the calendar application widget in the interface 1103 and displays the following: Fig.11 Interface 1105 in (c) of FIG. 1105 is an interface after the calendar application widget is removed.
[0186] The application widgets shown in the above figure are only for exemplary description, and the application widgets in the embodiments of the present application are not limited thereto. For example, the application widgets may also be music application widgets or video application widgets, etc. The application widgets in the embodiments of the present application may display content in the form of cards, or may display corresponding content in other forms, which are not limited thereto.
[0187] In an embodiment of the present application, a user can configure the content displayed in the application widget on the user interface of the host APP of the application widget. The electronic device stores the configuration information of the content displayed by the application widget configured by the user in the memory space of the application widget through the host APP. After the application widget is loaded into the host APP, the electronic device can obtain the content of the corresponding application widget based on the configuration information stored in the memory space of the application widget, and display the obtained content of the application widget in the host APP.
[0188] In the embodiment of the present application, the host APP is an application program installed on the electronic device. For example, the host APP can be a system application installed on the electronic device, or a third-party application installed on the electronic device, etc., which is not limited in the embodiment of the present application. In addition, in the embodiment of the present application, when an electronic device displays an application widget on a host APP, the native APP of the application widget can be installed on the electronic device or not, which is not limited in the embodiment of the present application.
[0189] Among them, the native APP can include the content of the corresponding application widget. For example, the native APP of the calendar application widget is the calendar. For another example, the native APP of the memo application widget is the memo. For another example, the native APP of the weather application widget is the weather.
[0190] In one possible case of the embodiment of the present application, after the application widget is set in the host APP of the electronic device, when the content of the native APP corresponding to the application widget is updated, the display content of the application widget is also updated along with the content update of the native APP. Therefore, after the application widget is loaded in the host APP, the content displayed in the application widget is updated along with the content update of the native APP, so that the user can determine the updated content from the application widget without starting the native APP.
[0191] For example, Fig.10 In the interface 1001 in (a), a calendar application widget 1002 is displayed, wherein the current date displayed in the calendar application widget 1002 is the 16th. When the date displayed in the calendar APP of the electronic device is updated to the 17th, the current date displayed in the calendar application widget is also updated to the 17th. The updated calendar application widget is as follows: Fig.10In (d), the calendar application widget 1006 is displayed in the interface 1005, and the current date displayed in the calendar application widget 1006 is the 17th.
[0192] In an embodiment of the present application, for a certain application widget, the native APP of the application widget and the host APP of the application widget may be the same or different, and there is no limitation on this. For example, the host APP of the calendar application widget may be a negative one screen APP, and the native APP of the calendar application widget is a calendar. For another example, the host APP of the weather application widget is a desktop APP, and the native APP of the weather application widget is weather. For another example, the host APP and the native APP of the calendar application widget may both be calendars.
[0193] The content of the application widget and the content of the host APP in the embodiments of the present application may be provided by the same content provider or by different content providers, which is not limited here. For example, when the application widget and the host APP are developed by the same manufacturer, the content of the application widget and the content of the host APP may be provided by the same content provider. For another example, when the application widget is developed by manufacturer A and the host APP is developed by manufacturer B, the content of the application widget and the content of the host APP are provided by different content providers.
[0194] The following takes a mobile phone as an example of an electronic device to illustrate the interface display method of an embodiment of the present application in conjunction with the accompanying drawings.
[0195] In an embodiment of the present application, during the process of the mobile phone displaying the first interface of the host APP, the mobile phone detects the user's first operation and loads the application widget in the host APP. During the process of the host APP loading the application widget, when the host APP creates the default layout of the application widget, the host APP can start a new thread to execute the operation of obtaining the layout information corresponding to the default layout of the application widget. After the host APP obtains the layout information corresponding to the default layout of the application widget through the new thread, the mobile phone displays the second interface to display the first display page of the application widget in the host APP. Among them, the first display page can be the display page corresponding to the default layout of the application widget. For the convenience of description, the new thread started by the host APP will be referred to as the first thread in the following.
[0196] It should be noted that the first interface can be the main interface of the mobile phone, the negative first screen, or the interface of a certain application, etc., which is not limited in the embodiments of the present application. In addition, the first operation can be an operation of a host APP icon by a user, a sliding operation on the main interface (for example, sliding to the left, right or upward, etc.), a voice command, or a quick gesture operation, etc., which is not limited in the embodiments of the present application.
[0197] For example, when the negative first screen includes an application widget, the first operation may be a right swipe operation by the user on the main interface. Figure 6 In the interface 602 shown in (b) of FIG. 1 , when the interface 602 includes a health application widget 604, the first operation can be that the user Figure 6 For example, when the interface of a host APP includes an application widget, the first operation may be a trigger operation of the user on the application icon. Figure 6 The interface 605 shown in (c) includes a weather application widget 606 and a schedule application widget 607. The first operation may be a trigger operation of the user on the calendar icon on the desktop (eg, a single-click operation or a double-click operation, etc.).
[0198] The above-mentioned scenario of displaying the default layout of application widgets in the host APP in the mobile phone can be a scenario of loading the default layout of application widgets that have been set in the host APP during the startup of the host APP, or it can be a scenario of loading the default layout of application widgets when setting the application widgets for the first time in the host APP. The embodiments of the present application are not limited to this.
[0199] In one possible case, when multiple application widgets are loaded in the host APP, the host APP can start the first thread when the default layout of any application widget among the multiple application widgets is loaded for the first time, so as to use the first thread to perform the operation of obtaining the default layout of the multiple application widgets. Then, the host APP uses the first thread to continue to obtain the first content information to be displayed of other application widgets. In other words, the host APP can perform the operation of obtaining the default layout of multiple application widgets through a newly started first thread.
[0200] For example, when three application widgets are loaded in the host APP, the host APP may newly start a first thread when creating the default layout of the first application widget. Then, the host APP uses the first thread to execute the operation of obtaining the default layout of the above three application widgets.
[0201] In another possible case, when multiple application widgets are loaded in the host APP, the host APP can also start the first threads corresponding to the multiple application widgets respectively when loading the default layouts of the multiple application widgets, so as to use the multiple first threads to respectively perform the operation of obtaining the default layouts of the corresponding application widgets. That is to say, for each application widget, the host APP starts a first thread to perform the operation of obtaining the default layout of the application widget.
[0202] For example, when three application widgets are loaded in the host APP, the host APP can respectively start the corresponding first threads when creating the default layouts of the three application widgets. That is, the host APP starts the three first threads to respectively execute the operation of obtaining the default layouts of the corresponding application widgets.
[0203] In an embodiment of the present application, after displaying the default layout of the application widget in the host APP, the host APP can obtain the first content information to be displayed of the application widget through the main thread, or the host APP can continue to obtain the first content information to be displayed of the application widget through the first thread.
[0204] In a possible solution, after displaying the default layout of the application widget in the host APP, the host APP may obtain the first content information corresponding to the initial view to be displayed of the application widget through the main thread. After the host APP obtains the first content information of the application widget through the main thread, the second display page corresponding to the initial view of the application widget is displayed in the default layout of the application widget displayed in the host APP.
[0205] For example, Fig.12 Timing of loading application widgets in the host APP provided in the embodiment of the present application Figure 1 .like Fig.12 As shown, the main thread of the host APP calls the create view function based on the application widget class to generate a host view request for creating an application widget (for example, the view corresponding to the default layout). For example, the main thread of the host APP calls the createView function based on the AppWidgetHost class to create a host view of the application widget. The main thread of the host APP sends a request to create a new host view to the host view class based on the application widget class. Then, the main thread of the host APP sets the information of the application widget based on the application widget class. For example, the main thread of the host APP calls the setAppWidget(widgetid, providerinfo) function based on the AppWidgetHost class to set the identification information of the application widget and the attribute information of the application widget.
[0206] When the main thread of the host APP can update the application widget based on the application widget class, for example, when the main thread of the host APP calls a function that creates the default layout of the application widget based on the application widget class, the main thread of the host APP is triggered to start a new first thread. For example, when the main thread of the host APP calls the updateAppWidget function based on the AppWidgetHost class, the main thread of the host APP is triggered to start the first thread. Then, the main thread of the host APP sends a task to obtain the layout information of the default layout to the first thread based on the host view class.
[0207] like Fig.12 As shown, after the first thread of the host APP receives the task of obtaining the layout information of the default layout, the first thread of the host APP obtains the layout information of the application widget and sends the obtained layout information to the main thread of the host APP. After the main thread of the host APP receives the layout information, the first display page corresponding to the default layout of the application widget is displayed in the host APP. For example, the first display page can be Fig.14 The page corresponding to the calendar application widget 1402 in the interface 1401 shown in (a) in FIG. 1402. For example, the first thread of the host APP returns the layout information to the main thread of the host APP based on the callback (defaultView) callback function.
[0208] After that, the main thread of the host APP obtains the first content information to be displayed by the application widget based on the host view class, so as to display the first content information of the application widget in the default layout. For example, the main thread of the host APP calls the applyContent(defaultView) function based on the AppWidgetHostView class to load the first content information of the application widget into the default layout, so as to display the second display page corresponding to the initial view of the application widget in the host APP. The second display page of the application widget includes the first content information of the application widget. For example, the second display page can be the above Fig.14 The page corresponding to the calendar application widget 1405 in the interface 1404 shown in (c).
[0209] During the process of the host APP loading the application widget, the host APP executes the operation of loading the default layout through the first thread, and the host APP receives the first task (for example, the host APP receives the interface refresh task), and the main thread of the host APP executes the first task. Among them, the first task is different from the task of the host APP loading the application widget. It can be seen that the host APP executes the loading of the application widget and the first task in parallel through the first thread and the main thread, which solves the problem in the related technology that during the process of the host APP loading the application widget, the host APP receives other tasks and processes them untimely, resulting in the blocking of the main thread of the host APP, avoids the phenomenon of the host APP being stuck, and improves the smoothness of the operation of the host APP in the process of loading the application widget.
[0210] In another possible solution, after displaying the default layout of the application widget in the host APP, the host APP can continue to obtain the first content information to be displayed of the application widget through the first thread. After the host APP obtains the first content information corresponding to the initial view of the application widget through the first thread, the second display page corresponding to the initial view of the application widget is displayed in the default layout of the application widget displayed in the host APP. As a result, the host APP executes the task of loading the application widget through the first thread, which avoids the main thread of the host APP being unable to execute other tasks in time during the process of loading the application widget, causing the host APP to freeze, thereby improving the smoothness of the host APP's operation during the process of loading the application widget.
[0211] For example, Fig.13 Timing of loading application widgets in the host APP provided in the embodiment of the present application Figure 2 .Depend on Fig.12 and Fig.13 It can be seen that Fig.13 The process from the main thread in the host APP starting to load the application widget to the first thread of the host APP obtaining the layout information of the application widget is similar to Fig.12 The execution process is the same as in , and will not be repeated here. Fig.13 After the first thread of the host APP obtains the layout information of the application widget, the first thread of the host APP displays the first display page corresponding to the default layout of the application widget in the host APP according to the obtained layout information. Then, the first thread of the host APP obtains the first content information of the application widget, and displays the second display page of the application widget in the host APP according to the obtained first content information. For example, the first thread of the host APP calls the applyContent(defaultView) function to load the first content information of the application widget into the first display page corresponding to the default layout, so as to display the second display page corresponding to the initial view of the application widget in the host APP.
[0212] For example, Fig.14 As shown, the host APP is a desktop APP and the application widget is a calendar application widget. Fig.14 In (a), interface 1401 is displayed, and interface 1401 shows that the desktop APP loads the calendar application widget 1402 with the default layout. The layout information of the default layout is obtained by the first thread. During the process of the desktop APP loading the initial view of the calendar application widget, the mobile phone detects the triggering operation of the phone application icon in the user's desktop APP. In response to the triggering operation, the mobile phone can control the display through the main thread Fig.14Interface 1403 shown in (b) of the figure. It can be seen that during the process of loading the calendar application widget on the desktop APP, since some tasks processed by the main thread have been replaced by the first thread, the main thread of the desktop APP can respond to other tasks of the mobile phone in a timely manner, improving the smoothness of the mobile phone during the loading of the application widget. The mobile phone detects the user's instruction to return to the desktop APP, and the mobile phone displays Fig.14 The interface 1404 is shown in (c) in the figure, and a calendar application widget 1405 is displayed in the interface 1404. Fig.14 The calendar application widget 1405 shown in (c) in the figure has the content information of the initial view loaded (an example of the first content information). The content information of the initial view displayed in the calendar application widget 1405 is also obtained by the first thread. The first thread of the desktop APP executes the entire process of loading the calendar application widget, which does not affect the main thread of the desktop APP to perform other tasks during the process of loading the application widget, making the operation of the desktop APP smoother.
[0213] It needs to be explained that in Fig.14 In the process of the first thread of the desktop APP obtaining the initial view of the calendar application widget, the mobile phone detects the triggering operation of the phone application icon in the user's desktop APP, and the main thread of the desktop APP executes the process of displaying the interface of the phone APP in the desktop APP. As a result, the first thread and the main thread of the desktop APP execute different tasks in parallel, reducing the phenomenon of the desktop APP running stuck and improving the smoothness of the desktop APP running.
[0214] In an embodiment of the present application, during the process of the host APP loading an application widget or displaying an already loaded application widget in the host APP, the host APP can update the content information displayed in the display page of the application widget. For example, the desktop APP can update the time information displayed in the time application widget displayed on the desktop in real time. For another example, the desktop APP can periodically (e.g., every 1 minute, 2 minutes, or 3 minutes) update the weather information displayed in the weather application widget displayed on the desktop. For another example, the desktop APP can update the schedule information displayed in the schedule application widget displayed on the desktop at a preset time (e.g., 9 o'clock in the morning).
[0215] The following takes the case where the host APP updates the content information of the application widget during the process of the host APP loading the application widget as an example to explain in detail the scheme for the host APP to update the application widget.
[0216] As a first possible implementation of the embodiment of the present application, during the process in which the first thread of the host APP obtains the layout information of the default layout, the main thread of the host APP receives an update request. The main thread of the host APP can execute the update request after obtaining the first content information of the application widget. That is, the main thread of the host APP executes the update request, and the host APP displays the first display page corresponding to the default layout of the application widget (such as Fig.14 (a)) and the second display page corresponding to the initial view (as shown in Fig.14 After that, a third display page corresponding to the updated view of the application widget is displayed.
[0217] For example, Fig.15 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 1 .like Fig.15 As shown, after the main thread of the host APP sends the task of obtaining the layout information of the default layout to the first thread based on the host view class, during the process of the first thread of the host APP obtaining the layout information of the default layout, the broadcast class of the application widget sends an update request to the main thread of the host APP, and after the main thread of the host APP receives the update request, it stores the update request in the request queue. The update request is used to update the content information in the display page of the application widget.
[0218] For example, after the main thread of the host APP sends the task of obtaining the layout information of the default layout to the first thread based on AppWidgetHostView, while the first thread of the host APP obtains the layout information of the default layout, the AppWidgetProvider of the host APP sends onUpdate to the main thread of the host APP. After receiving onUpdate, the main thread of the host APP stores the request task corresponding to the update request indicated by onUpdate in the request queue.
[0219] It should be noted that, in the process of the first thread of the host APP obtaining the layout information of the default layout, if the main thread of the host APP receives multiple update requests, the main thread of the host APP will store the multiple update requests in the request queue in sequence according to the order in which the multiple update requests are received. For example, the main thread of the host APP receives three update requests in sequence, namely update request 1, update request 2 and update request 3. The main thread of the host APP can store the three update requests in the request queue in sequence.
[0220] After the first thread of the host APP obtains the layout information of the default layout, the first thread of the host APP sends the layout information of the default layout to the main thread of the host APP. The main thread of the host APP receives the layout information, and displays the first display page corresponding to the default layout of the application widget in the host APP. After the main thread of the host APP obtains the first content information corresponding to the initial view of the application widget, the host APP displays the second display page corresponding to the initial view according to the first content information. Then, the main thread of the host APP traverses the request queue and executes each update request obtained from the request queue in turn. After the main thread executes each update request, the third display page corresponding to the application widget is displayed in the host APP in turn.
[0221] It should be noted that only the process of the host APP obtaining the layout information of the default layout of the application widget is described in detail here, after the host APP receives the update request for the application widget, the host APP updates the application widget according to the update request, the host APP creates a new host view based on the application widget class, and sets the identification information and attribute information of the application widget. Please refer to the above embodiment for details. Fig.12 and Fig.13 Similarly, this part of the process will not be described in detail in the subsequent embodiments.
[0222] For example, Fig.16 Example of updating application widgets for the host APP provided in the embodiment of the present application Figure 1 ,like Fig.16 In the interface 1601 shown in (a), a note application widget 1602 is displayed. When the desktop APP is displaying the note application widget, the main thread of the desktop APP receives three update requests, and the main thread of the desktop APP stores the three update requests in the request queue. After the desktop APP displays the display page corresponding to the initial view of the note application widget (an example of the second display page), the main thread of the desktop APP traverses the request queue and executes the three update requests stored in the request queue in sequence, and the mobile phone displays the following: Fig.16 In the interface 1603 shown in (b), a note application widget 1604 is displayed in the interface 1603, and the note application widget 1604 shows that the main thread of the desktop APP executes the display area 1605, the display area 1606 and the display area 1607 corresponding to the three update requests in sequence.
[0223] From the above, it can be seen that when the host APP is in the process of displaying the default layout of the application widget, the main thread of the host APP receives an update request for the application widget, and the host APP stores the update request in the request queue in order. After the host APP displays the second display page corresponding to the initial view of the application widget, the main thread of the host APP traverses the request queue and executes the update tasks corresponding to the update request in order, and the host APP displays the display pages corresponding to the update request in order. Therefore, after the main thread of the host APP receives the update request, it stores the update request in the request queue, and then the main thread of the host APP executes the update requests pre-stored in the request queue in order, which avoids the phenomenon that when the main thread of the host APP receives multiple update requests, the request tasks corresponding to all the update requests are not executed, resulting in the inability to accurately display the updated content in the host APP.
[0224] For example, Fig.17 Example of updating application widgets for the host APP provided in the embodiment of the present application Figure 2 .like Fig.17 In (a), interface 1701 is displayed. During the process of displaying calendar application widget 1702 on desktop APP, the main thread of desktop APP receives two update requests for calendar application widget in sequence, and the main thread of desktop APP stores the two update requests in the update queue in sequence. After the default layout of calendar application widget 1702 is displayed on interface 1701, desktop APP displays Fig.17 Interface 1703 shown in (b) of FIG. 1703 displays a calendar application widget 1704. Calendar application widget 1704 displays a second display page corresponding to the initial view of the calendar application widget. Then, the main thread of the desktop APP traverses the update requests in the update queue, executes the update tasks corresponding to the update requests, and displays the update tasks in turn. Fig.17 Interfaces 1705 and 1707 shown in (c) and (d) in FIG. 1705 shows a calendar application widget 1706 after the main thread of the desktop APP executes the first stored update request. The calendar application widget 1706 shows a third display page of the second content information corresponding to the main thread executing the update request. Interface 1707 shows a calendar application widget 1708 after the main thread of the desktop APP executes the second stored update request.
[0225] As a second possible implementation of the embodiment of the present application, during the process in which the first thread of the host APP obtains the layout information of the default layout, the main thread of the host APP receives an update request. After obtaining the layout information of the default layout, the main thread of the host APP can directly execute the update request. In other words, the host APP displays the first display page (such as the default layout of the application widget) corresponding to the default layout. Fig.17After that, the second display page corresponding to the initial view of the application widget (such as the page corresponding to the default layout of the calendar application widget 1702 shown in (a)) is not displayed. Fig.17 The page corresponding to the initial view of the calendar application widget 1704 shown in (b) of FIG. 1704 ) is directly displayed, and the third display page corresponding to the updated view of the application widget is directly displayed (such as Fig.17 The page corresponding to the updated view of the calendar application widget 1706 shown in (c) in FIG. 1 ).
[0226] For example, Fig.18 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 2 .like Fig.18 As shown, in the process of the first thread of the host APP obtaining the layout information of the default layout, the application widget broadcast class sends an update request to the main thread of the host APP. After receiving the update request, the main thread of the host APP stores the update request in the request queue. For example, after the main thread of the host APP sends the task of obtaining the layout information of the default layout to the first thread based on AppWidgetHostView, in the process of the first thread of the host APP obtaining the layout information of the default layout, the AppWidgetProvider of the host APP sends onUpdate to the main thread of the host APP. After receiving onUpdate, the main thread of the host APP stores the request task corresponding to the update request indicated by onUpdate in the request queue.
[0227] After the first thread of the host APP obtains the layout information of the default layout, the first thread of the host APP sends the layout information of the default layout to the main thread of the host APP. The main thread of the host APP receives the layout information and displays the first display page corresponding to the default layout of the application widget in the host APP. Then, the main thread of the host APP traverses the request queue and executes each update request obtained from the request queue in turn. The host APP displays the third display page corresponding to the application widget after the main thread executes each update request in turn.
[0228] From the above, it can be seen that when the host APP is displaying the default layout of the application widget, the main thread of the host APP receives an update request for the application widget, and the host APP stores the update request in the request queue. After the host APP displays the first display page corresponding to the default layout of the application widget, the main thread of the host APP traverses the request queue and executes the update tasks corresponding to the update request in sequence, and the host APP displays the display pages corresponding to the update request in sequence. Therefore, after the host APP displays the display page corresponding to the default layout of the application widget, it directly displays the updated display page, so that the user can intuitively see the updated content, which improves the user experience.
[0229] For example, Fig.19 Example of updating application widgets for the host APP provided in the embodiment of the present application Figure 3 .like Fig.19 In (a), interface 1901 is displayed. During the process of displaying calendar application widget 1902 on desktop APP, the main thread of desktop APP receives two update requests for calendar application widget in sequence, and the main thread of desktop APP stores the two update requests in the update queue in sequence. After the default layout of calendar application widget 1902 is displayed on interface 1901, desktop APP displays Fig.19 The interface 1903 shown in (b) and Fig.19 The interface 1905 described in (c) in FIG. 1903 shows a calendar application widget 1904 after the main thread of the desktop APP executes the first stored update request. The interface 1905 shows a calendar application widget 1906 after the main thread of the desktop APP executes the second stored update request.
[0230] As a third possible implementation method of an embodiment of the present application, in the process of the first thread of the host APP obtaining the layout information of the default layout, the first thread of the host APP receives an update request. Then, the first thread of the host APP stores the received update request in the request queue. After the first thread of the host APP obtains the layout information of the default layout and returns the layout information to the main thread, the main thread of the host APP displays the first display page (the page corresponding to the default layout) and obtains the first content information of the application widget according to the layout information. The main thread of the host APP displays the second display page (the page corresponding to the initial view) according to the first content information. After that, after the first thread of the host APP obtains the update request from the request queue and executes the update request, the host APP displays the third display page including the second content information corresponding to the update request.
[0231] For example, Fig. 20 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 3 .like Fig. 20As shown, in the process of the first thread of the host APP obtaining the layout information of the default layout, the application widget broadcast class sends an update request to the first thread of the host APP. After receiving the update request, the first thread of the host APP stores the update request in the request queue. For example, after the first thread of the host APP sends the task of obtaining the layout information of the default layout to the first thread based on AppWidgetHostView, in the process of the first thread of the host APP obtaining the layout information of the default layout, the AppWidgetProvider of the host APP sends onUpdate to the first thread of the host APP. After receiving onUpdate, the first thread of the host APP stores the request task corresponding to the update request indicated by onUpdate in the request queue.
[0232] After the first thread of the host APP obtains the layout information of the default layout, the first thread of the host APP sends the layout information of the default layout to the main thread of the host APP. The main thread of the host APP receives the layout information and displays the first display page (such as the default layout of the application widget) corresponding to the default layout in the host APP. Fig.17 The main thread of the host APP displays the second display page (such as the default layout of the calendar application widget 1702 shown in (a)) according to the first content information obtained. Fig.17 Then, the first thread of the host APP traverses the request queue and executes each update request obtained from the request queue in sequence, and the host APP displays the third display page (such as Fig.17 The page corresponding to the view of the calendar application widget 1706 shown in (c) in FIG. 1 , and Fig.17 1708).
[0233] As a fourth possible implementation method of the embodiment of the present application, during the process of the first thread of the host APP obtaining the layout information of the default layout, the first thread of the host APP receives an update request. Then, the first thread of the host APP stores the received update request in the request queue. After the first thread of the host APP obtains the layout information of the default layout and returns the layout information to the main thread, the first thread of the host APP obtains the update request from the request queue and executes the update request, and the host APP directly displays the third display page including the second content information corresponding to the update request.
[0234] For example, Fig.21 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 4 .like Fig.21 As shown, in the process of the first thread of the host APP obtaining the layout information of the default layout, the application widget broadcast class sends an update request to the first thread of the host APP. After receiving the update request, the first thread of the host APP stores the update request in the request queue. For example, after the first thread of the host APP sends the task of obtaining the layout information of the default layout to the first thread based on AppWidgetHostView, in the process of the first thread of the host APP obtaining the layout information of the default layout, the AppWidgetProvider of the host APP sends onUpdate to the first thread of the host APP. After receiving onUpdate, the first thread of the host APP stores the request task corresponding to the update request indicated by onUpdate in the request queue.
[0235] like Fig.21 As shown, after the first thread of the host APP obtains the layout information of the default layout, the first thread of the host APP sends the layout information of the default layout to the main thread of the host APP, and then the first thread of the host APP traverses the request queue and executes each update request obtained from the request queue in sequence. After the first thread executes each update request, the third display page corresponding to the application widget (such as Fig.19 The page corresponding to the calendar application widget 1904 shown in (b) in FIG. 1 , and Fig.19 The page corresponding to the calendar application widget 1906 shown in (c) in FIG. 1 ).
[0236] As a fifth possible implementation method of the embodiment of the present application, during the process in which the first thread of the host APP obtains the layout information of the default layout, the first thread of the host APP receives an update request. The first thread of the host APP stores the received update request in the request queue. After the first thread of the host APP obtains the layout information of the default layout and the first display content of the application widget, the first thread of the host APP executes the update request, and the host APP displays a third display page including the second content information corresponding to the update request. It can be seen that the first thread of the host APP executes the tasks of obtaining the information corresponding to the default layout and the initial view of the application widget, and executes the tasks corresponding to the update request. The main thread and the first thread of the host APP execute the corresponding tasks in parallel, which avoids the problem that the main thread of the host APP is blocked during the process of loading the application widget in the host APP, resulting in a slow response of the host APP.
[0237] For example, Fig. 22 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 5 .like Fig. 22As shown, in the process of the first thread of the host APP obtaining the layout information of the default layout, the application widget broadcast class sends an update request to the first thread of the host APP. After receiving the update request, the first thread of the host APP stores the update request in the request queue. For example, after the first thread of the host APP sends the task of obtaining the layout information of the default layout to the first thread based on AppWidgetHostView, in the process of the first thread of the host APP obtaining the layout information of the default layout, the AppWidgetProvider of the host APP sends onUpdate to the first thread of the host APP. After receiving onUpdate, the first thread of the host APP stores the request task corresponding to the update request indicated by onUpdate in the request queue.
[0238] like Fig. 22 As shown, after the first thread of the host APP obtains the layout information of the default layout, the first thread of the host APP loads the default layout of the application widget according to the layout information to display the first display page corresponding to the default layout in the host APP (such as Fig.17 Then, after the first thread of the host APP obtains the first content information of the application widget, the first thread of the host APP loads the initial view of the application widget according to the first content information to display the second display page corresponding to the initial view of the application widget in the host APP (such as Fig.17 1704). Thereafter, the first thread of the host APP traverses the request queue and sequentially executes each update request obtained from the request queue. The host APP sequentially displays the third display page (such as the page corresponding to the initial view of the calendar application widget 1704 shown in (b) of FIG. 1704). Fig.17 The page corresponding to the view of the calendar application widget 1706 shown in (c) in FIG. 1 , and Fig.17 1708).
[0239] As a sixth possible implementation method of the embodiment of the present application, in the process of the first thread of the host APP obtaining the layout information of the default layout, the first thread of the host APP receives an update request. The first thread of the host APP stores the received update request in the request queue. After the first thread of the host APP obtains the layout information of the default layout, the first thread of the host APP executes the update request. As a result, the entire process of the host APP displaying the application widget is executed by the first thread, and the main thread of the host APP can perform other tasks, thereby avoiding the phenomenon of jamming when the host APP loads the application widget. In addition, after the first thread of the host APP loads the default layout of the application widget according to the layout information, it directly executes the update request, so that the host APP directly displays the updated view after displaying the default layout of the application widget, thereby improving the display efficiency of the updated view.
[0240] For example, Fig.23 Timing of updating application widgets by the host APP provided in the embodiment of the present application Figure 6 .like Fig.23 As shown, in the process of the first thread of the host APP obtaining the layout information of the default layout, the application widget broadcast class sends an update request to the first thread of the host APP. After receiving the update request, the first thread of the host APP stores the update request in the request queue. After the first thread of the host APP obtains the layout information of the default layout, the first thread of the host APP loads the default layout of the application widget according to the layout information to display the first display page corresponding to the default layout in the host APP. Then, the first thread of the host APP traverses the request queue and executes each update request obtained from the request queue in turn. After the first thread executes each update request, the third display page corresponding to the application widget is displayed in the host APP in turn.
[0241] Continue as Fig.19 As shown in (a), after the first thread of the desktop APP executes to display the default layout according to the layout information of the calendar application widget, the calendar application widget 1902 is displayed in the mobile phone interface 1901. After the first thread of the desktop APP traverses the request queue and executes and obtains two update requests in sequence, the mobile phone displays Fig.19 The interface 1903 shown in (b) and Fig.19 Interface 1905 shown in (c) of FIG. 1903 shows a calendar application widget 1904 after the first thread of the desktop APP executes the first stored update request. Interface 1905 shows a calendar application widget 1906 after the first thread of the desktop APP executes the second stored update request.
[0242] In the embodiment of the present application, when an application widget is displayed in the host APP, the main thread of the host APP can call the delete function to delete the application widget from the host APP. For example, when a calendar application widget is displayed in the desktop APP of a mobile phone, the main thread of the desktop APP can call the onDeleted function to delete the calendar application widget in the desktop APP.
[0243] It is understandable that when multiple application widgets are displayed in the host APP, if multiple application widgets are deleted from the host APP, the main thread of the host APP can call the delete function multiple times. For example, the main thread of the desktop APP can call the onDeleted function three times to delete the calendar application widget, weather application widget, and music application widget displayed in the desktop APP.
[0244] In an embodiment of the present application, when the mobile phone detects that the user has deleted at least one application widget in the desktop APP, in response to the deletion operation, the desktop APP deletes the at least one application widget. Fig.24 This is an example diagram of deleting an application widget provided by an embodiment of the present application. Fig.24 In (a), the mobile phone displays an interface 2400, which displays a calendar application widget 2401, a weather application widget 2402, and a health application widget 2403. The mobile phone detects a trigger operation (e.g., a long press operation) of a user on any application widget displayed on the desktop, and in response to the trigger operation, the mobile phone displays Fig.24 Interface 2404 shown in (b) of FIG. Calendar application widget 2401, weather application widget 2402, and health application widget 2403 displayed in interface 2404 are in a waiting-to-be-selected state. The mobile phone detects a user's selection operation (e.g., a single click operation or a touch operation, etc.) on any application widget, and in response to the user's selection operation on at least one application widget, at least one application widget in the mobile phone is in a selected state.
[0245] for example, Fig.24 The calendar application widget and the weather application widget shown in (b) are in the selected state. Then, after the mobile phone detects the user's trigger operation on the delete control displayed in the interface 2404, the desktop APP responds to the trigger operation and deletes the calendar application widget and the weather application widget displayed in the interface 2404, and displays the following Fig.24 Interface 2405 shown in (c) in the figure, wherein a health application widget is displayed in interface 2405.
[0246] It is understandable that the above Fig.24The example in describes a method for a mobile phone to delete multiple application widgets in batches in response to a user's selection operation on multiple application widgets. In addition, the mobile phone can also delete multiple application widgets in sequence in response to a user's deletion operation on an application widget. Fig.11 As shown, the mobile phone detects a user's trigger operation on the application widget (for example, a long press operation). In response to the trigger operation, a removal control is displayed on the mobile phone desktop. In response to the user's trigger operation on the removal control, the application widget displayed in the desktop APP is deleted.
[0247] like Fig.25 As shown, an embodiment of the present application discloses an electronic device, which may be the above-mentioned mobile phone. The electronic device may specifically include: a touch screen 2501, wherein the touch screen 2501 includes a touch sensor 2506 and a display screen 2507; one or more processors 2502; a memory 2503; one or more application programs (not shown); and one or more computer programs 2504, and the above-mentioned components may be connected via one or more communication buses 2505. Among them, the above-mentioned one or more computer programs 2504 are stored in the above-mentioned memory 2503 and are configured to be executed by the one or more processors 2502, and the one or more computer programs 2504 include instructions, which may be used to execute the relevant steps in the above-mentioned embodiments.
[0248] It is understandable that, in order to realize the above functions, the above-mentioned electronic devices, etc. include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present invention.
[0249] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device etc. according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0250] In the case of dividing each functional module according to each function, a possible composition diagram of the electronic device involved in the above embodiment, the electronic device may include: a display unit, a transmission unit and a processing unit, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0251] The embodiment of the present application also provides an electronic device, including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the above-mentioned related method steps to implement the interface display method in the above-mentioned embodiment.
[0252] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the interface display method in the above-mentioned embodiment.
[0253] An embodiment of the present application further provides a computer program product, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the interface display method in the above-mentioned embodiment.
[0254] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory so that the device executes the interface display method executed by the electronic device in the above-mentioned method embodiments.
[0255] Among them, the electronic device, computer-readable storage medium, computer program product or device provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0256] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0257] Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0258] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.
[0259] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An interface display method, characterized in that: include: The electronic device displays a first interface; The electronic device detects a first operation of a user, where the first operation is used to control the electronic device to display a second interface, where the second interface includes an application widget; The electronic device obtains the layout information of the application widget based on a first thread of a host application APP, where the first thread is different from a main thread of the host APP; The electronic device displays the second interface, where the second interface includes a first display page of the application widget, and the first display page is displayed based on the layout information; The electronic device obtains the first content information of the application widget based on the first thread or the main thread of the host APP; The electronic device displays a third interface, where the third interface includes a second display page of the application widget, and the first content information is displayed in the second display page.
2. The method according to claim 1, characterized in that: Before the electronic device obtains the layout information of the application widget based on the first thread of the host application APP, the method further includes: The electronic device starts the first thread through the host APP.
3. The method according to claim 1 or 2, characterized in that: The first content information is acquired by the first thread of the host APP; The electronic device displays a third interface, including: The electronic device sends the first content information to the main thread of the host APP based on the first thread of the host APP; The electronic device displays the third interface based on the first content information received by the main thread of the host APP.
4. The method according to claim 1, characterized in that: Before the electronic device displays the third interface, the method further includes: After the electronic device determines that the main thread of the host APP has received at least one update request, the main thread of the host APP stores the at least one update request in a request queue, where the update request is used to indicate an update of content information in the application widget; After the electronic device displays the third interface, the method further includes: The electronic device obtains an update request from the request queue based on the main thread of the host APP, and displays a fourth interface, wherein the fourth interface includes a third display page of the application widget, and the third display page displays second content information corresponding to the update request.
5. The method according to claim 1, characterized in that Before the electronic device displays the second interface, the method further includes: After the electronic device determines that the main thread of the host APP has received at least one update request, the main thread of the host APP stores the at least one update request in a request queue, where the update request is used to indicate an update of content information in the application widget; After the electronic device displays the second interface, the method further includes: The electronic device obtains an update request from the request queue based on the main thread of the host application APP; The electronic device displays a fourth interface based on the update request obtained by the main thread of the host APP from the request queue.
6. The method according to claim 4 or 5, characterized in that: The electronic device obtains the update request from the request queue based on the main thread of the host application APP, including: The electronic device sequentially obtains the update requests from the request queue based on the storage order of the at least one update request stored in the request queue by the main thread of the host APP.
7. The method according to claim 1, characterized in that Before the electronic device displays the third interface, the method further includes: After the electronic device determines that the first thread of the host APP has received at least one update request, the first thread of the host APP stores the at least one update request in a request queue, where the update request is used to indicate an update of content information in the application widget; After the electronic device displays the third interface, the method further includes: The electronic device obtains an update request from the request queue based on the first thread of the host APP, and displays a fourth interface, wherein the fourth interface includes a third display page of the application widget.
8. The method according to claim 1, characterized in that Before the electronic device displays the second interface, the method further includes: After the electronic device determines that the first thread of the host APP has received at least one update request, the first thread of the host APP stores the at least one update request in a request queue, where the update request is used to indicate an update of content information in the application widget; After the electronic device displays the second interface, the method further includes: The electronic device obtains an update request from the request queue based on the first thread of the host APP and displays a fourth interface.
9. The method according to claim 7 or 8, characterized in that: The electronic device obtains an update request from the request queue based on the first thread of the host APP, including: The electronic device sequentially obtains the update requests from the request queue based on the storage order of the at least one update request stored in the request queue by the first thread of the host APP.
10. The method according to claim 1 or 2, characterized in that: Before the electronic device displays the third interface, the method further includes: The host APP of the electronic device receives a first task, where the first task is different from the task of the host APP loading the application widget; The electronic device executes the first task based on the main thread of the host APP.
11. An electronic device, characterized in that: include: A touch screen, which includes a touch sensor and a display screen; one or more processors; Memory; Wherein, one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device executes the interface display method as described in any one of claims 1-10.
12. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, characterized in that: When the instruction is executed on an electronic device, the electronic device executes the interface display method as described in any one of claims 1 to 10.
