Skin changing method and device, electronic equipment and storage medium

By obtaining the target skin package and replacing the native controls, combined with the dynamic refresh function, the problem of heavy workload of application theme skin change development in the existing technology is solved, and the convenience of user-defined skin and efficient dynamic refresh effect are achieved.

CN118778957APending Publication Date: 2024-10-15SHENZHEN LANYOU TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410777197.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

In the existing technology, theme changing of applications requires modification of code and resource files, which increases development workload and maintenance costs, and makes it difficult to achieve the convenience of user-defined skins.

Method used

By obtaining the target skin package, monitoring the life cycle, replacing the native control with the skinning control, and enabling the dynamic refresh function based on the skinning configuration information, one-click skinning and dynamic skin refreshing are achieved, reducing development workload.

Benefits of technology

It realizes the convenience of user-customized skins, improves user experience, reduces development workload, and can instantly display new skin effects without modifying the original code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118778957A_ABST
    Figure CN118778957A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a skin changing method and device, electronic equipment and a storage medium, and belongs to the technical field of electronic equipment. The method comprises the steps of obtaining a target skin package; monitoring a life cycle; when a life cycle signal created by the window is monitored, replacing the native control with a skin changing control; acquiring skin changing configuration information; and if the skin changing configuration information comprises the enabling information of the dynamic refreshing function, applying the target skin changing resource through the skin changing control. According to the embodiment of the invention, the one-key skin changing function can be realized without modifying the original code, the development workload is reduced, the dynamic refreshing of the skin is supported, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic equipment, and in particular to a skin changing method and device, electronic equipment and storage medium. Background Art

[0002] As the performance of electronic device hardware continues to improve, software developers and designers are able to create more complex and powerful applications. Applications enhance user experience through exquisite interface design and user experience (UX / UI) design. Application theme skinning is an important part of user customization. In order to cater to the aesthetics and needs of different users, many applications have begun to provide the function of customizing skins so that users can switch styles according to their preferences.

[0003] Most skinning solutions in related technologies require modifying the application code and resource files and performing secondary development on the application, which increases the workload and maintenance costs.

[0004] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention

[0005] The main purpose of the embodiments of the present application is to provide a skinning method and device, an electronic device and a storage medium, aiming to reduce development workload and improve user experience.

[0006] To achieve the above object, one aspect of an embodiment of the present application provides a skinning method, the method comprising the following steps:

[0007] Get the Target Skin Pack;

[0008] Monitor life cycle;

[0009] When listening to the life cycle signal of window creation, replace the native control with the skin control;

[0010] Get skinning configuration information;

[0011] If the skinning configuration information includes activation information of a dynamic refresh function, a target skinning resource is applied through the skinning control, and the target skinning resource is obtained by parsing the target skin package.

[0012] In some embodiments, the method further comprises:

[0013] In response to the first instruction, determining a target skin in the skin changing interface;

[0014] The path information of the target skin package is determined according to the target skin.

[0015] In some embodiments, obtaining the target skin package includes:

[0016] Get the skinning resource strategy.

[0017] In some embodiments, the obtaining of the target skin package further includes:

[0018] If the skin-changing resource strategy includes a dynamic delivery strategy, the target skin package is obtained from the corresponding server according to the path information.

[0019] In some embodiments, the obtaining of the target skin package further includes:

[0020] If the skinning resource strategy includes a built-in skinning strategy, the target skin package is obtained from the application package according to the path information.

[0021] In some embodiments, the method further comprises:

[0022] When monitoring the onActivityCreated life cycle, the target skin factory is used to replace the native skin factory.

[0023] In some embodiments, when a lifecycle signal of window creation is monitored, replacing the native control with a skinnable control includes:

[0024] When the life cycle signal of window creation is monitored, the native control is replaced with the skinned control through the target skinning factory.

[0025] To achieve the above-mentioned purpose, another aspect of the embodiment of the present application provides a skin changing device, the device comprising:

[0026] Skinnable controls;

[0027] Configuration acquisition module, used to obtain skinning configuration information;

[0028] The resource application module is used to apply the target skinning resource through the skinning control if the skinning configuration information includes activation information of the dynamic refresh function, and the target skinning resource is obtained by parsing the target skin package.

[0029] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.

[0030] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0031] The embodiments of the present application include at least the following beneficial effects: the present application provides a skin changing method and device, an electronic device and a storage medium, which realizes user customization of the skin and improves the user experience by obtaining the target skin package; monitors the life cycle; when the life cycle signal of window creation is monitored, the native control is replaced with the skin changing control; obtains the skin changing configuration information; if the skin changing configuration information includes the enabling information of the dynamic refresh function, the target skin changing resource is applied through the skin changing control, which reduces the development workload, and can realize the one-click skin changing function without modifying the original code, and realizes the dynamic refresh of the skin, and can instantly display the new skin effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 is a flow chart of a skin changing method provided in an embodiment of the present application;

[0033] Figure 2 yes Figure 1 Flow chart of step S101 in FIG.

[0034] Figure 3 It is a flowchart of the monitoring life cycle provided by the embodiment of the present application;

[0035] Figure 4 yes Figure 3 Flow chart of step S304 in FIG.

[0036] Figure 5 yes Figure 4 Flow chart of step S403 in FIG.

[0037] Figure 6 is another flow chart of the skin changing method provided in the embodiment of the present application;

[0038] Figure 7 yes Figure 6 Flow chart of step S604 in FIG.

[0039] Figure 8 is another flow chart of the skin changing method provided in the embodiment of the present application;

[0040] Fig. 9 is a schematic diagram of a replacement control provided in an embodiment of the present application;

[0041] Fig.10 This is a schematic diagram of obtaining a skinning resource package provided in an embodiment of the present application;

[0042] Fig.11 This is a schematic diagram of the comparison before and after skin replacement provided in the embodiment of the present application;

[0043] Fig.12 is a schematic diagram of the structure of the skin changing system provided in an embodiment of the present application;

[0044] Fig.13 is a schematic diagram of the structure of a skin-changing device provided in an embodiment of the present application;

[0045] Fig.14 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0047] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0048] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0050] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.

[0051] 1) Skin package is a collection of replaceable appearances specific to a certain application or product. A skin package can contain various resource files, such as pictures, color configurations, layout files, etc., which are used to change the interface appearance of an application or product.

[0052] As the performance of electronic device hardware continues to improve, software developers and designers are able to create more complex and powerful applications. Applications enhance user experience through exquisite interface design and user experience (UX / UI) design. Application theme skinning is an important part of user customization. In order to cater to the aesthetics and needs of different users, many applications have begun to provide the function of customizing skins so that users can switch styles according to their preferences.

[0053] Most skinning solutions in related technologies require modifying the application code and resource files and performing secondary development on the application, which increases the workload and maintenance costs.

[0054] In summary, the technical problems existing in the relevant technologies need to be improved.

[0055] In view of this, a skinning method, device, equipment and medium are provided in the embodiments of the present application. The scheme realizes user customization of the skin and improves the user experience by obtaining the target skin package; monitors the life cycle; when the life cycle signal of window creation is monitored, the native control is replaced with the skinning control; obtains the skinning configuration information; if the skinning configuration information includes the enabling information of the dynamic refresh function, the target skinning resource is applied through the skinning control, which reduces the development workload and realizes the one-click skinning function without modifying the original code, and realizes the dynamic refresh of the skin, and can instantly display the new skin effect.

[0056] The skin-changing method provided in the embodiment of the present application relates to the technical field of electronic equipment. The skin-changing method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server, or can be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms and other basic cloud computing services. The server can also be a node server in the blockchain network; the software can be an application that implements the skin-changing method, etc., but is not limited to the above forms.

[0057] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0058] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0059] Figure 1 is an optional flow chart of the skin changing method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S105.

[0060] Step S101, obtaining a target skin package.

[0061] Specifically, the target skin package is determined by the user, and the target skin package supports user customization.

[0062] In some embodiments, in response to the first instruction, the target skin is determined in the skinning interface; and the path information of the target skin package is determined according to the target skin. The first instruction is triggered when the user selects, checks or clicks the target skin, and the first instruction is used to determine the target skin and then determine the path information of the target skin package.

[0063] Furthermore, a skin-changing resource strategy is obtained. If the skin-changing resource strategy includes a dynamic delivery strategy, a target skin package is obtained from a corresponding server according to the path information.

[0064] If the skinning resource strategy includes a built-in skinning strategy, the target skin package is obtained from the application package according to the path information.

[0065] In some embodiments, the target skin package is obtained according to the path information, the target skin package is parsed, and the target skinning resource is obtained according to the name, type, etc. of the skin package, wherein the target skinning resource includes a layout file, a picture, and a color configuration file.

[0066] Optionally, the target skin package may be acquired and parsed to obtain the target skin-changing resource; or the target skin package may be acquired first, and then the skin package may be parsed when the skin-changing logic is executed to obtain the target skin-changing resource.

[0067] In this embodiment, the target skin package is obtained to prepare for the subsequent skinning operation.

[0068] Step S102, monitoring the life cycle.

[0069] In some embodiments, a lifecycle listener is implemented in the application to listen to required lifecycle events, such as window creation and Activity creation.

[0070] Optionally, perform more fine-grained lifecycle monitoring, such as monitoring the lifecycle of a Fragment.

[0071] In this embodiment, by monitoring the life cycle, the skinning operation can be performed at an appropriate time, thereby achieving a good integration of the skinning function with the life cycle of the application.

[0072] Step S103: When a window creation lifecycle signal is monitored, the native control is replaced with a skin-changing control.

[0073] Specifically, the skinning control is used to apply the target skinning resource.

[0074] In some embodiments, when a lifecycle signal of window creation is monitored, a native control that needs to be skinned is found in the layout and replaced with a special control with skinning function.

[0075] In this embodiment, when the life cycle signal of window creation is monitored, the native control is replaced with a skin-changing control, so that all controls that need to be skinned in the application can be correctly replaced with controls with skinning function, thereby improving the skinning effect and enhancing the user experience.

[0076] Step S104, obtaining skinning configuration information.

[0077] Specifically, the skinning configuration information includes activation information of the dynamic refresh function or deactivation information of the dynamic refresh function.

[0078] In some embodiments, skinning configuration information is obtained, and it is determined whether the skinning configuration information includes activation information of a dynamic refresh function.

[0079] In this embodiment, skinning configuration information is obtained to prepare for the subsequent application of target skinning resources.

[0080] Step S105: if the skinning configuration information includes activation information of the dynamic refresh function, the target skinning resource is applied through the skinning control.

[0081] Specifically, the target skinning resource is obtained by parsing the target skin package.

[0082] In some embodiments, whether to implement dynamic refreshing of skinning is determined according to enabling information of the dynamic refreshing function in the skinning configuration information.

[0083] If the skinning configuration information includes activation information of the dynamic refresh function, the target skinning resource is immediately applied through the skinning control.

[0084] In some embodiments, if the skinning configuration information includes information for closing the dynamic refresh function, the target skinning resource is applied by the skinning control when it is opened next time.

[0085] Optionally, support dynamic refresh strategies for different interfaces in custom applications to meet the refresh requirements of different interfaces.

[0086] In this embodiment, if the skin-changing configuration information includes the enabling information of the dynamic refresh function, the target skin-changing resource is applied through the skin-changing control without modifying the original code. The one-click skin-changing function is realized through the skin-changing control. The dynamic refresh of the skin is supported. The interface can be dynamically refreshed during the skin-changing, and the new skin effect can be displayed instantly, thereby improving the user experience.

[0087] Steps S101 to S105 shown in the embodiment of the present application enable user customization of the skin and improve user experience by acquiring the target skin package; monitoring the life cycle; when the life cycle signal of window creation is monitored, the native control is replaced with a skin-changing control; skin-changing configuration information is obtained; if the skin-changing configuration information includes activation information of the dynamic refresh function, the target skin-changing resource is applied through the skin-changing control, thereby reducing the development workload, realizing the one-click skin-changing function without modifying the original code, and realizing dynamic refresh of the skin, and displaying the new skin effect instantly.

[0088] See also Figure 2 In some embodiments, step S101 may include but is not limited to steps S201 to S203:

[0089] Step S201, obtaining skin-changing related configurations and determining the skin package storage method.

[0090] Specifically, the skin-changing related configuration (ie, skin-changing configuration information) includes the skin-changing resource strategy (ie, the skin package storage method), and the skin-changing resource strategy includes the dynamic delivery strategy and the built-in skinning strategy. That is to say, the skin package storage method includes the dynamic delivery method and the built-in skinning method.

[0091] In some embodiments, if the skin package storage method includes a dynamic delivery method, step S202 is performed after step S201.

[0092] In some embodiments, if the skin package storage method includes a built-in skinning method, step S203 is performed after step S201.

[0093] Step S202: Download the corresponding skin package through the network according to the demand.

[0094] Specifically, a skin pack is a collection of skin-changing resources, which includes resources in multiple dimensions such as backgrounds, icons, and fonts.

[0095] In some embodiments, the target skin package is obtained from the corresponding server according to the path information, and the target skin package is parsed to obtain the target skin-changing resource, wherein the path information includes the download address of the target skin package.

[0096] In this embodiment, the corresponding skin package is downloaded through the network, and the skin package can be flexibly updated according to demand without increasing the package size.

[0097] Step S203, directly obtain the skin package preset in the application assets directory or res directory.

[0098] In some embodiments, the target skin package is obtained from the application package according to the path information, and the target skin package is parsed to obtain the target skinning resource, wherein the path information includes the path of the target skin package in the application assets directory or the res directory.

[0099] In this embodiment, the skin package preset in the application assets directory or res directory is directly obtained, and the skin can be changed immediately without downloading, which saves more and more server resources.

[0100] In some embodiments, Figure 3 The figure is a flow chart of monitoring the life cycle in one embodiment. Monitoring the life cycle: when monitoring the life cycle signal of window creation, replacing the native control with the skinning control, and applying the target skinning resource through the skinning control, including:

[0101] Step S301, call application.registerActivityLifecycleCallbacks(callback) to monitor the application window creation lifecycle signal.

[0102] In step S301 of some embodiments, the Application.registerActivityLifecycleCallbacks(callback) method is used to register a listener, and when the Activity lifecycle of the application changes, the registered listener will receive a corresponding callback.

[0103] Step S302, when the onActivityCreated life cycle is monitored, it means that the window is ready to be created. At this time, the setFactory2 setting is reflected and the native skin factory is replaced with SkinFactory.

[0104] In step S302 of some embodiments, when the onActivityCreated lifecycle event is monitored, it indicates that a new Activity has been created but has not been fully initialized.

[0105] Among them, the setFactory2 method is used to replace the native ViewFactory (ie, the native skin factory) with SkinFactory (ie, the target skin factory).

[0106] Step S303: When the skinning factory creates a window, it will replace the native control with the skinning control.

[0107] In step S303 of some embodiments, the target skinning factory replaces the native control with the skinning control when creating the window.

[0108] Step S304, calling the changeSkin method of the skin-changing control.

[0109] In step S304 of some embodiments, the changeSkin method of the skin-changing control is called, and the skin-changing control applies the target skin-changing resource to implement skin-changing.

[0110] See also Figure 4 In some embodiments, step S304 may include but is not limited to steps S401 to S403:

[0111] Step S401, determining whether to dynamically refresh.

[0112] In step S401 of some embodiments, skin-changing configuration information is obtained, and it is determined whether the skin-changing configuration information includes activation information of the dynamic refresh function. If so, step S403 is executed, otherwise, step S402 is executed.

[0113] Step S402: automatically change the skin when the application is started next time.

[0114] In step S402 of some embodiments, the skinning configuration information does not include the activation information of the dynamic refresh function, and the changeSkin method of the skinning control is called when the application is started next time, and the skinning is realized by applying the target skinning resource through the skinning control.

[0115] Step S403: dynamically replace the application window skin.

[0116] In step S403 of some embodiments, the skinning configuration information includes activation information of the dynamic refresh function, and the changeSkin method of the skinning control is immediately called to implement skinning by applying the target skinning resource through the skinning control.

[0117] See also Figure 5 In some embodiments, step S403 may also include but is not limited to steps S501 to S504:

[0118] Step S501, calling the SkinManager.loadSkinRefreshlmmediate method to execute the skinning logic.

[0119] In step S501 of some embodiments, the SkinManager.loadSkinRefreshlmmediate method may include parameters, and the parameters are used to determine the path of the target skin package to be loaded.

[0120] Step S502, calling the loadSkinResources method to parse the skin package.

[0121] Specifically, the loadSkinResources method is used to parse the target skin package and load the target skinning resources into the memory for use during skinning.

[0122] In step S502 of some embodiments, the target skin package may be first acquired, and the skin package may be parsed when the skinning logic is executed to obtain the target skinning resource.

[0123] Optionally, a caching mechanism can be introduced to avoid repeated parsing of the same skin package; an error handling mechanism can also be added to deal with parsing failures.

[0124] Step S503, after the parsing is successful, set loadSkinRefreshImmediate=true, add an immediate dynamic refresh flag, and call the notifyObservers() method to notify DelaySkinObserver to refresh.

[0125] In step S503 of some embodiments, after the skin package is parsed successfully, loadSkinRefreshImmediate is set to true, and the notifyObservers() method is called to notify the corresponding observers to refresh.

[0126] In this embodiment, after the parsing is successful, set loadSkinRefreshImmediate = true, add the immediate dynamic refresh flag, call notifyObservers() method to notify DelaySkinObserver to refresh, and realize the immediate dynamic refresh function. Users can see the changes in the interface immediately after the skin is changed, which improves the user's interactive experience and enhances the attractiveness and competitiveness of the application.

[0127] Step S504, DelaySkinObserver calls the updateSkinForce method to refresh, in which changeSkin is called to change the skin, and at the same time, it is determined whether the activity uses DataBinding. If so, reflectChangeDataBindingSkin is called to change the skin and refresh.

[0128] Specifically, DelaySkinObserver is an observer class, which is used to monitor skin change events and perform corresponding processing.

[0129] In step S504 of some embodiments, after receiving the refresh notification, DelaySkinObserver calls the updateSkinForce method to perform a refresh operation.

[0130] In this embodiment, DelaySkinObserver calls the updateSkinForce method for refresh. The method calls changeSkin for skinning and determines whether the activity uses DataBinding. If so, reflectChangeDataBindingSkin is called for skinning and refreshing. This implements the skinning operation of the interface, improves the consistency and integrity of the interface, makes the skinning function more stable and reliable, and reduces the occurrence of potential errors and abnormal situations.

[0131] See also Figure 6 In some embodiments, the method of the present application includes but is not limited to steps S601 to S605:

[0132] Step S601, obtaining skinning resources.

[0133] In step S601 of some embodiments, a skinning resource strategy is obtained.

[0134] Step S602: whether to dynamically send down the skin package resource strategy.

[0135] In step S602 of some embodiments, it is determined whether the skinning resource strategy includes a dynamic delivery strategy.

[0136] In some embodiments, the skinning resource strategy may be customized by the user, or different skinning resource strategies may be selected according to specific circumstances.

[0137] Determines whether skin resources are dynamically delivered or obtained using other strategies, such as pre-packaging in the application or loading from local files.

[0138] Step S603: Use other strategies to obtain resources.

[0139] Specifically, other strategies include but are not limited to pre-packaging in the application and loading from a local file.

[0140] In step S603 of some embodiments, if the skinning resource strategy does not include a dynamic delivery strategy, other strategies are used to obtain resources (ie, skin packages).

[0141] Step S604, obtaining the skinning resource package under the configuration path.

[0142] In step S604 of some embodiments, if it is determined to use the resource package (ie, skin package) under the configuration path, it is necessary to obtain the corresponding resource package file from the specified path.

[0143] In this embodiment, the skinning resource package under the configuration path is obtained, which makes the skinning operation simpler and more convenient, and also improves the flexibility of resource management. Dynamically issuing resources can make the application more flexible and real-time, and can respond to user needs and changes in a timely manner.

[0144] Step S605, parsing and replacing skinning resources.

[0145] In step S605 of some embodiments, the acquired skinning resource package (ie, skin package) is parsed, and the resources therein (ie, target skinning resources) are replaced with the existing resources in the current interface.

[0146] In this embodiment, by parsing and replacing skin resources, dynamic changes of the interface can be achieved, thereby enhancing the user experience and the personalization of the interface.

[0147] See also Figure 7 In some embodiments, step S604 may include but is not limited to steps S701 to S704:

[0148] Step S701, call the method SkinDefaultSDCardResourcesLoader(this, "skin package name", "skin package local path") to configure the skin package policy.

[0149] In step S701 of some embodiments, the skin package policy is configured by calling the SkinDefaultSDCardResourcesLoader method and passing in the name and local path of the skin package.

[0150] Step S702, downloading the skin package to the corresponding local path of the skin package through the remote server.

[0151] In step S702 of some embodiments, the corresponding skin package is downloaded from the remote server to a local path.

[0152] In this embodiment, the skin package is downloaded to the corresponding local path of the skin package through the remote server, so that the required skin package can be obtained at any time for skinning, providing users with more choices and personalized experience.

[0153] Step S703, when executing the skinning process, the skin package under the corresponding path will be loaded.

[0154] In step S703 of some embodiments, when executing the skinning process, the application will load the skin package file under the corresponding path according to the configured local path.

[0155] Step S704: Through this method, any skin package can be downloaded from the server at any time for skinning.

[0156] See also Figure 8 In some embodiments, the method of the present application may include but is not limited to steps S801 to S807:

[0157] Step S801: whether to enable skinning configuration.

[0158] In some embodiments, it is determined whether the skinning configuration is enabled, and if enabled, step S802 is executed, otherwise the skinning is terminated.

[0159] Step S802: monitor the life cycle.

[0160] In some embodiments, the application lifecycle is monitored, and when the lifecycle signal of window creation is monitored, the native skinning factory is intercepted and replaced;

[0161] It should be noted that the purpose of monitoring the life cycle of window creation is to replace the native control with a skin-changing control when the window is created. When the skin needs to be changed later, the changeSkin method in the skin-changing control can be called to achieve dynamic refresh.

[0162] Step S803: whether to create a window lifecycle signal.

[0163] Step S804, intercept and replace the skinning factory.

[0164] Step S805: Replace the native control with a skinnable control.

[0165] In some embodiments, when an application creates a control, the skinning factory replaces the native control with the skinned control, and saves the replaced skinned control and the native control.

[0166] For example, the replacement control diagram is as follows Fig. 9 As shown, the native controls are traversed; CustomInflater is obtained, and the native controls are replaced with skin-changing controls according to the mapping relationship: if the replacement fails, the default SkinDefaultChangeableView is used for replacement; skinning is triggered, and the changeSkin method is called to replace the resources.

[0167] Step S806, initiate one-key skin change.

[0168] In some embodiments, skinning configuration information is obtained to determine whether to refresh dynamically.

[0169] Furthermore, if dynamic refresh is not enabled, the new skin will not be displayed until the next time the app is started;

[0170] Furthermore, if dynamic refresh is enabled, the application window skin is dynamically replaced and the current application skin is immediately refreshed for display.

[0171] Step S807, obtaining a loading strategy (ie, a skinning resource strategy) to replace the skinning resource.

[0172] It should be noted that the target skin package (i.e. skinning resource collection) can be stored in two ways:

[0173] 1. Store the skin package directly in the assets directory or res directory of the project, and package it into apk together with the application. This method belongs to the built-in skinning method. The advantage of this method is that it can be skinned immediately without downloading, saving server resources; the disadvantage is that the size of the application package will increase accordingly, and the skin package is fixed and cannot be updated separately;

[0174] 2. Store the skin package on a remote server and provide a download address. When the application needs to change the skin, just download the corresponding skin package to change the skin. This method is a dynamic distribution method. The advantage of this method is that it can flexibly update the skin package according to needs, and the package size will not increase. The disadvantage is that it relies on network download and requires a certain amount of server resource overhead.

[0175] For example, the schematic diagram of obtaining the skinning resource package is as follows: Fig.10 As shown, the Resources packaging stream is used to obtain the skinning resource package (i.e., the target skin package), specifically, the path of the skinning resource package is obtained; through the path, the context.packageManager.getPackageArchivelnfo(path) method is used to obtain the packageInfo of the skinning resource package; through the packageInfo, applicationInfo is obtained, and the contextpackageManager.getResourcesForApplication(applicationInfo) method is used to generate the Resources of the corresponding skinning resource package; and the corresponding skinning resource file is generated.

[0176] In some embodiments, the skin package resource file is parsed, and the relevant elements in the resource file are replaced according to the skinning theme selected by the user.

[0177] It should be noted that parsing the skin package resource file is performed after obtaining the skin package. According to the name and type of the skin package, the corresponding skin-changing resources are parsed; replacing the relevant resource files is performed when changing the skin. The original application resources are replaced with skin-changing resources to achieve skin changing.

[0178] It can be understood that the native controls are directly traversed and replaced with the corresponding skin-changing controls. The mapping relationship between the native controls and the skin-changing controls can be customized by implementing ISkinCustomInflater and then calling the addCustomInflater method. When the mapping relationship of the corresponding control cannot be obtained, the default SkinDefaultChangeableView will be used for replacement; when the skinning is triggered, the changeSkin method will be called in the replaced skin-changing control to replace the resources.

[0179] For example, the comparison diagram before and after skin replacement is as follows: Fig.11 shown.

[0180] See also Fig.12 The embodiment of the present application also provides a skin changing system, which can implement the above skin changing method, and the device includes:

[0181] Skin change management module, used to provide external methods such as initialization, configuration modification, and skin switching;

[0182] Application lifecycle tracking module, used to track the application lifecycle and intercept and replace the skin factory;

[0183] The skinning factory module is used to collect and store native controls and skinning controls to implement the operation of replacing skinning controls;

[0184] Custom skin-changing control generation interface, used to generate custom skin-changing controls;

[0185] Skin loading strategy module, used to control the strategy of skin resource loading;

[0186] The skinning resource management module is used to obtain and replace the resources that need to be skinned;

[0187] Pre-skinning controls are used to pre-set controls related to skinning.

[0188] See also Fig.13 The embodiment of the present application also provides a skin changing device, which can implement the above skin changing method, and the device includes:

[0189] The skin package acquisition module 1301 is used to acquire a target skin package;

[0190] Monitoring module 1302, used for monitoring life cycle;

[0191] The control replacement module 1303 is used to replace the native control with the skin-changing control when monitoring the life cycle signal of window creation;

[0192] Configuration acquisition module 1304, used to acquire skinning configuration information;

[0193] The resource application module 1305 is used to apply the target skinning resource through the skinning control if the skinning configuration information includes the activation information of the dynamic refresh function, and the target skinning resource is obtained by parsing the target skin package.

[0194] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0195] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned skinning method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0196] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0197] See also Fig.14 , Fig.14 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0198] The processor 1401 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (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 the present application;

[0199] The memory 1402 may be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1402 may store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1402, and the processor 1401 calls and executes the skinning method of the embodiment of this application;

[0200] Input / output interface 1403, used to implement information input and output;

[0201] The communication interface 1404 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0202] A bus 1405 that transmits information between the various components of the device (e.g., the processor 1401, the memory 1402, the input / output interface 1403, and the communication interface 1404);

[0203] The processor 1401 , the memory 1402 , the input / output interface 1403 and the communication interface 1404 are connected to each other in communication within the device via a bus 1405 .

[0204] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the above-mentioned skinning method when executed by a processor.

[0205] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0206] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0207] The skin changing method, skin changing device, electronic device and storage medium provided in the embodiments of the present application realize user customization of skin and improve user experience by acquiring the target skin package; monitoring the life cycle; when monitoring the life cycle signal of window creation, replacing the native control with the skin changing control; acquiring skin changing configuration information; if the skin changing configuration information includes the enabling information of the dynamic refresh function, the target skin changing resource is applied through the skin changing control, which reduces the development workload and realizes the one-click skin changing function without modifying the original code, and realizes the dynamic refresh of the skin, and can instantly display the new skin effect.

[0208] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0209] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0210] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0211] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0212] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0213] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0214] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0215] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0216] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0217] 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 present application, 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, which is stored in a storage medium and includes multiple instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store programs.

[0218] The preferred embodiments of the present application are described above with reference to the accompanying drawings, but the scope of the rights of the present application is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present application should be within the scope of the rights of the present application.

Claims

1. A skin changing method, It is characterized in that The method comprises the following steps: Get the Target Skin Pack; Monitor life cycle; When listening to the life cycle signal of window creation, replace the native control with the skin control; Get skinning configuration information; If the skinning configuration information includes activation information of a dynamic refresh function, a target skinning resource is applied through the skinning control, and the target skinning resource is obtained by parsing the target skin package.

2. The method according to claim 1, It is characterized in that The method further comprises: In response to the first instruction, determining a target skin in the skin changing interface; The path information of the target skin package is determined according to the target skin.

3. The method according to claim 2, It is characterized in that The step of obtaining the target skin package comprises: Get the skinning resource strategy.

4. The method according to claim 3, It is characterized in that The step of obtaining the target skin package further includes: If the skin-changing resource strategy includes a dynamic delivery strategy, the target skin package is obtained from the corresponding server according to the path information.

5. The method according to claim 3, It is characterized in that The step of obtaining the target skin package further includes: If the skinning resource strategy includes a built-in skinning strategy, the target skin package is obtained from the application package according to the path information.

6. The method according to claim 1, It is characterized in that The method further comprises: When monitoring the onActivityCreated life cycle, the target skin factory is used to replace the native skin factory.

7. The method according to claim 6, It is characterized in that When the life cycle signal of window creation is monitored, the native control is replaced with a skin-changing control, including: When the life cycle signal of window creation is monitored, the native control is replaced with the skinned control through the target skinning factory.

8. A skin changing device, It is characterized in that The device comprises: A skin package acquisition module, used to acquire a target skin package; Monitoring module, used to monitor the life cycle; The control replacement module is used to replace the native control with the skin-changing control when listening to the life cycle signal of window creation; Configuration acquisition module, used to obtain skinning configuration information; The resource application module is used to apply the target skinning resource through the skinning control if the skinning configuration information includes activation information of the dynamic refresh function, and the target skinning resource is obtained by parsing the target skin package.

9. An electronic device, It is characterized in that The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.