Application page theme switching method and related equipment
By building association relationships between applications and dynamically adjusting theme colors, the problems of inconsistent styles and poor content adaptability during theme switching of multiple applications are solved, and unified styles and efficient theme switching are achieved.
Patent Information
- Application Number
- CN202010610012.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-29
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2040-11-12
AI Technical Summary
The prior art is difficult to switch themes between multiple applications, resulting in inconsistent styles and inconsistent content and theme colors when switching themes, affecting user experience.
By pre-constructing the association relationship between applications, receiving topic switching information, analyzing the association relationship and topic information to be switched, judging the associated application and switching themes, and dynamically adjusting the theme color according to the content of the application page to adapt.
It realizes the theme exchange between multiple applications, ensures style consistency, and improves the adaptability of content and themes by dynamically adjusting the theme colors and improves the user experience.
Smart Images

Figure CN111796896B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of information processing technology, and in particular, to a method for switching themes of an application page and related devices. Background Art
[0002] Currently, there are more and more types of applications, and users can set different themes in different applications.
[0003] As the business continues to develop, the products delivered now are often a complete set of solutions. The applications in a complete set of solutions are required to maintain a unified style and display corresponding styles in different scenarios. This requires that several different themes can be configured during development and then switched. However, in the existing technology, the theme of each application can only be switched separately. Summary of the invention
[0004] In view of this, an object of one or more embodiments of the present specification is to provide a method for switching themes of an application page and related devices to solve the problem of switching themes of multiple application programs.
[0005] Based on the above purpose, one or more embodiments of this specification provide a method for switching the theme of an application page, including:
[0006] Receive first theme switching information; wherein the first theme switching information is generated and issued based on a first theme switching request for a first application; the first theme switching information includes a pre-built association relationship between the first application and other applications and basic information of the theme to be switched;
[0007] Parsing the first topic switching information to obtain the association relationship and basic information of the topic to be switched;
[0008] Determining whether the second application is associated with the first application based on the association relationship;
[0009] If so, the theme is switched based on the basic information of the theme to be switched.
[0010] Optionally, switching the theme based on the basic information of the theme to be switched includes:
[0011] Acquire a theme switching color according to the basic information of the theme to be switched;
[0012] Determine whether any application page of the second application needs to change the theme switching color;
[0013] If so, an adaptive color is generated according to the theme switching color, and the theme color of the current application page is modified to the adaptive color; otherwise, the theme color of the current application page is modified to the theme switching color.
[0014] Optionally, generating an adaptive color according to the theme switching color includes:
[0015] Get the background color;
[0016] The matching color is obtained according to the theme switching color, the background color and a preset offset value.
[0017] Optionally, obtaining the background color includes:
[0018] Get the picture or video in the current application page;
[0019] The most used color in the picture or video is obtained as the background color.
[0020] Optionally, also include:
[0021] Determining, based on the association relationship, whether the association relationship between the second application and the first application is a bidirectional association relationship;
[0022] If so, when the second application switches the theme, the first application also switches the theme accordingly.
[0023] Optionally, also include:
[0024] Restarting the second application;
[0025] Determining whether there is second theme switching information in the shared configuration file; the second theme switching information is generated based on a second theme switching request for a third application and stored in the shared configuration file;
[0026] If yes, obtaining the second theme switching information, and determining whether the second application is associated with the third application;
[0027] If so, perform theme switching based on the second theme switching information.
[0028] One or more embodiments of this specification provide a method for switching the theme of an application page, including:
[0029] In response to a first theme switching request for a first application, obtaining a pre-built association relationship between the first application and other applications and basic information of a theme to be switched;
[0030] Generate first topic switching information based on the association relationship and the basic information of the topic to be switched;
[0031] The first theme switching information is sent, so that the second application receives and parses the first theme switching information to obtain the association relationship and the basic information of the theme to be switched, and determines whether the second application is associated with the first application based on the association relationship; if so, the second application switches the theme based on the basic information of the theme to be switched.
[0032] Optionally, the association relationship between the first application and other applications is realized through an association identifier.
[0033] Optionally, the method further includes: sending the first theme switching information to the shared configuration file for storage.
[0034] One or more embodiments of the present specification provide a device for switching the theme of an application page, including:
[0035] A receiving module, configured to receive first theme switching information; wherein the first theme switching information is generated and issued based on a first theme switching request for a first application; the first theme switching information includes a pre-built association relationship between the first application and other applications and basic information of the theme to be switched;
[0036] A parsing module, used for parsing the first theme switching information to obtain the association relationship and basic information of the theme to be switched;
[0037] A determination module, configured to determine whether the second application is associated with the first application based on the association relationship;
[0038] The theme switching module is used to switch the theme based on the basic information of the theme to be switched when the judgment result of the judgment module is yes.
[0039] One or more embodiments of the present specification provide a device for switching the theme of an application page, including:
[0040] An acquisition module, configured to, in response to a first theme switching request for a first application, acquire a pre-built association relationship between the first application and other applications and basic information of a theme to be switched;
[0041] A generating module, configured to generate first topic switching information based on the association relationship and basic information of the topic to be switched;
[0042] A sending module is used to send out the first theme switching information, so that the second application receives and parses the first theme switching information to obtain the association relationship and the basic information of the theme to be switched, and determines whether the second application is associated with the first application based on the association relationship; if so, the second application switches the theme based on the basic information of the theme to be switched.
[0043] One or more embodiments of the present specification provide a system for switching themes of an application page, including a device for switching themes of an application page as described in any of the above embodiments and a device for switching themes of an application page as described in any of the above embodiments.
[0044] One or more embodiments of the present specification provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for switching the theme of an application page as described in any of the above embodiments is implemented.
[0045] One or more embodiments of the present specification provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for switching the theme of an application page as described in any of the above embodiments is implemented.
[0046] From the above, it can be seen that the method and related devices for switching the theme of the application page provided in one or more embodiments of the present specification, because the association relationship between the first application and the second application is pre-established, when the first application switches the theme, it will automatically trigger the theme switching of the second application, and change the theme of the second application to the same as the first application without the need for the user or the system to perform additional operations, thereby ensuring that the style of the second application is consistent with that of the first application, and only switching the theme of one application can achieve the theme switching of multiple applications in the same group, making the change of the theme more convenient and flexible. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only one or more embodiments of the present specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 A first flow chart of a method for switching the theme of an application page according to one or more embodiments of this specification;
[0049] Figure 2 A flowchart of performing theme switching based on basic information of the theme to be switched according to one or more embodiments of this specification;
[0050] Figure 3 A schematic diagram of a theme switching color change described in one or more embodiments of this specification;
[0051] Figure 4A second flow chart of the method for switching the subject described in one or more embodiments of this specification;
[0052] Figure 5 A third flow chart of the method for switching the subject described in one or more embodiments of this specification;
[0053] Figure 6 A schematic diagram of the structure of an electronic device used to implement the theme switching method in one or more embodiments of this specification;
[0054] Figure 7 A schematic diagram of the structure of a device for switching the theme of an application page described in one or more embodiments of this specification;
[0055] Figure 8 A schematic diagram of the structure of another device for switching the theme of an application page described in one or more embodiments of this specification;
[0056] Fig. 9 A schematic diagram of the structure of a theme switching system described in one or more embodiments of this specification. DETAILED DESCRIPTION
[0057] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0058] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of this specification should be understood by people with ordinary skills in the field to which this disclosure belongs. The "first", "second" and similar words used in one or more embodiments of this specification do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0059] Traditionally, theme replacement is to read theme package resources to change the corresponding theme of a single application (APP). However, with the development of business, the products delivered now are often a complete set of solutions, such as a complete set of applications. This complete set of applications needs to maintain a unified style and display the corresponding style in different scenarios. Based on existing technologies, each application can only be replaced with a separate theme.
[0060] Based on the above reasons, one or more embodiments of this specification provide a method for switching the theme of an application page, which is implemented by a second application. Figure 1 As shown, the theme switching method of the application page includes:
[0061] Step 101: Receive first theme switching information.
[0062] In this embodiment, the second application receives the first theme switching information. The first theme switching information is generated based on the first theme switching request for the first application, and the first theme switching information includes the pre-built association relationship between the first application and other applications and the basic information of the theme to be switched of the first application. After the first application generates the first theme switching information, it sends the first theme switching information, and then the second application receives the first theme switching information. At the same time, after the first application receives the first theme switching request, it switches the original theme to the theme to be switched based on the basic information of the theme to be switched.
[0063] Among them, the first theme switching request can be initiated by the user or by the system. That is, the first application can generate the first theme switching information in response to the first theme switching request issued by the user, or can generate the first theme switching information in response to the first theme switching request issued by the system. When the first theme switching request is initiated by the user, the first theme switching request is generated according to the user's theme switching operation on the first application; when the first theme switching request is initiated by the system, for example, during a certain festival, the theme corresponding to the festival is automatically changed according to the system settings, and the first theme switching request is generated according to the triggering of the system conditions.
[0064] Before switching the theme, a set of associations between applications is first constructed. That is, the association between the first application and other applications is used to indicate whether the first application and other applications have a relationship of theme linkage switching; if the first application has an association with a certain application, when the first application switches the theme, the application can be triggered to switch the theme; if the first application has no association with a certain application, even if the first application switches the theme, the application will not be triggered to switch the theme.
[0065] The basic information of the theme to be switched includes but is not limited to the path of the theme to be switched. When the first application receives the first theme switching request, the first application can switch the theme to the theme to be switched based on the basic information of the theme to be switched. Other applications that have an associated relationship with the first application can also obtain the path of the theme to be switched according to the basic information of the theme to be switched, obtain the theme to be switched of the first application from it, and switch the original theme to the same as that of the first application, that is, switch to the theme to be switched of the first application, so that a whole set of associated applications, i.e., the whole family of applications, maintain a consistent style.
[0066] Optionally, after the first application generates the first theme switching information, the first theme switching information can be sent to certain designated applications, such as associated applications, according to pre-set rules; the first theme switching information can also be sent to all applications, such as by calling a system broadcast to send the first theme switching information to all applications in the same system; if necessary, the first theme switching information can also be sent to other applications in different systems.
[0067] Step 103: parse the first theme switching information to obtain the association relationship and basic information of the theme to be switched.
[0068] After receiving the first theme switching information, the second application performs analysis to obtain the association relationship contained in the first theme switching information and basic information of the theme to be switched.
[0069] Step 105: determine whether the second application is associated with the first application based on the association relationship.
[0070] After the second application obtains the pre-built association relationship between the first application and other applications, it can determine whether the association relationship includes the relationship between the second application and the first application. If so, it means that the second application is associated with the first application; otherwise, it means that the second application is not associated with the first application.
[0071] Optionally, a unified association identifier may be used to represent the association relationship between the first application and other applications, that is, a unified association identifier is pre-generated to represent the association relationship between the first application and other applications, and is stored in the first application and other applications associated therewith.
[0072] When the first application receives the first theme switching request, it obtains the association identifier corresponding to the first application, generates and sends the first theme switching information based on the association identifier. After the second application receives and parses the first theme switching information to obtain the association identifier, it can determine whether the second application is associated with the first application based on the association identifier.
[0073] Step 107: If yes, then switch the theme based on the basic information of the theme to be switched.
[0074] If the second application is associated with the first application, the second application obtains the path of the theme to be switched from the basic information of the theme to be switched, and finds the resources of the theme to be switched based on the path to switch the theme, thereby switching the theme to the theme to be switched of the first application, ensuring the consistency of the theme style of the second application and the first application. If the second application is not associated with the first application, the second application will not switch the theme.
[0075] In this embodiment, the association relationship is not limited to between two applications, but can also be between multiple applications. For example, the first application not only has an association relationship with the second application, but can also have an association relationship with other applications such as the fifth application. At this time, if the first application switches the theme, the second application and the fifth application can also switch the theme.
[0076] In the above embodiment, since the association relationship between the first application and the second application is pre-constructed, when the first application switches the theme, it will automatically trigger the theme switch of the second application, and switch the theme of the second application to the same as the first application without the need for the user or the system to perform additional operations, thereby ensuring that the style of the second application is consistent with that of the first application, and only by switching the theme of one application, it is possible to switch the themes of multiple applications in the same group, making the change of the theme more convenient and flexible.
[0077] At the same time, the theme configuration files in the prior art are all static resource files, in which the theme color and other contents are fixed. This results in that when switching themes, the new theme is not compatible with the original content of the application. For example, the text content on the application page is close to or even the same as the theme color, resulting in unclear text content, and the color of the text, picture, video and other content is not harmonious with the theme color (for example, contrast color difference). This requires that the page content can be adaptively adjusted when switching the theme.
[0078] Based on the above reasons, Figure 2 As shown, the switching of themes based on the basic information of the to-be-switched themes in step 107 includes:
[0079] Step 201, obtaining a theme switching color according to basic information of the theme to be switched.
[0080] After the second application obtains the basic information of the theme to be switched, it obtains the path of the theme to be switched from the basic information of the theme to be switched, and obtains the theme resource of the theme to be switched based on the path, wherein the theme resource of the theme to be switched may include theme switching color, theme switching background, theme switching pattern, etc. At the same time, the theme switching color is obtained from the theme resource of the theme to be switched.
[0081] Step 203: determine whether any application page of the second application needs to change the theme switching color.
[0082] According to preset rules, it is determined whether any application page needs to change the original theme switching color of the theme to be switched. The judgment conditions may include: if the text, pictures, videos and other content of the application page are similar to or even the same as the theme switching color, resulting in the text, pictures, videos and other content being unable to be distinguished from the theme switching color, then the theme switching color needs to be changed to highlight the text, pictures, videos and other content.
[0083] In a specific embodiment, Figure 3 As shown, a certain application page includes multiple shortcut icons, and each shortcut icon is set off by a background color. The background color is a value close to the primary color of the corresponding shortcut icon, and each background color is different. At this time, if the theme color of the application page is similar to or even the same as the background color of any shortcut icon, this will lead to a poor contrast between the shortcut and the theme color, and the compatibility will be very poor for the need to switch themes. At this time, the theme switching color needs to be changed when switching themes.
[0084] Step 205: If yes, generate an adaptive color according to the theme switching color, and modify the theme color of the current application page to the adaptive color; otherwise, modify the theme color of the current application page to the theme switching color.
[0085] When it is determined that the theme switching color needs to be changed, an adaptive color is generated according to the theme switching color, and then the theme color of the current application page is modified to the adaptive color. Among them, the adaptive color generation process includes: obtaining a background color, and obtaining an adaptive color according to the theme switching color, the background color, and a preset offset value, and the offset value can range from 0 to 1.0. The background color can be obtained by obtaining the content such as pictures or videos in the current application page, and obtaining the most used color in the picture or video as the background color. When there are multiple pictures or videos in the application page, a background color can be obtained from one picture or video, or multiple background colors can be obtained from multiple pictures or videos, and then multiple background colors and the theme switching color are calculated to obtain an adaptive color. For example, in the above embodiment, the background color of a shortcut icon can be selected as the background color, or the background colors of multiple or even all shortcut icons can be selected as the background color.
[0086] In the above embodiment, by dynamically changing the theme switching color in the theme to be switched, when the theme switching color of the application page is close to the original content color and the contrast is poor, the theme switching color can be dynamically modified by obtaining the adaptive color, thereby greatly improving the compatibility of the theme.
[0087] In one or more embodiments of the present specification, the theme switching method further includes: judging whether the association relationship between the second application and the first application is a bidirectional association relationship based on the association relationship. In this embodiment, the association relationship can be a bidirectional association relationship or a unidirectional association relationship. For example, when the relationship between the first application and the second application is a bidirectional association relationship, the first application can trigger the second application to switch the theme when the first application switches the theme, and the first application also switches the theme accordingly when the second application switches the theme. When the relationship between the first application and the second application is not a bidirectional association relationship but a unidirectional association relationship, the theme switch for the first application can trigger the theme switch for the second application, but the theme switch for the second application cannot trigger the theme switch for the first application.
[0088] At the same time, the same application can have multiple associations, and the multiple associations can be set to be isolated from each other or to affect each other. For example, there is a bidirectional association A between application A and application B, and a unidirectional association B between application A and application C (where application A can trigger the theme switch of application C when it switches the theme). At this time, the theme switch for application A can trigger the theme switch of application B and application C. When the theme switch is for application B, since there is a bidirectional association between application B and application A, application A will also switch the theme. At this time, if the bidirectional association A and the unidirectional association B affect each other, application C will also switch the theme; and if the bidirectional association A and the unidirectional association B are isolated from each other, application C will not switch the theme. In actual use, the associations between applications can be flexibly set according to actual needs to meet actual usage needs.
[0089] In other embodiments of this specification, Figure 4 As shown, the theme switching method also includes:
[0090] Step 301: restart the second application.
[0091] Step 303: determine whether there is second theme switching information in the shared configuration file; the second theme switching information is generated based on a second theme switching request for a third application and stored in the shared configuration file.
[0092] In this embodiment, when the third application switches the theme, the second application is not in operation when the second theme switching information generated by the third application is sent, and the second application cannot receive the second theme switching information. Therefore, the third application not only sends the second theme switching information through system broadcast, but also stores the second theme switching information in the shared configuration file. When the second application is started, it first checks the shared configuration file to determine whether it has the second theme switching information, so as to determine whether it needs to switch the theme.
[0093] Among them, the shared configuration file can be used to store basic information of multiple applications with the same association relationship, including the current theme information of each application, the association information between other applications, etc. In addition, a timestamp is also set in the shared configuration file. If the timestamp changes, it proves that an application has updated the theme. At this time, other non-running applications with the same association relationship detect the change of the timestamp when starting, and then obtain the theme switching information from the shared configuration file to switch the theme. For example, in this embodiment, since the association relationship between the third application and the second application is pre-constructed, the corresponding shared configuration file is used to store the current theme information of the third application and the second application. Since the second application is not running when the third application sends the second theme switching information, it cannot receive the second theme switching information, but the second theme switching information is stored in the corresponding shared configuration file, so that the timestamp in the shared configuration file changes. When the second application is started next time, it detects that the timestamp in the corresponding shared configuration file has changed, and it is considered that the second theme switching information exists in the shared configuration file. Optionally, the third application in this embodiment can be the first application, which can achieve the same function as the first application.
[0094] Step 305: If yes, obtain the second theme switching information and determine whether the second application is associated with the third application.
[0095] After receiving the second theme switching information, the second application parses it to obtain the association relationship contained in the second theme switching information and basic information of the theme to be switched of the third application, and then determines whether the second application is associated with the third application based on the association relationship contained in the second theme switching information.
[0096] Step 307: If yes, perform theme switching based on the second theme switching information.
[0097] If the second application and the third application are associated with each other, the second application switches the theme according to the basic information of the theme to be switched of the third application obtained from the second theme switching information.
[0098] In this embodiment, since the association relationship between the third application and the second application is pre-built, when the third application switches the theme, it will automatically trigger the theme switching of the second application. However, since the second application is not running when the third application switches the theme, it cannot obtain the second theme switching information sent by the third application, so the second theme switching information is stored in the shared configuration file, and when the second application is started, the second theme switching information is obtained from the shared configuration file to switch the theme, so that the user or the system does not need to perform additional operations, ensuring that the style of the second application and the third application is consistent, and only the operation of switching the theme of one application can achieve the theme switching of multiple applications in the same group, making the change of the theme more convenient and flexible.
[0099] In the above embodiment, when the first application, the second application and the third application switch the theme, they take over the management class of resources processed by LayoutInflater.Factory, then generate a theme package that needs to replace resources, read the resource file of the theme package through AssetManager and hand it over to LayoutInflater.Factory to reload new resources, thereby realizing the switching and updating of the theme.
[0100] One or more embodiments of the present specification also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for switching the theme of an application page as described in any one of the above embodiments is implemented.
[0101] One or more embodiments of the present specification provide a method for switching the theme of an application page, which is implemented by a first application. Figure 5 As shown, the theme switching method of the application page includes:
[0102] Step 401: In response to a first theme switching request for a first application, obtain pre-built associations between the first application and other applications and basic information of the theme to be switched.
[0103] In this embodiment, the first theme switching request may be initiated by the user or by the system. When the first theme switching request is initiated by the user, the first theme switching request is generated according to the user's theme switching operation on the first application; when the first theme switching request is initiated by the system, for example, during the National Day, the theme corresponding to the National Day style is automatically changed according to the system setting, and the first theme switching request is generated according to the triggering of the system condition.
[0104] The basic information of the theme to be switched includes but is not limited to the path of the theme to be switched. When the first application receives the first theme switching request, the first application can switch the theme to the theme to be switched based on the basic information of the theme to be switched.
[0105] Optionally, the association relationship between the first application and other applications is realized through an association marker. Each association marker can represent a set of association relationships, so multiple association markers can be used to represent multiple sets of association relationships. That is, in this embodiment, one association marker can be stored on the first application, or multiple association markers can be stored. For example, association marker A can be used to represent the relationship between the first application and the second application, and association marker B can be used to represent the relationship between the first application and the fourth application. At the same time, different association markers can be used to represent different types of association relationships. For example, association marker A is used to represent a bidirectional association relationship between the first application and the second application. At this time, if the theme switch performed by the first application triggers the theme switch of the second application, and the theme switch of the second application also triggers the theme switch of the first application; association marker B is used to represent a unidirectional association relationship between the first application and the fourth application. At this time, if the theme switch performed by the first application triggers the theme switch of the fourth application, but the theme switch of the fourth application does not trigger the theme switch of the first application.
[0106] Step 403: Generate first theme switching information based on the association relationship and the basic information of the theme to be switched.
[0107] Step 405, sends the first theme switching information, enables the second application to receive and parse the first theme switching information to obtain the association relationship and the basic information of the theme to be switched, and determines whether the second application is associated with the first application based on the association relationship; if so, enables the second application to switch the theme based on the basic information of the theme to be switched.
[0108] Optionally, in step 405, enabling the second application to switch the theme based on the basic information of the theme to be switched includes:
[0109] Acquire a theme switching color according to the basic information of the theme to be switched;
[0110] Determine whether any application page of the second application needs to change the theme switching color;
[0111] If so, an adaptive color is generated according to the theme switching color, and the theme color of the current application page is modified to the adaptive color; otherwise, the theme color of the current application page is modified to the theme switching color.
[0112] Among them, generating the adaptive color according to the theme switching color includes: obtaining the picture or video in the current application page; obtaining the most used color in the picture or video as the background color; and obtaining the adaptive color according to the theme switching color, the background color and a preset offset value.
[0113] Optionally, after generating the first theme switching information, the first application also sends the first theme switching information to the shared configuration file for storage. In this way, when the first application sends the first theme switching information through system broadcast, if the second application does not receive the first theme switching information because it is not running, it can wait until the second application is restarted and then obtain the first theme switching information from the shared configuration file. The specific steps are as follows:
[0114] Step 501: restart the second application.
[0115] Step 503: Determine whether there is first theme switching information in the shared configuration file.
[0116] Step 505: If yes, obtain the first theme switching information and determine whether the second application is associated with the first application.
[0117] Step 507: If yes, perform theme switching based on the first theme switching information.
[0118] In this embodiment, when the first application switches the theme, the second application is not in operation when the first theme switching information generated by the first application is sent. At this time, the second application cannot receive the first theme switching information. Therefore, the first application not only sends the first theme switching information through system broadcast, but also stores the first theme switching information in the shared configuration file. When the second application is started, it first checks the shared configuration file to determine whether it has the first theme switching information, so as to determine whether it needs to switch the theme.
[0119] The shared configuration file stores the current theme information, association relationship, timestamp, etc. of the first application and the second application. Since the second application is not running when the first application sends the first theme switching information, it cannot receive the first theme switching information. However, the first theme switching information is stored in the corresponding shared configuration file, which changes the timestamp in the shared configuration file. When the second application is started next time, if it detects that the timestamp in the corresponding shared configuration file has changed, it will be considered that the first theme switching information exists in the shared configuration file, and then the second application will obtain the first theme switching information from the shared configuration file, thereby realizing the theme switching of the second application.
[0120] One or more embodiments of the present specification also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for switching the theme of an application page as described in any one of the above embodiments is implemented.
[0121] Figure 6 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0122] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0123] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0124] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0125] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0126] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0127] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0128] One or more embodiments of the present specification also provide a method for switching the theme of an application page, including:
[0129] Step 601, the user or system initiates a first theme switching request to the first application, the first application obtains the basic information of the theme to be switched and the pre-built association relationship between the first application and other applications stored on the first application, and generates the first theme switching information based on the basic information of the theme to be switched and the association relationship.
[0130] Step 602: The first application invokes a system broadcast to send out first theme switching information, and stores the first theme switching information in a shared configuration file.
[0131] Step 603, if the second application is in running state when the first application sends the first theme switching information, the first theme switching information is directly received; if the second application is not in running state when the first application sends the first theme switching information, the first theme switching information is obtained from the shared configuration file when the second application is started.
[0132] Step 603: The second application parses the first theme switching information, and obtains the association relationship and basic information of the theme to be switched from the first theme switching information.
[0133] Step 604, the second application determines whether it has an association relationship with the first application according to the parsed association relationship;
[0134] Step 605, if yes, obtain the path of the theme to be switched from the basic information of the theme to be switched, obtain the resources of the theme to be switched according to the path of the theme to be switched, and update the second application to be the same as the first application; otherwise, if the second application has no association with the first application, the first theme switching information can be directly discarded.
[0135] One or more embodiments of the present specification also provide a theme switching device for an application page, such as Figure 7As shown, the theme switching device of the application page includes:
[0136] The receiving module 11 is used to receive first theme switching information; wherein, the first theme switching information is generated and issued based on a first theme switching request for a first application; the first theme switching information includes a pre-built association relationship between the first application and other applications and basic information of the theme to be switched.
[0137] The parsing module 12 is used to parse the first theme switching information to obtain the association relationship and basic information of the theme to be switched.
[0138] The judgment module 13 is used to judge whether the second application is associated with the first application based on the association relationship.
[0139] The theme switching module 14 is used to switch the theme based on the basic information of the theme to be switched when the judgment result of the judgment module is yes.
[0140] Optionally, the theme switching module 14 is further used to implement:
[0141] Acquire a theme switching color according to the basic information of the theme to be switched;
[0142] Determine whether any of the application pages of the second application needs to change the theme switching color;
[0143] If so, an adaptive color is generated according to the theme switching color, and the theme color of the current application page is modified to the adaptive color; otherwise, the theme color of the current application page is modified to the theme switching color.
[0144] The association relationship between the first application and other applications is realized through an association identifier.
[0145] Wherein, the first theme switching information is sent out through system broadcast.
[0146] The generating of the adaptive color according to the theme switching color includes: acquiring a background color; and obtaining the adaptive color according to the theme switching color, the background color and a preset offset value.
[0147] The acquisition of the background color includes: acquiring a picture or video in the current application page; and acquiring the most used color in the picture or video as the background color.
[0148] Optionally, also include:
[0149] Based on the association relationship, it is determined whether the association relationship between the second application and the first application is a bidirectional association relationship; if so, when the second application switches the theme, the first application also switches the theme accordingly.
[0150] Optionally, also include:
[0151] Restarting the second application;
[0152] Determining whether there is second theme switching information in the shared configuration file; the second theme switching information is generated based on a second theme switching request for a third application and stored in the shared configuration file;
[0153] If yes, obtaining the second theme switching information, and determining whether the second application is associated with the third application;
[0154] If so, perform theme switching based on the second theme switching information.
[0155] For the convenience of description, the above devices are described in terms of functions divided into various modules. Of course, when implementing one or more embodiments of this specification, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0156] The apparatus of the above-mentioned embodiment is used to implement the corresponding method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0157] One or more embodiments of the present specification also provide a theme switching device for an application page, such as Figure 8 As shown, the theme switching device of the application page includes:
[0158] The acquisition module 21 is used to obtain the pre-built association relationship between the first application and other applications and basic information of the theme to be switched in response to the first theme switching request for the first application.
[0159] The generating module 22 is used to generate first theme switching information based on the association relationship and the basic information of the theme to be switched.
[0160] The sending module 23 is used to send the first theme switching information, so that the second application receives and parses the first theme switching information to obtain the association relationship and the basic information of the theme to be switched, and determines whether the second application is associated with the first application based on the association relationship; if so, the second application switches the theme based on the basic information of the theme to be switched.
[0161] Optionally, enabling the second application to switch the theme based on the basic information of the theme to be switched includes:
[0162] Acquire a theme switching color according to the basic information of the theme to be switched;
[0163] Determine whether any application page of the second application needs to change the theme switching color;
[0164] If so, an adaptive color is generated according to the theme switching color, and the theme color of the current application page is modified to the adaptive color; otherwise, the theme color of the current application page is modified to the theme switching color.
[0165] Among them, generating the adaptive color according to the theme switching color includes: obtaining the picture or video in the current application page; obtaining the most used color in the picture or video as the background color; and obtaining the adaptive color according to the theme switching color, the background color and a preset offset value.
[0166] The association relationship between the first application and other applications is realized through an association identifier.
[0167] Wherein, the first theme switching information is sent to the shared configuration file for storage.
[0168] Wherein, the first theme switching information is sent out through system broadcast.
[0169] For the convenience of description, the above devices are described in terms of functions divided into various modules. Of course, when implementing one or more embodiments of this specification, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0170] The apparatus of the above-mentioned embodiment is used to implement the corresponding method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0171] One or more embodiments of this specification also provide a theme switching system for an application page, such as Fig. 9 As shown, it includes the application page theme switching device 90 as described in any of the above embodiments and the application page theme switching device 91 as described in any of the above embodiments.
[0172] The system of the above embodiment includes the corresponding device in the above embodiment and has the beneficial effects of the corresponding device embodiment, which will not be described in detail here.
[0173] It should be noted that the method of one or more embodiments of this specification can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of one or more embodiments of this specification, and the multiple devices will interact with each other to complete the described method.
[0174] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0175] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. In line with the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present specification as described above, which are not provided in detail for the sake of simplicity.
[0176] In addition, to simplify the description and discussion, and in order not to obscure one or more embodiments of the present specification, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device may be shown in the form of a block diagram so as to avoid obscuring one or more embodiments of the present specification, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which one or more embodiments of the present specification will be implemented (i.e., these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that one or more embodiments of the present specification may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0177] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0178] One or more embodiments of this specification are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification should be included in the scope of protection of this disclosure.
Claims
1. A method for switching the theme of an application page, characterized in that: include: Receive first theme switching information; wherein the first theme switching information is generated and issued based on a first theme switching request for a first application; the first theme switching information includes a pre-built association relationship between the first application and other applications and basic information of the theme to be switched, and the association relationship between the first application and other applications is realized by an association marker; Parsing the first topic switching information to obtain the association relationship and basic information of the topic to be switched; Determining whether the second application is associated with the first application based on the association relationship; If yes, switching the theme is performed based on the basic information of the theme to be switched; The switching of themes based on the basic information of the to-be-switched theme includes: obtaining a theme switching color according to the basic information of the to-be-switched theme; determining whether any application page of the second application needs to change the theme switching color; if so, generating an adaptive color according to the theme switching color, and modifying the theme color of the current application page to the adaptive color; otherwise, modifying the theme color of the current application page to the theme switching color; The generating of the adaptive color according to the theme switching color includes: acquiring a background color; and obtaining the adaptive color according to the theme switching color, the background color, and a preset offset value.
2. The theme switching method according to claim 1, characterized in that: The acquisition of the background color includes: Get the picture or video in the current application page; The most used color in the picture or video is obtained as the background color.
3. The theme switching method according to claim 1, characterized in that: Also includes: Determining, based on the association relationship, whether the association relationship between the second application and the first application is a bidirectional association relationship; If so, when the second application switches the theme, the first application also switches the theme accordingly.
4. The theme switching method according to claim 1, characterized in that: Also includes: Restarting the second application; Determine whether there is second theme switching information in the shared configuration file; The second theme switching information is generated based on a second theme switching request for a third application and stored in the shared configuration file; If yes, obtaining the second theme switching information, and determining whether the second application is associated with the third application; If so, perform theme switching based on the second theme switching information.
5. A method for switching the theme of an application page, characterized in that: include: In response to a first theme switching request for a first application, obtaining a pre-built association relationship between the first application and other applications and basic information of the theme to be switched, wherein the association relationship between the first application and other applications is realized by an association identifier; Generate first topic switching information based on the association relationship and the basic information of the topic to be switched; Sending the first theme switching information, causing the second application to receive and parse the first theme switching information to obtain the association relationship and basic information of the theme to be switched, and judging whether the second application is associated with the first application based on the association relationship; if so, causing the second application to switch the theme based on the basic information of the theme to be switched; The enabling the second application to switch the theme based on the basic information of the theme to be switched includes: enabling the second application to obtain the theme switching color according to the basic information of the theme to be switched; determining whether any application page of the second application needs to change the theme switching color; if so, enabling the second application to generate an adaptive color according to the theme switching color, and modifying the theme color of the current application page to the adaptive color; otherwise, modifying the theme color of the current application page to the theme switching color; The generating of the adaptive color according to the theme switching color includes: acquiring a background color; and obtaining the adaptive color according to the theme switching color, the background color, and a preset offset value.
6. The method for switching the theme according to claim 5, characterized in that: Also includes: The first theme switching information is sent to a shared configuration file for storage.
7. A device for switching the theme of an application page, characterized in that: include: A receiving module, configured to receive first theme switching information; wherein the first theme switching information is generated and issued based on a first theme switching request for a first application; the first theme switching information includes a pre-built association relationship between the first application and other applications and basic information of the theme to be switched, and the association relationship between the first application and other applications is realized through an association marker; A parsing module, used for parsing the first theme switching information to obtain the association relationship and basic information of the theme to be switched; A determination module, configured to determine whether the second application is associated with the first application based on the association relationship; A theme switching module, configured to switch the theme based on the basic information of the theme to be switched when the judgment result of the judgment module is yes; The switching of themes based on the basic information of the to-be-switched theme includes: obtaining a theme switching color according to the basic information of the to-be-switched theme; determining whether any application page of the second application needs to change the theme switching color; if so, generating an adaptive color according to the theme switching color, and modifying the theme color of the current application page to the adaptive color; otherwise, modifying the theme color of the current application page to the theme switching color; The generating of the adaptive color according to the theme switching color includes: acquiring a background color; and obtaining the adaptive color according to the theme switching color, the background color, and a preset offset value.
8. A device for switching the theme of an application page, characterized in that: include: an acquisition module, configured to, in response to a first theme switching request for a first application, acquire a pre-built association relationship between the first application and other applications and basic information of the theme to be switched, wherein the association relationship between the first application and other applications is realized by an association identifier; A generating module, configured to generate first topic switching information based on the association relationship and basic information of the topic to be switched; a sending module, configured to send the first theme switching information, so that the second application receives and parses the first theme switching information to obtain the association relationship and the basic information of the theme to be switched, and determines whether the second application is associated with the first application based on the association relationship; if so, the second application switches the theme based on the basic information of the theme to be switched; The enabling the second application to switch the theme based on the basic information of the theme to be switched includes: enabling the second application to obtain the theme switching color according to the basic information of the theme to be switched; determining whether any application page of the second application needs to change the theme switching color; if so, enabling the second application to generate an adaptive color according to the theme switching color, and modifying the theme color of the current application page to the adaptive color; otherwise, modifying the theme color of the current application page to the theme switching color; The generating of the adaptive color according to the theme switching color includes: acquiring a background color; and obtaining the adaptive color according to the theme switching color, the background color, and a preset offset value.
9. A theme switching system for an application page, characterized in that: include: The device for switching the theme of an application page as claimed in claim 7 and the device for switching the theme of an application page as claimed in claim 8.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for switching the theme of the application page according to any one of claims 1 to 4 is implemented.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for switching the theme of the application page as described in any one of claims 5 to 6 is implemented.
