Theme package installation method, device, electronic device and computer-readable storage medium

By traversing the theme package description file in electronic devices to generate target image resources, the problem of the theme package occupies a large storage space is solved, and more efficient processing performance and transmission efficiency is achieved, and theme package installations in multiple screen forms and users' personalized needs are supported.

CN113495733BActive Publication Date: 2025-07-11HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010199876.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-20
Publication Date
2025-07-11
Estimated Expiration
2040-03-20

AI Technical Summary

Technical Problem

Theme packages in existing electronic devices occupy a large storage space, resulting in low processing performance and transmission efficiency, and cannot meet the needs of multiple screen forms and users.

Method used

By traversing the description files in the theme package, the target image resources that meet the system application scenarios are generated, the storage of duplicate image resources is reduced, and only the original image and description files are stored. The target image resources are generated based on the description files during installation.

Benefits of technology

It reduces the volume of the theme package, saves storage space, improves the processing performance and transmission efficiency of electronic devices, and supports the installation of theme packages in multiple system application scenarios and screen forms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113495733B_ABST
    Figure CN113495733B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a method, device, electronic device, and computer-readable storage medium for installing a theme package. The method includes: obtaining a theme package to be installed, where the theme package contains at least one original picture of a predetermined size; if the theme package contains a description file, traversing the description file, where the description file is created based on a system application scenario and the original picture; generating target picture resources according to the traversal result of the description file, and applying the target picture resources to the system application scenario. In the embodiment of the present application, the number of duplicate prefabricated picture resources in the theme package is reduced, the volume of the theme package and the occupied storage space are reduced, so that the electronic device can install and store more theme packages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and particularly relates to a method and device for installing a theme package, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the development and popularization of intelligent electronic devices, the theme application of electronic devices has also become a major factor in users' personalized choices. The views and window displays of electronic devices usually define some specification attributes to represent their respective appearance, format, and other information; a theme is a collection of a series of attributes set on a view or window. For example, the font size and font color in a text view, and the window type and window size of a dialog box. Defining attributes such as the font style, font color, and font size of a text view into a theme, all text views using this theme will have the same font style, font color, and font size.

[0003] Currently, multiple sets of themes are pre-installed in electronic devices, usually saved in the resource directory in the form of files, and users can set different themes according to their needs. On the other hand, with the continuous improvement of the screen technology of electronic devices, an electronic device can have multiple screen forms. Due to the increase in the number of screen forms, the interaction methods between the screen and users also increase accordingly, and the demand scenarios for themes by users will also increase. The resources such as pictures and colors used by the system and applications will also increase, and the corresponding theme packages will also increase; this makes the process of downloading theme packages increase the pressure on the broadband, and at the same time, too much system storage space is occupied when saving theme packages. Summary of the Invention

[0004] This application discloses a method and device for installing a theme package, an electronic device, and a computer-readable storage medium, which can reduce the space occupied by the theme package and improve the processing performance and transmission efficiency of the electronic device.

[0005] In a first aspect, an embodiment of this application provides a method for installing a theme package. The method includes obtaining a theme package to be installed, where the theme package contains at least one original picture of a predetermined size; if the theme package contains a description file, traversing the description file, where the description file is created based on the system application scenario and the original picture; generating target picture resources according to the traversal result of the description file, and applying the target picture resources to the system application scenario.

[0006] In the above-mentioned theme package installation method, during the installation of the theme package on the electronic device, all the description files in the theme package can be traversed; according to the description files created based on the original pictures of a predetermined size in the theme package, target picture resources that conform to the system application scenarios can be generated; since only the original pictures are stored in the theme package, the number of duplicate prefabricated picture resources in the theme package is reduced, resulting in a smaller volume of the theme package. Thus, the storage space occupied by the duplicate prefabricated picture resources in the theme package can be reduced, and the processing performance and transmission efficiency of the electronic device can be improved. According to the system application scenarios and user needs, the electronic device can install and store multiple theme packages suitable for different system application scenarios.

[0007] In combination with the first aspect, in some embodiments, before traversing the description files, it includes:

[0008] Generating a complete set list of the description files, where the complete set list includes at least one first description file or at least one second description file; wherein, the description complexity of the second description file is greater than that of the first description file, and each first description file or each second description file corresponds to a target picture resource respectively.

[0009] Exemplarily, the complete set list may only include first description files, or only include second description files, or may include both first description files and second description files at the same time. Generating a complete set list of the description files facilitates the traversal of all the description files, generates the target picture resources required for the complete application of the theme package, and avoids missing a certain description file and causing the corresponding picture resources in the theme package to be missing.

[0010] In combination with the first aspect, in some embodiments, applying the target picture resources to the system application scenarios includes:

[0011] Applying the target picture resources to one or more of the system application scenarios such as the desktop application, the contacts and dialer application, the text message application, and the notification bar and multitasking application.

[0012] Through the above embodiments, the electronic device may include multiple system application scenarios. During the installation of the theme package, according to the system application scenarios that need to use the theme package, the description files in the theme package corresponding to the system application scenarios can be traversed, and target picture resources required for one or more system application scenarios can be generated; since the description files in the theme package replace the storage space of the picture resources, the volume of the theme package is reduced. Thus, the electronic device can support the installation and storage of multiple theme packages for different system application scenarios, meeting the needs of multiple screen forms of the electronic device and the requirements of users' personalized choices.

[0013] In combination with the first aspect, in some embodiments, generating the target picture resources according to the traversal result of the description files includes:

[0014] Generate the target picture resource according to the number of bitmaps set in the description file and the attribute information of the original picture recorded in the description file.

[0015] Through the above embodiments, during the process of installing the theme package on the electronic device, the description file can be traversed, and the target picture resource can be generated according to the number of bitmaps set in the description file and the attribute information of the original picture; when the electronic device executes the program in the theme package during the process of installing the theme package, the description file in the theme package is converted to generate the target picture resource, avoiding the occupation of storage space by placing multiple picture resources of application icons that are repeatedly used in the theme package; before the electronic device uses the theme package, preprocess the theme package to convert all description files into picture resources, reduce the storage space occupied by the theme package, and improve the processing performance and transmission efficiency of the electronic device.

[0016] Combined with the first aspect, in some embodiments, generating the target picture resource according to the traversal result of the description file includes:

[0017] If the currently traversed description file is the first description file, obtain the position information and size information of the bitmap to be intercepted in the original picture in the attribute information; generate a bitmap corresponding to each first description file according to the position information and the size information; rename each bitmap corresponding to the first description file to obtain the target picture resource corresponding to each first description file.

[0018] It can be understood that when the description file is the first description file, each first description file corresponds to generating one bitmap, and one bitmap corresponds to generating one target picture resource. For example, the desktop wallpaper of the desktop application can generate the picture resource of the desktop wallpaper through one first description file.

[0019] Combined with the first aspect, in some embodiments, generating the target picture resource according to the traversal result of the description file includes:

[0020] If the currently traversed description file is the second description file, obtain the position information of the bitmap to be intercepted in the original picture in the attribute information, at least two pieces of size information, and position allocation information; generate at least two bitmaps corresponding to each second description file according to the position information and the at least two pieces of size information; splice the at least two bitmaps according to the position allocation information to obtain a spliced bitmap; rename the spliced bitmap corresponding to each second description file to obtain the target picture resource corresponding to each second description file.

[0021] Through the above embodiments, for the theme used in a relatively complex display interface in the corresponding system application scenario, the required target picture resources can be generated through the second description file. For example, in the contact dialer application scenario, for the sake of the consistency of the view interface display, the dialer part and the upper border of the screen display will use pictures of the same theme series for display. The electronic device generates two bitmaps corresponding to the dialer part and the upper border of the screen display according to the attribute information in the second description file, and then splices them into a new picture according to the positional relationship between the two bitmaps as the theme picture resources for the contact dialer application scenario.

[0022] Among them, the second description file also includes the serial numbers of at least two generated bitmaps, and the splicing relationship of the bitmaps is determined according to the serial numbers and the position allocation information.

[0023] Exemplarily, when only the first description file is included in the complete set list of the description file, the target picture resources corresponding to the desktop wallpaper or multiple small icons on the desktop can be obtained from the original picture, and the target picture resources are applied to the scenario of the desktop wallpaper or the scenario of the application icons on the desktop; when the second description file is included in the complete set list of the description file, the target picture resources after splicing multiple bitmaps can be obtained from the original picture, and the target picture resources are applied to system application scenarios such as the contact dialer and the upper border of the contact view that use the upper part of the original picture; when both the first description file and the second description file are included in the complete set list of the description file, the electronic device can obtain the target picture resources required for system application scenarios such as small icons and contact dialers from the original picture.

[0024] Combined with the first aspect, in some embodiments, the generating the target picture resources according to the traversal result of the description file includes:

[0025] Generating the bitmap or the spliced bitmap according to the number of bitmaps set in the description file and the attribute information of the original picture recorded in the description file; performing secondary processing on the bitmap or the spliced bitmap according to the bitmap drawing information in the description file to obtain various types of pictures; renaming the pictures to obtain various types of the target picture resources; wherein, the secondary processing includes one or more of scaling, cropping, rotating, offsetting, and rendering; the various types of pictures can include pictures with different shapes and the same color, or pictures with different shapes, different colors, and similar contents, and can also include pictures with different contents based on different local positions in the original picture.

[0026] Through the above embodiments, before the electronic device generates the target picture resource according to the description file, the generated bitmap or spliced bitmap can also be processed a second time to obtain a theme picture applicable to more system application scenarios, and the installation and storage of the theme package applicable to multiple system application scenarios can be realized without increasing the occupied space of the theme package, enriching the views and window interfaces of the system application scenarios.

[0027] In a second aspect, an embodiment of the present application provides a theme package installation device, and the device includes:

[0028] An acquisition unit, configured to acquire a theme package to be installed, where the theme package includes at least one original picture of a predetermined size;

[0029] A processing unit, configured to traverse the description file if the theme package includes a description file, where the description file is created based on system application scenarios and the original picture;

[0030] A generation unit, configured to generate a target picture resource according to the traversal result of the description file, and apply the target picture resource to the system application scenario.

[0031] In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors, a memory, and a display screen; the memory and the display screen are coupled to the one or more processors, the memory is used to store computer program code, and the computer program code includes computer instructions; when the one or more processors execute the computer instructions, the electronic device is caused to execute the theme package installation method provided in the first aspect and any possible implementation manner of the first aspect.

[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, the computer program includes instructions, and when the instructions run on an electronic device, the electronic device is caused to execute the theme package installation method provided in the first aspect and any possible implementation manner of the first aspect.

[0033] In a fifth aspect, an embodiment of the present application provides a computer program product including instructions, and when the computer program product runs on an electronic device, the electronic device is caused to execute the theme package installation method provided in the first aspect and any possible implementation manner of the first aspect.

[0034] It can be understood that the theme package installation device described in the second aspect, the electronic device described in the third aspect, the computer-readable storage medium described in the fourth aspect, or the computer program product including instructions described in the fifth aspect provided above are all used to execute the method provided in any one of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, and will not be elaborated here. Brief Description of the Drawings

[0035] The drawings used in the embodiments of the present application will be introduced below.

[0036] Figure 1 is a schematic structural diagram of the electronic device 100 provided by the embodiment of the present application;

[0037] Figure 2 is a software structural block diagram of the electronic device 100 provided by the embodiment of the present application;

[0038] Figure 3 In (A) is a schematic diagram of the original picture included in the theme package provided by the embodiment of the present application;

[0039] Figure 3 In (B) is a schematic view interface diagram of a theme used in a system application scenario provided by the embodiment of the present application;

[0040] Figure 4 In (A) is a schematic diagram of a theme application interface in a screen form provided by the embodiment of the present application;

[0041] Figure 4 In (B) is another schematic diagram of a theme application interface in a screen form provided by the embodiment of the present application;

[0042] Figure 5 is a coordinate schematic diagram of a theme picture in a system application scenario provided by the embodiment of the present application;

[0043] Figure 6 In (A) is another schematic diagram of a theme application interface in another screen form provided by the embodiment of the present application;

[0044] Figure 6 In (B) is another schematic diagram of a theme application interface in another screen form provided by the embodiment of the present application;

[0045] Figure 7 is another schematic view interface diagram of a theme used in a system application scenario provided by the embodiment of the present application;

[0046] Figure 8 is another coordinate schematic diagram of a theme picture in a system application scenario provided by the embodiment of the present application;

[0047] Figure 9 is a schematic flow diagram of a theme package installation method provided by the embodiment of the present application;

[0048] Figure 10 is a schematic structural diagram of a theme package installation device provided by the embodiment of the present application. Detailed Description of the Embodiments

[0049] The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. The terms used in the implementation part of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0050] First, the electronic device involved in the embodiments of the present application will be introduced. Please refer to Figure 1 , Figure 1 which is a schematic structural diagram of the electronic device 100 provided by the embodiments of the present application.

[0051] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0052] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0053] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0054] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0055] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0056] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0057] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby implementing the touch function of the electronic device 100.

[0058] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple groups of I2S buses. The processor 110 may be coupled to the audio module 170 through the I2S bus to implement communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through the I2S interface to implement the function of answering phone calls through a Bluetooth headset.

[0059] The PCM interface can also be used for audio communication to sample, quantize, and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through the PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0060] The UART interface is a general-purpose serial data bus for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0061] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.

[0062] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0063] The USB interface 130 is an interface that conforms to the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect a headset to play audio through the headset. This interface can also be used to connect other electronic devices, such as AR devices, etc.

[0064] It can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are only illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0065] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 can receive the charging input from a wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 can receive the wireless charging input through the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.

[0066] The power management module 141 is used to connect to the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as the battery capacity, the number of battery cycles, and the battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0067] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.

[0068] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: the antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0069] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 can be disposed in the same device.

[0070] The modulation and demodulation processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modulation and demodulation processor may be an independent device. In other embodiments, the modulation and demodulation processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.

[0071] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive the signal to be transmitted from the processor 110, perform frequency modulation on it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.

[0072] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, such that electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).

[0073] Electronic device 100 implements a display function through a GPU, display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0074] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0075] The electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, etc.

[0076] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light passes through the lens and is transmitted to the camera sensor. The light signal is converted into an electrical signal, and the camera sensor transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also optimize the noise, brightness, and skin color of the image through algorithms. The ISP can also optimize parameters such as the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0077] The camera 193 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the sensor. The sensor can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The sensor converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in standard RGB, YUV, etc. formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0078] The digital signal processor is used to process digital signals. Besides being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0079] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0080] The NPU is a neural-network (NN) computing processor. By drawing on the structure of the biological neural network, such as the transmission pattern between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, voice recognition, text understanding, etc.

[0081] The external memory interface 120 can be used to connect to an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to achieve the data storage function. For example, files such as music and videos are saved in the external memory card.

[0082] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory and can also include non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0083] The electronic device 100 can achieve audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor, etc. For example, music playback, recording, etc.

[0084] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.

[0085] The speaker 170A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or a hands-free call through the speaker 170A.

[0086] The receiver 170B, also known as the "earpiece", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the voice can be listened to by bringing the receiver 170B close to the human ear.

[0087] The microphone 170C, also known as the "microphone" or "transmitter", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can speak by bringing the mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and implement functions such as directional recording.

[0088] The headphone jack 170D is used to connect a wired headphone. The headphone jack 170D can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0089] The pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor may include at least two parallel plates having conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, the instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.

[0090] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and makes the lens offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenarios.

[0091] The barometric pressure sensor 180C is used to measure barometric pressure. In some embodiments, the electronic device 100 calculates the altitude according to the barometric pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0092] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the leather case or the opening and closing state of the flip, features such as automatic flip unlocking are set.

[0093] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0094] A distance sensor 180F is used to measure distance. The electronic device 100 can measure distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0095] The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The light-emitting diode may be an infrared light-emitting diode. The electronic device 100 emits infrared light outward through the light-emitting diode. The electronic device 100 uses the photodiode to detect the infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect when the user holds the electronic device 100 close to the ear for a call, so as to automatically turn off the screen to achieve the purpose of power saving. The proximity light sensor 180G can also be used for automatic unlocking and locking of the holster mode and pocket mode.

[0096] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.

[0097] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc.

[0098] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by low temperature. In other some embodiments, when the temperature is lower than yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0099] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 together form a touch screen, also known as the "touch display screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from that of the display screen 194.

[0100] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals of the vibrating bone mass of the human vocal tract. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulsation signals. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone to form a bone conduction earphone. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bone mass acquired by the bone conduction sensor 180M to implement the voice function. The application processor can parse out heart rate information based on the blood pressure pulsation signals acquired by the bone conduction sensor 180M to implement the heart rate detection function.

[0101] The button 190 includes a power-on button, volume buttons, etc. The button 190 can be a mechanical button or a touch button. The electronic device 100 can receive button inputs to generate key signal inputs related to the user settings and function controls of the electronic device 100.

[0102] The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts and can also be used for touch vibration feedback. For example, touch operations on different applications (such as taking pictures, audio playing, etc.) can correspond to different vibration feedback effects. Touch operations on different regions of the display screen 194 can also correspond to different vibration feedback effects for the motor 191. Different application scenarios (such as time reminder, receiving messages, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0103] The indicator 192 can be an indicator light and can be used to indicate the charging state, power change, and can also be used to indicate messages, missed calls, notifications, etc.

[0104] The SIM card interface 195 is used to connect to the SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact with and separation from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0105] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present invention, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device 100.

[0106] Figure 2 It is a software structure block diagram of the electronic device 100 in the embodiments of the present application.

[0107] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0108] The application layer may include a series of application packages.

[0109] As Figure 2 shown, the application packages may include applications such as a camera, a gallery, a calendar, a call, a map, a navigation, a WLAN, a Bluetooth, music, a video, and a short message.

[0110] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0111] As Figure 2 shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.

[0112] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0113] The content provider is used to store and obtain data, and make this data accessible to application programs. The data can include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, phone books, etc.

[0114] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build application programs. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon can include a view for displaying text and a view for displaying pictures.

[0115] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of call status (including answering, hanging up, etc.).

[0116] The resource manager provides various resources for application programs, such as localized strings, icons, pictures, layout files, video files, etc.

[0117] The notification manager enables application programs to display notification information in the status bar. It can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of a download, message reminder, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background-running application program, and can also be a notification that appears on the screen in the form of a dialogue window. For example, prompt text information in the status bar, emit a prompt sound, the electronic device vibrates, the indicator light flashes, etc.

[0118] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.

[0119] The core libraries contain two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android.

[0120] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as the management of object life cycles, stack management, thread management, security and exception management, and garbage collection.

[0121] The system library may include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.

[0122] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.

[0123] The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0124] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0125] The 2D graphics engine is a drawing engine for 2D drawing.

[0126] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0127] Next, in combination with the capture and photo-taking scenario, the working processes of the software and hardware of the electronic device 100 will be exemplarily described.

[0128] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including information such as touch coordinates and the timestamp of the touch operation). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation and the control corresponding to the click operation as the control of the camera application icon as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer, and captures a static image or video through the camera 193.

[0129] First, an introduction to the theme package installation involved in the embodiments of the present application will be given.

[0130] In the Android system, properties are usually defined for views, windows, and other display interfaces to represent their appearance, format, and other information. For example, the font size and color of a text view, and the window type and size of a dialog box. A theme is a collection of a series of properties set on a view or window. By defining properties such as font style, color, and size of a text view in a theme, all text views using this theme will have the same font style, color, and size. Correspondingly, for the pictures displayed on the view interface or window interface, picture properties adapted to the appearance, format, and other information of the system views and windows are also set and defined in a theme. All picture views using this theme will have the same or similar picture styles, etc.

[0131] In the Android system design, generally, multiple sets of themes are prefabricated within a system or application. Different themes can be set according to user selection for different system application scenarios.

[0132] With the continuous improvement of electronic device screen technology, split-screen operations may occur on electronic devices or multiple screen forms may be supported. For example, in a folding-screen mobile phone, the screen form includes a tablet form in the unfolded state, a 16:9 screen form on one side after folding, and a 4:3 screen form on the other side. On electronic devices with changeable screen forms like folding screens, different themes can be set for the same application in different screen forms. At the same time, with the increase in the number of screen forms, the interaction methods between the screen and the user also increase accordingly. The resources such as pictures and colors used by the system and applications in the theme package also increase, and the corresponding theme package becomes larger, and the storage requirements for the system by the theme package are also getting higher and higher.

[0133] The business scenarios involved in system themes generally include several applications such as contacts and dialer, messages, desktop, and notification bar and multitasking.

[0134] On the one hand, for the desktop wallpaper scenario of the desktop application, the dialer scenario of the contacts application, and the message list interface of the messages application, pictures with the same theme content but different sizes may be used as the background. Therefore, for these system application scenarios, in the existing theme package, for each scenario of the desktop wallpaper scenario of the desktop application, the dialer scenario of the contacts application, and the message list interface of the messages application, multiple pictures with different sizes and similar content need to be set, thus prefabricating picture resources repeatedly in the theme package, making the occupied space of the theme package larger.

[0135] On the other hand, for the contact list in the contact application, the default avatars of contacts, and the icons of installed applications in the desktop application, the images used are the local areas of a certain picture in the theme package. In the existing theme packages, multiple picture resources also need to be prefabricated, which increases the occupied space of the theme package.

[0136] The theme package installation method provided in this application can reduce the volume of the theme package, enabling users to download and use more theme packages under the same space, meeting the requirements of the system for different screen forms and various application scenarios of the theme package.

[0137] In order to maintain the visual consistency of the display interfaces of views and windows after using the theme package, in most scenarios, the pictures of the theme are highly similar, including the same picture style or the same color, etc. In the theme package provided in the embodiments of this application, an original picture is set, as Figure 3 shown in (A) of. In the theme package, an original picture with a size specification greater than or equal to the maximum screen form of the electronic device can be set. A description file is also set in the theme package, and the description file is created based on the attribute information (including appearance, format, type, size, etc.) of the display interfaces such as view windows in the electronic device and the original picture. According to the picture specifications required by the system application scenario, the action process for generating the required target picture resources based on the original picture is set in the description file. When the electronic device stores the theme package, the theme package only contains at least one original picture and a description file that meets the requirements of the system application scenario; when installing the theme package, the action process in the description file is executed to generate the picture resources required by the system application scenario based on the original picture.

[0138] As Figure 3 shown in (B) of, in the dialing pad scenario in the contact application, picture resources that are similar in content to the original picture but different in size are used. The number of bitmaps to be intercepted and the attribute information of the original picture recorded in the description file are set in the description file; the attribute information includes the name based on the original picture, the position of the bitmap to be intercepted in the original picture, the size of the bitmap to be intercepted, and the name of the generated target picture resource; according to the information set in the description file, an interception operation is performed based on the original picture to obtain the required bitmap, and the bitmap is renamed to obtain the target picture resource; as Figure 3 shown in (B) of, the generated target picture resource is applied to the dialing pad scenario in the contact application as the background picture of the dialing pad.

[0139] Figure 3This is just one of them. According to the needs of the system application scenario, during the installation of the theme package, based on the original pictures in the theme package, the description file in the theme package is converted into the required target picture resources. Only when the electronic device uses the installed theme package will the process of converting the description file into the target picture resources be executed, saving the storage space occupied by the theme package and enabling the electronic device to download and use more theme packages.

[0140] As Figure 4 shown in (A) of, the schematic diagram of the theme application interface in a screen form provided by an embodiment of the present application. The current user interface can be the general usage screen form of a common electronic device or the screen form of one side when the electronic device is folded. As Figure 4 shown in (A) of, the theme application scenario is the desktop wallpaper scenario of the desktop application in the normal screen form. Similar to Figure 3 the principle of (B) of, according to the system specification information set in the description file, the desktop wallpaper application scenario applicable to the normal screen form or the screen form of one side when folded is intercepted from the original picture.

[0141] As Figure 4 shown in (B) of, the schematic diagram of another theme application interface in a screen form provided by an embodiment of the present application. The current screen form is still the normal screen form or the screen form of one side when folded. The system application scenario applicable to the theme package is the application icon interface of the desktop application, and each application icon corresponds to a description file; according to each description file, based on the original picture, the target picture resources at the corresponding positions of all application icons are generated, and the target picture resources are applied to the application icons in the desktop application to complete the installation of the theme package applicable to this application scenario.

[0142] Specifically, for Figure 3 in (B), Figure 4 in (A) of, and Figure 4In (B) of [the above], each is an independent bitmap cropped from the original image one by one. The generated target image resource corresponding to it serves as the image resource required for an application scenario, that is, each description file corresponds to the generation of one target image resource, which is applied to various application scenarios. This description file is the first description file, that is, a simple description file with relatively simple description. The number of bitmaps to be cropped is defined in a simple description file. The shape of the cropped bitmap can be a rectangle, a circle or other shapes, without specific limitation; for the convenience of description, a rectangle is used in this embodiment for illustration. In the first description file, the number of cropped rectangles is defined as 1, that is, each first description file corresponds to the generation of one rectangular bitmap to obtain one target image resource. When multiple independent images are required, multiple simple description files are set, and cropping is performed based on different positions in the original image according to multiple simple description files to obtain multiple target image resources. For example, it is applied to the theme of the application icon interface in the desktop application, and the image corresponding to each application icon is generated by converting each first description file.

[0143] The name of the original image based on which is defined in the first description file. The corresponding original image resource in the theme package can be called according to the name of the original image; the two-dimensional coordinates in the original image of the upper left vertex of the required cropped rectangle are defined in the first description file: the horizontal coordinate and the vertical coordinate. For example, the horizontal coordinate "left" of the upper left vertex of the rectangle is defined as 21, and the vertical coordinate "top" is defined as 21 to determine the position information of the required cropped rectangle in the original image; the vertical length and the horizontal length of the required cropped rectangle in the two-dimensional coordinate system based on the original image are also defined in the first description file. For example, based on the upper left vertex of the rectangle, the vertical length "length" is defined as 10, and the horizontal length "width" is defined as 10 to determine the size of the required cropped rectangle; correspondingly, if the required cropped graphic is a circle, the coordinates of the center of the circle of the required cropped circle in the two-dimensional coordinate system based on the original image are located to determine the position information of the required cropped circle in the original image, and the radius length of the required cropped circle in the two-dimensional coordinate system based on the original image is defined to determine the size of the required cropped circle.

[0144] It should be noted that based on the size ratio and coordinate information corresponding to the display interface of the current system application scenario of the original image with the pixel points in the original image as the reference, the position information and size information of the required cropped graphic in the two-dimensional coordinate system based on the original image are determined, so as to obtain the required bitmap; in addition, specific length units can also be used as the reference of the two-dimensional coordinate system to determine the position information and size information, so as to obtain the specific size of the required image.

[0145] Taking the required cropped rectangle as an example, as Figure 5As shown in the figure, it is a coordinate schematic diagram of the theme picture of a system application scenario provided by an embodiment of the present application. In the original picture, the position of the vertex at the upper left corner of the rectangle in the original picture is determined, and the position of the vertex at the upper left corner of the rectangle in the original picture is defined as the origin of the two-dimensional coordinate system. According to the vertical length and horizontal length of the rectangle determined in the description file in the two-dimensional coordinate system, the corresponding rectangle is intercepted to obtain the required bitmap, and the required bitmap is renamed to obtain the target picture resource. When there are multiple first description files in the theme package, a complete set list of the first description files is generated, and all the first description files in the complete set list are traversed to convert the first description files into all the required target picture resources. This reduces the storage space occupied by the duplicate prefabricated picture resources in the theme package, saves the storage space of the electronic device, and improves the processing performance and transmission efficiency of the electronic device.

[0146] As Figure 6 shown in (A) in the figure, it is a schematic diagram of the theme application interface in another screen form provided by an embodiment of the present application. In this embodiment, the electronic device is a terminal that supports screen folding, such as a folding mobile phone; when the screen is unfolded into a tablet form, the application scenario of the theme is the desktop wallpaper scenario of the desktop application, which is based on the same principle as Figure 3 shown in (B) in the figure. According to the system specification information set in the description file, the target picture resource suitable for the desktop wallpaper in the tablet screen form is intercepted in the original picture.

[0147] As Figure 6 shown in (B) in the figure, it is another schematic diagram of the theme application interface in another screen form provided by an embodiment of the present application. The current screen form is still the tablet screen form, and the system application scenario applicable to the theme package is the application icon interface of the desktop application, and each application icon corresponds to a description file; according to each description file, based on the original picture, the target picture resources at the corresponding positions of all application icons are generated, and the target picture resources are applied to the application icons in the desktop application to complete the installation of the theme package applicable to this application scenario.

[0148] It should be noted that for different screen forms, the size ratios of the views and windows are different, and the positions and numbers of the icons in the desktop application display interface are determined according to the specific size of the screen display interface, that is, the position, size, and shape information of the required intercepted bitmap in the original picture are also different. Therefore, different screen forms need to be adapted to different theme packages.

[0149] In some embodiments of the present application, the description file of the theme package further includes a second description file, that is, a description file with relatively complex descriptions. In the second description file, it is defined that the number of bitmaps to be intercepted is at least two, the order of the intercepted bitmaps is determined, and the position information of the intercepted pictures is allocated according to the recorded position allocation information (i.e., the configuration coordinates layout). Two or more pictures are spliced according to the position information to obtain a target picture resource.

[0150] As Figure 7 shown, when intercepting rectangular bitmaps according to the description file, if the number of bitmaps to be intercepted defined in the description file is greater than or equal to 2, it is the second description file, that is, a complex description file. If the sizes of the multiple intercepted bitmaps are the same, the position information and size information of the first bitmap are defined, and the interception order and configuration coordinates of the multiple bitmaps are defined. The relative positions of the multiple bitmaps are determined according to the configuration coordinates, and the multiple bitmaps are spliced according to the relative positions of the multiple bitmaps to obtain a spliced bitmap, and the spliced bitmap is renamed to obtain a target picture resource. If the sizes of the multiple intercepted bitmaps are different, the size information of each bitmap, that is, the vertical length and horizontal length, is obtained from the second file; then, according to the configuration coordinates in the second description file, the positional relationship between each bitmap is determined, and then the multiple bitmaps are spliced according to the positional relationship to obtain a spliced bitmap, and the spliced bitmap is renamed to obtain the target picture resource. For example Figure 7 shown, in the application scenario of the contact list display interface of the contact application, according to the coordinate information and size information of each bitmap, bitmaps 71, 72, 73, 74, 75, and 76 are determined. According to the configuration coordinates between all the bitmaps, the relative positions between the bitmaps are determined, and the multiple bitmaps are spliced to obtain a target picture resource suitable for the contact list application scenario in the contact application. Among them, bitmaps 71, 72, and 73 correspond to the pictures at the top border, right border, and bottom border of the contact list display interface, and bitmaps 74, 75, and 76 are the pictures corresponding to the default avatars of the contact list.

[0151] As an illustrative example rather than a limitation, as Figure 8 shown in the schematic coordinate diagram of the principle of generating a target picture resource according to the complex description file, bitmaps at different positions in the original picture can be intercepted and then spliced to obtain the target picture resource. It should be noted that the splicing process is not to connect two or more bitmaps adjacent to each other pairwise; it can also be two non-adjacent position areas configured according to the application scenario requirements. For example Figure 7The application scenario when there are only pictures at the top and bottom borders. The complex description file defines the number of bitmaps to be intercepted, based on the name of the original picture, the position information and size information of each bitmap to be intercepted in the original picture, and the position allocation information between all bitmaps (i.e., the configuration coordinates layout); according to the above description information, the spliced bitmap is obtained, and the spliced bitmap is renamed to obtain a new picture resource. As Figure 8 shown in Figure 1 the bitmaps Figure 2 intercepted from the original picture, and the spliced bitmap obtained after splicing; among them, the definition of the configuration coordinates between multiple bitmaps can be defined through the positional relationship. Taking two bitmaps as an example, if the configuration coordinates are: "left" is 10, which means the horizontal position of the second bitmap on the first bitmap; "top" is 10, which means the vertical position of the second bitmap on the first bitmap. By defining the position coordinates, the positional relationship between multiple bitmaps is determined.

[0152] In a theme package, for a certain application scenario, it can include only the first description file, or only the second description file, or both the first description file and the second description file at the same time, which is specifically determined according to the system application scenario requirements of the electronic device. During the installation process of the theme package on the electronic device, according to the description file in the theme package, the operation of intercepting pictures from the original pictures is performed, and the description file is converted into picture resources, which reduces the storage space occupied by the theme package, improves the system processing performance of the electronic device, can meet the requirements of different system application scenarios and screen forms for the theme package, and can provide multiple scenario themes for the electronic device, enriching the user experience.

[0153] In some embodiments of the present application, the theme package supports dynamic display. A certain number of original pictures are stored in the theme package, and they can be displayed frame by frame at a preset frequency to achieve a dynamic display interface. Correspondingly, for different system application scenarios, based on the data processing principle of the above embodiments, for multiple original pictures, according to the bitmap quantity information, position information, size information, position allocation information, etc. defined in the description file, bitmaps are intercepted to generate multi-target picture resources corresponding to a theme interface, and according to the preset display frequency, the generated target picture resources are called to realize the application and display of dynamic themes in multiple application scenarios. In addition, the process and application of installing the theme package with dynamic display are also applicable to the above-mentioned different screen forms and system application scenarios.

[0154] As Figure 9 shown, it is a schematic flowchart of a theme package installation method provided by an embodiment of the present application. The method includes the following steps:

[0155] Step S901: Obtain the theme package to be installed, where the theme package contains at least one original picture of a predetermined size.

[0156] In some embodiments of the present application, the theme package to be installed can be downloaded wirelessly from a cloud server or can be an unused theme package stored locally on the electronic device. According to the system's views, window specifications, and the richness and diversity of the theme, the theme package can save at least one original picture of a predetermined size. The size of the original picture can be set according to the system specifications of the adapted electronic device, generally set to be larger than the size of the largest screen form of the electronic device; for a dynamically displayed theme, the theme package can contain multiple original pictures to be displayed at a preset frame rate.

[0157] Step S902: If the theme package contains a description file, traverse the description file, where the description file is created based on the system application scenario and the original picture.

[0158] In some embodiments of the present application, the theme package does not prefabricate a large number of picture resources. Instead, through the description file, according to the specification information set by the description file for the views, window specifications, and screen form of the electronic device, the original picture is intercepted in real time to obtain the theme picture resources required for the application scenario.

[0159] Among them, the description file is a file in which developers define the reference indicators of theme pictures for different models of systems and the views and window information corresponding to different application scenarios.

[0160] During the installation of the theme package, traverse all the description files in the theme package and execute the step process in the description file; by sequentially traversing the description files in the theme package, it is possible to avoid missing the description files and achieve the complete installation of the theme package.

[0161] In some embodiments, before traversing the description file, it includes:

[0162] Generate a complete set list of the description files, where the complete set list includes at least one first description file or at least one second description file; among them, the description complexity of the second description file is greater than that of the first description file, and each first description file or each second description file corresponds to a target picture resource respectively.

[0163] In some embodiments of the present application, the first description file is a description file with relatively simple description, that is, one bitmap is intercepted according to one first description file, and one bitmap corresponds to one target picture resource; the second description file is a description file with relatively complex description, that is, at least two bitmaps are intercepted according to one second description file, and the intercepted at least two bitmaps are spliced to obtain a spliced bitmap, and one spliced bitmap corresponds to one target picture resource.

[0164] Step S903: Generate a target picture resource according to the traversal result of the description file, and apply the target picture resource to the system application scenario.

[0165] In some embodiments of the present application, during the process of an electronic device installing a theme package, according to the description file of the theme package, the original pictures in the theme package are intercepted to obtain the required bitmaps; if it is a first description file, the intercepted bitmaps are renamed to obtain the target picture resources, and the target picture resources are applied to the adapted application scenarios; if it is a second description file, at least two intercepted bitmaps are spliced to obtain a spliced bitmap, the spliced bitmap is renamed to obtain the target picture resources, and the target picture resources are applied to the adapted application scenarios.

[0166] Among them, the adapted application scenarios include but are not limited to the system application scenarios described in the above embodiments, and are equally applicable to application scenarios such as the SMS application scenario and the notification bar multitasking where the system requires multiple picture resources.

[0167] Specifically, the applying the target picture resource to the system application scenario includes: applying the target picture resource to one or more of the system application scenarios such as the desktop application, the contacts and dialer applications, the SMS application, and the notification bar and multitasking applications.

[0168] As an example but not a limitation, the generating the target picture resource according to the traversal result of the description file includes: generating the target picture resource according to the number of bitmaps set in the description file and the attribute information of the original pictures recorded in the description file.

[0169] In some embodiments of the present application, the generating the target picture resource according to the traversal result of the description file includes:

[0170] If the currently traversed description file is a first description file, obtain the position information and size information of the bitmap to be intercepted in the original picture in the attribute information; according to the position information and the size information, generate a bitmap corresponding to each first description file; rename each bitmap corresponding to the first description file to obtain the target picture resource corresponding to each first description file.

[0171] In some embodiments of the present application, the generating the target picture resource according to the traversal result of the description file includes:

[0172] If the currently traversed description file is the second description file, obtain the position information of the bitmap to be intercepted in the original image in the attribute information, at least two size information, and position allocation information; generate at least two bitmaps corresponding to each second description file according to the position information and the at least two size information; splice the at least two bitmaps according to the position allocation information to obtain a spliced bitmap; rename the spliced bitmap corresponding to each second description file to obtain the target image resource corresponding to each second description file.

[0173] In some embodiments of the present application, the generating the target image resource according to the traversal result of the description file includes:

[0174] Generate the bitmap or the spliced bitmap according to the number of bitmaps set in the description file and the attribute information of the original image recorded in the description file; perform secondary processing on the bitmap or the spliced bitmap according to the bitmap drawing information in the description file to obtain various types of images; rename the images to obtain various types of the target image resources; wherein, the secondary processing includes one or more of scaling, cropping, rotating, offsetting, and rendering.

[0175] Specifically, in the description file, it may also include the process of secondary processing of the intercepted bitmap. In the process of the above embodiments, a rectangular bitmap can be obtained. In the actual application of the theme package, in order to increase the richness and diversity of the application scenarios, other graphics or images with diverse contents may be required, such as circles, arcs, or other irregular graphics, a set of images with similar painting styles or similar contents; specifically, it can be processed through the bitmap matrix operation process and the bitmap rendering process in the description file.

[0176] Exemplarily, the matrix operations of the bitmap include: scaling, cropping, rotating, offsetting, and these operations are described by a 3*3 matrix, and the content of the matrix can be marked as:

[0177] MSCALE_X MSKEW_X MTRANS_X

[0178] MSKEW_Y MSCALE_Y MTRANS_Y

[0179] MPERSP_0MPERSP_1MPERSP_2;

[0180] The corresponding meanings are:

[0181] Scaling X Offset X Translation X

[0182] Offset Y Scaling Y Translation Y

[0183] Perspective 0, Perspective 1, Perspective 2.

[0184] The description file may also include the above matrix. Before generating the target image resource, one or more operations such as scaling, cropping, rotating, and offsetting the bitmap are performed according to the values set in the matrix to obtain a new bitmap, and the new bitmap is renamed to obtain the target image resource adapted to the system application scenario.

[0185] On the other hand, in the Android system, a paint can also be set to perform a rendering operation on the intercepted bitmap. The bitmap is drawn on the canvas through the paint to generate a new bitmap, and the new bitmap is renamed to obtain the target image resource adapted to the system application scenario. Specifically, during the process of rendering the bitmap through the paint, an interface for calling the bitmap renderer is set, such as BitmapShader(Bitmap bitmap, Shader.TileMode tileX, Shader.TileMode tileY). Corresponding parameters are set for the interface. For example, the first parameter: the bitmap object bitmap to be processed; the second parameter: the effect of processing on the X-axis, where the rendering mode Shader.TileMode has three modes: stretching CLAMP, mirroring MIRROR, and repeating REPEAT; the third parameter: the effect of processing on the Y-axis, where the rendering mode Shader.TileMode has three modes: stretching CLAMP, mirroring MIRROR, and repeating REPEAT. The rendered bitmap is renamed to obtain the target image resource. Through the above implementation, it is possible to achieve the theme adaptation application of the pictures corresponding to personalized icons in the desktop application icon scenario; further, under the same storage space, the installation and use of the theme package of the electronic device are enriched.

[0186] Through the embodiments of the present application, according to an existing original picture of a predetermined size, picture resources corresponding to multiple small icons or picture resources of a complex display interface (an interface that displays partial image content of the original picture) are generated. In scenarios such as desktop wallpapers, desktop application icon scenarios, and the part of the contact dialer that uses the content on the wallpaper, it is possible to avoid prefabricating multiple picture resources of application icons in the theme package. Only before the system uses this theme package, the theme package is preprocessed to convert all description files into picture resources. This reduces the size of the theme package, saves the local storage space of the electronic device for placing the theme package and the storage space of the server for the theme package, and improves the transmission efficiency.

[0187] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0188] An embodiment corresponding to the theme package installation method and application scenario described in the above embodiment Figure 10 The block diagram of the structure of the theme package installation device provided by another embodiment of the present application is shown. For the convenience of description, only the parts related to the embodiments of the present application are shown.

[0189] Refer to Figure 10 This device includes an acquisition unit 101, a processing unit 102, and a generation unit 103. Among them, the functions of each unit are as follows:

[0190] The acquisition unit 101 is used to acquire the theme package to be installed, and the theme package contains at least one original picture of a predetermined size;

[0191] The processing unit 102 is used to traverse the description file if the theme package contains a description file, and the description file is created based on the system application scenario and the original picture;

[0192] The generation unit 103 is used to generate target picture resources according to the traversal result of the description file, and apply the target picture resources to the system application scenario.

[0193] Through the embodiments of the present application, during the process of installing the theme package on the electronic device, all description files in the theme package can be traversed; according to the description file created based on the original picture of a predetermined size in the theme package, target picture resources that conform to the system application scenario can be generated; since only the original pictures are stored in the theme package, the number of duplicate prefabricated picture resources in the theme package is reduced, the volume of the theme package is reduced, so that the storage space occupied by the duplicate prefabricated picture resources in the theme package can be reduced, and the processing performance and transmission efficiency of the electronic device are improved. According to the system application scenario and user needs, the electronic device can install and store multiple theme packages suitable for different system application scenarios.

[0194] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above-mentioned division of each functional unit and module is used as an example for illustration. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments and will not be described in detail here.

[0195] An embodiment of the present application further provides an electronic device, which includes one or more processors, a memory, and a display screen; the memory and the display screen are coupled to the one or more processors, and the memory is used to store computer program code, and the computer program code includes computer instructions; when the one or more processors execute the computer instructions, the electronic device is caused to execute any one of the theme package installation methods.

[0196] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, the computer program including instructions, which when running on an electronic device, cause a computer or a processor to execute one or more steps in any one of the above methods.

[0197] An embodiment of the present application further provides a computer program product containing instructions. When the computer program product runs on an electronic device or a processor, a computer or a processor is caused to execute one or more steps in any one of the above methods.

[0198] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center containing one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.

[0199] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by hardware instructed by a computer program. This program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage medium includes various media that can store program codes, such as ROM or random access memory (RAM), magnetic disks, or optical discs.

[0200] As described above, the above are only the specific implementation manners of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.

Claims

1. A method for installing a theme package, characterized in that, Including: Obtain a theme package to be installed, where the theme package contains at least one original picture of a predetermined size; The size specification of the original picture is greater than or equal to the size of the largest screen form of the electronic device; If the theme package contains a description file, traverse the description file, where the description file is created based on the system application scenario and the original picture; Generate target picture resources according to the traversal result of the description file, and apply the target picture resources to the system application scenario, including: generating the target picture resources according to the number of bitmaps set in the description file and the attribute information of the original picture recorded in the description file; Generating the target picture resources according to the number of bitmaps set in the description file and the attribute information of the original picture recorded in the description file includes: if the currently traversed description file is the first description file, obtain the position information and size information of the bitmap to be intercepted in the original picture in the attribute information; perform an interception operation on the original picture based on the position information and the size information to generate a bitmap corresponding to each first description file; rename each bitmap corresponding to the first description file to obtain the target picture resources corresponding to each first description file.

2. The method according to claim 1, wherein Before traversing the description file, including: Generate a complete set list of the description files, where the complete set list includes at least one first description file or at least one second description file; Among them, the description complexity of the second description file is greater than that of the first description file, and each first description file or each second description file corresponds to a target picture resource respectively.

3. The method according to claim 1, wherein The applying the target picture resources to the system application scenario includes: Apply the target picture resources to one or more of the system application scenarios such as the desktop application, the contacts and dialer applications, the text message application, the notification bar and multitasking applications.

4. The method according to claim 1, characterized in that The generating target picture resources according to the traversal result of the description file includes: If the currently traversed description file is the second description file, obtain the position information of the bitmap to be intercepted in the original picture in the attribute information, at least two pieces of size information and position allocation information; Generate at least two bitmaps corresponding to each second description file according to the position information and the at least two pieces of size information; Stitch the at least two bitmaps according to the position allocation information to obtain a stitched bitmap; Rename the stitched bitmap corresponding to each second description file to obtain the target picture resources corresponding to each second description file.

5. The method according to claim 1, wherein The generating target picture resources according to the traversal result of the description file includes: Generate the bitmap or the stitched bitmap according to the number of bitmaps set in the description file and the attribute information of the original picture recorded in the description file; Perform secondary processing on the bitmap or the stitched bitmap according to the bitmap drawing information in the description file to obtain various types of pictures; Rename the pictures to obtain various types of the target picture resources; Among them, the secondary processing includes one or more of scaling, cropping, rotating, offsetting, and rendering.

6. A theme package installation device, characterized in that, It includes: An acquisition unit for acquiring a theme package to be installed, where the theme package contains at least one original picture of a predetermined size; The size specification of the original picture is greater than or equal to the size of the largest screen form of the electronic device; A processing unit for traversing the description file if the theme package contains a description file, where the description file is created based on the system application scenario and the original picture; A generation unit for generating a target picture resource according to the traversal result of the description file and applying the target picture resource to the system application scenario, including: generating the target picture resource according to the number of bitmaps set in the description file and the attribute information of the original picture recorded in the description file; Generating the target picture resource according to the number of bitmaps set in the description file and the attribute information of the original picture recorded in the description file, includes: if the currently traversed description file is the first description file, obtaining the position information and size information of the bitmap to be intercepted in the original picture in the attribute information; performing an interception operation on the original picture based on the position information and the size information to generate a bitmap corresponding to each first description file; renaming each bitmap corresponding to the first description file to obtain the target picture resource corresponding to each first description file.

7. An electronic device, characterized in that, The electronic device includes one or more processors, a memory, and a display screen; The memory and the display screen are coupled to the one or more processors, and the memory is used to store computer program code, and the computer program code includes computer instructions; When the one or more processors execute the computer instructions, the electronic device is caused to execute the theme package installation method according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program includes instructions, and when the instructions run on the electronic device, the electronic device is caused to execute the theme package installation method according to any one of claims 1 to 5.

9. A computer program product comprising instructions, characterized in that, When the computer program product runs on the electronic device, the electronic device is caused to execute the theme package installation method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Electronic equipment application program interface display system and method

    CN101247403A

  • Icon display method and icon display device

    CN106843639A