Starting method and device, electronic equipment and medium
By obtaining and loading the dark resource package from the server, the problem of the impact of dark mode on the application installation package size is solved, and efficient dark mode startup and user experience consistency is achieved.
Patent Information
- Application Number
- CN202311281937.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-03-28
AI Technical Summary
When implementing Dark Mode, the prior art requires setting a resource for each of the default mode and Dark Mode, resulting in an increase in the volume of the application installation package.
When the application is in dark mode, the dark resource package is obtained from the server based on the identification information of the dark resource package corresponding to the dark mode, load the dark resource, and set the application page based on the loaded dark resource.
Reduces the impact of the Dark Resource Pack on the application installation package size, improves the startup efficiency of Dark Mode, and ensures the consistency of the user experience.
Smart Images

Figure CN119718448A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to computer technology, and more particularly to a startup method, device, electronic device, and medium. Background Art
[0002] The application modes of the application include dark mode and default mode. The dark mode uses a dark theme to save power on the organic light-emitting diode display.
[0003] When an application implements a dark mode, it is necessary to set a resource for the default mode and the dark mode in the application's installation package, which increases the size of the application's installation package. Summary of the invention
[0004] The present disclosure provides a startup method, device, electronic device and medium, which reduce the impact of the dark mode on the size of the application installation package on the basis of realizing the dark mode.
[0005] In a first aspect, an embodiment of the present disclosure provides a startup method, including:
[0006] When the application is in a dark mode, obtaining a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode;
[0007] Loading the dark resources in the dark resource package;
[0008] The page of the application is set based on the loaded dark resource.
[0009] In a second aspect, the present disclosure also provides a starting device, including:
[0010] An acquisition module, configured to acquire, when the application is in a dark mode, a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode;
[0011] A loading module, used to load the dark resources in the dark resource package;
[0012] The setting module is used to set the page of the application based on the loaded dark resource.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0014] one or more processing devices;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the startup method provided in the embodiment of the present disclosure.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a startup method as provided in an embodiment of the present disclosure.
[0018] In an embodiment of the present disclosure, when an application is in dark mode, a dark resource package corresponding to the dark mode is obtained from a server based on identification information of the dark resource package corresponding to the dark mode; dark resources in the dark resource package are loaded; and the page of the application is set based on the loaded dark resources. When the dark mode is started, the present disclosure obtains a dark resource package from a server based on identification information of the dark resource package, thereby setting the application page based on the dark resource package. The impact of the dark resource package on the size of the application installation package is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 is a flowchart of a startup method provided by an embodiment of the present disclosure;
[0021] Figure 2 is a flowchart of another startup method provided by an embodiment of the present disclosure;
[0022] Figure 3 is a system architecture diagram for implementing a dark mode provided by an embodiment of the present disclosure;
[0023] Figure 4 is a schematic diagram of a dark mode page provided by an embodiment of the present disclosure;
[0024] Figure 5 It is a schematic diagram of the structure of a starting device provided by an embodiment of the present disclosure;
[0025] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0027] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0028] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0029] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0032] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0033] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0034] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0035] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0036] Figure 1 It is a flow chart of a startup method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation of starting the dark mode. The method can be executed by a startup device, and the device can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0037] like Figure 1 As shown, the method includes:
[0038] S110. When the application is in a dark mode, obtain a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode.
[0039] The dark mode can be considered as a mode with a dark theme. The identification information can be considered as information identifying a dark resource package. The identification information is not limited here, as long as it can uniquely identify the dark resource package. The dark resource package can be a resource package used in the dark mode. The dark resource package can be a resource package formed by packaging dark resources. The dark resources can be considered as resources used in the dark mode, such as one or more of text color, background color, and image resources.
[0040] This embodiment does not limit how to set the application to dark mode. For example, the application may be in dark mode after detecting that a button corresponding to the dark mode on the electronic device is triggered; or the application may be in dark mode after the time set for the dark mode is reached.
[0041] When it is detected that the application is in the dark mode, in order to implement the dark mode on the electronic device, this step can obtain the dark resource package corresponding to the dark mode from the server based on the identification information of the dark resource package.
[0042] The identification information of the dark resource package may be the address of the dark resource package on the server, or the resource name of the default mode in the application. The default mode may be the mode in which the application is in by default, and the brightness of the default mode may be higher than the brightness of the dark mode.
[0043] The dark resource of the server may have the same name as the resource of the default mode. Therefore, this step may obtain the dark resource package of the dark mode from the server based on the identification information of the dark resource package of the dark mode.
[0044] During the development of an application, a software development kit method including a dark mode can be set as a resource setting method in the code of the application, and a dark resource package corresponding to the dark mode is configured on the server; then an installation package of the application is generated. After the dark mode software development kit method is initialized on the electronic device, it can be determined whether the application is in the dark mode. If so, the dark resource package can be obtained, and then the application page can be set based on the dark resource package.
[0045] Before setting the software development kit method including the dark mode as the resource setting method in the code of the application, a dark resource package of the dark mode with the same name as the resource name of the default mode can be uploaded to the server, and the dark resource package includes dark resources.
[0046] S120: Load the dark resources in the dark resource package.
[0047] After obtaining the dark resource package, this step can load the dark resource package to parse out the dark resources in the dark resource package, and then realize the setting of the page in the application.
[0048] There is no limitation on the loading method here. For example, dark resources can be loaded through resource management class.
[0049] In one embodiment, loading the dark resource in the dark resource package includes:
[0050] Construct resource management class;
[0051] Use the resource management class to load the dark resources in the dark resource package.
[0052] In the scheme for implementing the dark mode, the resources of the default mode and the resource packages of the dark mode are usually packaged in the same resource package. Loading resources in the same resource package only requires the system method to construct multiple resources. The present disclosure stores the dark mode resource package at a remote end, such as a server, and only loads the dark resource package of the dark mode when the application needs to switch to dark resources. The loading of the dark resource package can be implemented by a known algorithm, and there is no specific limitation.
[0053] When loading dark resources, this embodiment can first construct a resource management class for loading dark resources. The resource management class can be a class for implementing dark resource loading. After constructing the resource management class, the loading of dark resources in the dark resource package can be implemented based on the resource management class.
[0054] S130: Setting a page of the application based on the loaded dark resource.
[0055] After obtaining the dark resources, you can set the page in the application based on the dark resources. Among them, the dark resources can be text color, background color and image resources. When setting the dark resources of the page in this step, you can take over the view, that is, create a View, to achieve the association between the View and the dark resources, such as setting the dark resources to the corresponding View.
[0056] The technical solution of the embodiment of the present disclosure is that when the application is in dark mode, the dark resource package corresponding to the dark mode is obtained from the server based on the identification information of the dark resource package corresponding to the dark mode; the dark resources in the dark resource package are loaded; and the page of the application is set based on the loaded dark resources. When the dark mode is started, the present disclosure obtains the dark resource package from the server based on the identification information of the dark resource package, and then sets the application page based on the dark resource package. The impact of the dark resource package on the size of the application installation package is reduced.
[0057] Based on the above embodiment, a variant embodiment of the above embodiment is proposed. It should be noted that in order to make the description concise, only the differences from the above embodiment are described in the variant embodiment.
[0058] In one embodiment, the setting of the page of the application based on the loaded dark resource includes:
[0059] Set the factory constructor in the layout fill instance;
[0060] Create a view through the factory construction method;
[0061] Associate the loaded dark resource to the view.
[0062] The layout filling instance can be considered as creating a View and parsing the View attributes. The factory construction method can be considered as the method that takes over the View.
[0063] By declaring View in XML, the application will fill the instance through layout at runtime, that is, LayoutInflater creates View and parses the attributes set in XML file. LayoutInflater provides a factory construction method, Factory, for developers to take over the creation of View. Therefore, you can take over the creation of View and parse View attributes by setting factory for LayoutInflater.
[0064] In order to avoid the special logic of each version system when creating View, Dark Mode can take over the creation of View through the view creation method of the factory construction method, that is, Factory.onCreateView. The factory construction method can obtain the creation time of View and then parse the resource properties of View.
[0065] In this embodiment, associating the loaded dark resource with the view can be considered as setting the loaded dark resource to the corresponding view.
[0066] In one embodiment, the View attributes are parsed into the attribute setting class, namely AttributeSet, and the attribute values of AttributeSet are traversed to parse out the resource attributes. The current dark mode SDK only parses dark resources, such as text color, background color, and image resources.
[0067] In one embodiment, setting a factory construction method in a layout fill instance includes:
[0068] In the Get System Service method called in the layout fill instance, set the factory constructor.
[0069] The method for obtaining system services may be a method called in a layout filling instance. In this embodiment, the factory construction method may be set by overwriting the method for obtaining system services.
[0070] When constructing a LayoutInflater instance through the layout inflater instance construction method, that is, the LayoutInflater.from method, the method for obtaining system services under the text class, that is, context.getSystemService(Context.LAYOUT_INFLATER_SERVICE), is actually called. Therefore, you only need to copy the text class, that is, the method for obtaining system services in Context, that is, getSystemService. When LAYOUT_INFLATER_SERVICE is obtained, the factory construction method that injects the dark mode SDK into LayoutInflater can take over the creation of View.
[0071] In one embodiment, associating the loaded dark resource with the view includes:
[0072] Construct attribute handler;
[0073] The loaded dark resource is associated with the view through the attribute processor.
[0074] Attribute handlers can be considered as handlers for view attributes. Attribute handlers can be used to associate dark resources with views.
[0075] After creating the View, this embodiment can construct an attribute processor, and the dark mode SDK can construct a processor for text color, background color, and image resources to set the dark resources to the View. After constructing the attribute processor, the resource setting of the View will be executed through the application method, that is, the Apply method, so that the dark mode takes over the creation of the View and controls the setting of the attributes.
[0076] In one embodiment, associating the loaded dark resource with the view includes:
[0077] The loaded dark resource is associated with the view through the SDK method of the dark mode in the application, and the SDK is set as a method for the resource in the application.
[0078] The dark mode software development kit method can be considered as a method for implementing the dark mode. This embodiment sets the properties of View in the code. The software development kit method may include: a method for setting background resources for a component, a method for setting image resources for an image component, a method for obtaining text color, and a method for obtaining image resources. One or more of the methods.
[0079] The Dark Mode SDK will replace instructions during the application compilation phase, replacing system method instructions with Dark Mode SDK method instructions to complete the control of code settings of View properties.
[0080] Figure 2 : is a flowchart of another startup method provided by an embodiment of the present disclosure. This embodiment refines the scheme for obtaining a dark resource package based on the above embodiment. This embodiment includes the following steps:
[0081] S210: When the application is in a dark mode, determine a resource name of a default mode in the application.
[0082] In the case where it is determined that the application is in dark mode, this operation can determine the resource name of the default mode. The resource name can be a name that represents the resource in the default mode. In this embodiment, the resource in the default mode and the resource in the dark mode have the same name. This operation determines the resource name of the default mode so as to obtain the dark resource package of the dark mode of the application from the server.
[0083] The installation package of the application includes a resource package in the default mode, so this operation can determine the resource name of the installation package in the default mode in the installation package of the application.
[0084] S220: Determine the resource name as identification information of a dark resource package corresponding to the dark mode.
[0085] After determining the resource name, this operation can determine the resource name as identification information of the dark resource package, so as to obtain the dark resource package from the server based on the identification information.
[0086] S230: Obtain a dark resource package matching the identification information from the server.
[0087] This operation can send the identification information to the server and obtain the dark resource package that matches the identification information returned by the server.
[0088] S240: Load the dark resources in the dark resource package.
[0089] S250: Setting a page of the application based on the loaded dark resource.
[0090] When the dark mode is started, this embodiment obtains the dark resource package based on the resource name of the default mode, and obtains the dark resource package from the server more conveniently, thereby improving the speed of starting the dark mode of the electronic device.
[0091] The startup method provided by the present disclosure can be considered as a solution for implementing a dark mode in an Android application. The related art implementation of the dark mode has its own advantages and disadvantages in terms of package size, maintenance cost, supported system versions and user experience. Therefore, a better implementation solution is desired in terms of package size, maintenance cost, supported versions and user experience.
[0092] The dark mode disclosed in the present invention reduces the impact on the installation package size of the application. In addition, it can meet the consistency of the experience requirements of all users for the dark mode and avoid the situation where color inversion is inconsistent on various electronic devices.
[0093] Taking into account the supported system versions, development and maintenance costs, package size impact, and user experience, this application maps and replaces the text color, background color, and image resources on the application, and uses the system methods provided by the system and compatible with various versions to achieve color and resource mapping replacement. Developers only need to put the resources with the same name applicable to the default mode and dark mode into the corresponding resource packages. Only the resource packages for the default mode are stored in the application, and the dark resource packages for the dark mode are sent to the application online. All the text, background colors, and image resources seen by users are controlled by the developer to ensure consistent performance across models.
[0094] The public startup method supports all system versions; the development and maintenance costs are low, and developers only need to put the same-name color and image resources into different resource packages to complete the adaptation, which is less invasive in the development phase; it has little impact on the size of the installation package, with almost no increment; and the user experience consistency is high.
[0095] Figure 3 is a system architecture diagram for implementing a dark mode provided by an embodiment of the present disclosure, Figure 3 The overall process of dark mode is described from three stages: development, application, i.e. APP compilation, and APP operation.
[0096] During the demand development phase, developers complete the text color, background color, and image resource settings in light mode (also known as default mode), store the resource files with the same name in the dark mode resource package, i.e., the dark resource package, and publish the dark mode resource package to the "Dark Mode Resource Management Service": 1. During the demand development phase, set resources in the default mode; 2. Declare resources with the same name to the dark resource package; 3. Upload the configuration of the dark resource package. The dark mode resource management service implements the configuration and distribution of dark mode resource packages.
[0097] When the APP compiles the code into APK, it will search and collect the resource setting methods for setting text color, background color, and image resources, and replace them with the dark mode SDK methods: that is, 1. APP compilation; 2. APP call method replacement, replacing the system method, that is, the resource setting method, with the SDK method dark mode; 3. Construct the APP to obtain the APK of the application.
[0098] When the user opens the APP, the dark mode SDK will be initialized first, and the current mode of the APP will be determined. If it is in dark mode, the dark mode resource package will be pulled and parsed from the "Dark Mode Resource Management Service" and the page resources will be refreshed. Users can also switch modes during the use of the APP. The dark mode SDK supports free switching between the two modes.
[0099] When refreshing page resources, you can take over the creation of View.
[0100] This disclosure takes over the creation of View through the dark mode SDK, parses the resource attribute declaration of View in XML, and dynamically replaces the system method with the dark mode SDK method during compilation to achieve the dynamic switching capability of light / dark mode. The client only stores the light resource package locally, and the dark mode resource package is stored on the server, and the resource package is dynamically distributed through the server. The package size cost required to implement the dark mode is reduced by about 3M.
[0101] Figure 4 is a schematic diagram of a dark mode page provided by an embodiment of the present disclosure; see Figure 4 After starting the dark mode, the page displayed by the electronic device can be as follows Figure 4 As shown, the background color of background 1 can be black, text 2 can be white, and control 3 can also be white.
[0102] Figure 5 is a schematic diagram of the structure of a starting device provided in an embodiment of the present disclosure, such as Figure 5 As shown, the device comprises:
[0103] The acquisition module 510 is used to acquire the dark resource package corresponding to the dark mode from the server based on the identification information of the dark resource package corresponding to the dark mode when the application is in the dark mode;
[0104] A loading module 520, used to load the dark resources in the dark resource package;
[0105] The setting module 530 is used to set the page of the application based on the loaded dark resource.
[0106] The technical solution provided by the embodiment of the present disclosure obtains the dark resource package from the server based on the identification information of the dark resource package when the dark mode is started, so as to set the application page based on the dark resource package, thereby reducing the impact of the dark resource package on the size of the application installation package.
[0107] In one embodiment, the acquisition module 510 is specifically configured to determine the resource name of the default mode in the application when the application is in a dark mode;
[0108] Determine the resource name as identification information of a dark resource package corresponding to the dark mode;
[0109] Obtain a dark resource package matching the identification information from the server.
[0110] In one embodiment, the loading module 520 is specifically configured to:
[0111] Construct resource management class;
[0112] Use the resource management class to load the dark resources in the dark resource package.
[0113] In one embodiment, the setting module 530 includes:
[0114] A setup unit, used to set the factory construction method in the layout fill instance;
[0115] A construction unit, used for creating a view through the factory construction method;
[0116] The associating unit is used to associate the loaded dark resource with the view.
[0117] In one embodiment, the setting unit is specifically configured to:
[0118] In the Get System Service method called in the layout fill instance, set the factory constructor.
[0119] In one embodiment, the association unit is specifically configured to:
[0120] Construct attribute handler;
[0121] The loaded dark resource is associated with the view through the attribute processor.
[0122] In one embodiment, the association unit is specifically configured to:
[0123] The loaded dark resource is associated with the view through the SDK method of the dark mode in the application, and the SDK is set as a method for the resource in the application.
[0124] The startup device provided in the embodiments of the present disclosure can execute the startup method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0125] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0126] Figure 6 Schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 6 , which shows an electronic device (eg, Figure 6 A schematic diagram of the structure of a terminal device or server) 500.
[0127] The electronic device 500 includes:
[0128] One or more processing devices 501;
[0129] The storage device 508 is used to store one or more programs.
[0130] When the one or more programs are executed by the one or more processing devices 501, the one or more processing devices 501 implement the startup method provided by the embodiment of the present disclosure.
[0131] The terminal devices in the embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., as well as fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0132] like Figure 6 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0133] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0134] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0135] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0136] The electronic device provided in the embodiment of the present disclosure and the startup method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0137] An embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the startup method provided by the above embodiment is implemented.
[0138] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
[0139] The computer storage medium may be a storage medium of computer executable instructions, which, when executed by a computer processor, are used to perform the methods provided by the present disclosure.
[0140] Computer readable storage media may be, for example, but not limited to: electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device or device. In the present disclosure, a computer readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program used by or in conjunction with an instruction execution system, device, or device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
[0141] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0142] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0143] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0144] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: when the application is in the dark mode, obtains the dark resource package corresponding to the dark mode from the server based on the identification information of the dark resource package corresponding to the dark mode; loads the dark resources in the dark resource package; and sets the page of the application based on the loaded dark resources.
[0145] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0146] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0147] The modules or units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module or unit does not limit the unit itself in some cases. For example, a loading module may also be described as a "dark resource loading module".
[0148] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0149] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0150] According to one or more embodiments of the present disclosure, [Example 1] provides a startup method, including:
[0151] When the application is in a dark mode, obtaining a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode;
[0152] Loading the dark resources in the dark resource package;
[0153] The page of the application is set based on the loaded dark resource.
[0154] According to one or more embodiments of the present disclosure, [Example 2] provides the method described in Example 1, where, when the application is in a dark mode, a dark resource package corresponding to the dark mode is obtained from a server based on identification information of the dark resource package corresponding to the dark mode, including:
[0155] In the case where the application is in dark mode, determining a resource name of a default mode in the application;
[0156] Determine the resource name as identification information of a dark resource package corresponding to the dark mode;
[0157] Obtain a dark resource package matching the identification information from the server.
[0158] According to one or more embodiments of the present disclosure, [Example 3] provides the method described in Example 1, wherein loading the dark resource in the dark resource package includes:
[0159] Construct resource management class;
[0160] Use the resource management class to load the dark resources in the dark resource package.
[0161] According to one or more embodiments of the present disclosure, [Example 4] provides the method described in Example 1, wherein setting the page of the application based on the loaded dark resource includes:
[0162] Set the factory constructor in the layout fill instance;
[0163] Create a view through the factory construction method;
[0164] Associate the loaded dark resource to the view.
[0165] According to one or more embodiments of the present disclosure, [Example 5] provides the method described in Example 4, wherein setting a factory construction method in a layout filling instance includes:
[0166] In the Get System Service method called in the layout fill instance, set the factory constructor.
[0167] According to one or more embodiments of the present disclosure, [Example 6] provides the method described in Example 4, wherein associating the loaded dark resource to the view includes:
[0168] Construct attribute handler;
[0169] The loaded dark resource is associated with the view through the attribute processor.
[0170] According to one or more embodiments of the present disclosure, [Example 7] provides the method of Example 4, characterized in that associating the loaded dark resource to the view includes:
[0171] The loaded dark resource is associated with the view through the SDK method of the dark mode in the application, and the SDK is set as a method for the resource in the application.
[0172] According to one or more embodiments of the present disclosure, [Example 8] provides a starting device, including:
[0173] An acquisition module, configured to acquire, when the application is in a dark mode, a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode;
[0174] A loading module, used to load the dark resources in the dark resource package;
[0175] The setting module is used to set the page of the application based on the loaded dark resource.
[0176] According to one or more embodiments of the present disclosure, [Example 9] provides an electronic device, the electronic device comprising:
[0177] one or more processing devices;
[0178] a storage device for storing one or more programs,
[0179] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the startup method as described in any one of Examples 1-7.
[0180] According to one or more embodiments of the present disclosure, [Example 10] provides a storage medium containing computer executable instructions, which are used to execute the startup method described in any one of Examples 1-7 when executed by a computer processor.
[0181] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0182] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0183] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A startup method, characterized in that: include: When the application is in a dark mode, obtaining a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode; Loading the dark resources in the dark resource package; The page of the application is set based on the loaded dark resource.
2. The method according to claim 1, characterized in that When the application is in a dark mode, obtaining a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode includes: In the case where the application is in dark mode, determining a resource name of a default mode in the application; Determine the resource name as identification information of a dark resource package corresponding to the dark mode; Obtain a dark resource package matching the identification information from the server.
3. The method according to claim 1, characterized in that The loading of the dark resources in the dark resource package includes: Construct resource management class; Use the resource management class to load the dark resources in the dark resource package.
4. The method according to claim 1, characterized in that: The setting of the page of the application based on the loaded dark resource includes: Set the factory constructor in the layout fill instance; Create a view through the factory construction method; Associate the loaded dark resource to the view.
5. The method according to claim 4, characterized in that The method of setting a factory construction method in the layout filling instance includes: In the Get System Service method called in the layout fill instance, set the factory constructor.
6. The method according to claim 4, characterized in that The step of associating the loaded dark resource with the view includes: Construct attribute handler; The loaded dark resource is associated with the view through the attribute processor.
7. The method according to claim 4, characterized in that The step of associating the loaded dark resource with the view includes: The loaded dark resource is associated with the view through the SDK method of the dark mode in the application, and the SDK is set as a method for the resource in the application.
8. A starting device, characterized in that: include: An acquisition module, configured to acquire, when the application is in a dark mode, a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode; A loading module, used to load the dark resources in the dark resource package; The setting module is used to set the page of the application based on the loaded dark resource.
9. An electronic device, characterized in that: The electronic device comprises: one or more processing devices; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the startup method as described in any one of claims 1-7.
10. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the startup method according to any one of claims 1 to 7 when executed by a computer processor.
Citation Information
Patent Citations
Application program mode switching method and device
CN115454591A
Service calling method, system and equipment and storage medium
CN115640080A
Method and device for switching APP theme
CN115756675A