Picture switching method and electronic equipment
By displaying the original image and loading the thumbnail image during fast sliding operation in electronic devices, the problems of slow image loading speed and high memory usage caused by fast sliding are solved, and faster image switching and lower memory usage are achieved.
Patent Information
- Application Number
- CN202311868234.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-08
AI Technical Summary
In electronic devices, fast sliding operations lead to problems such as slow image loading speed and high memory usage.
When a fast sliding operation is detected, the original image of the first picture is displayed and the thumbnail of the second picture is loaded. The clarity and storage space of the thumbnail are much smaller than the original picture, thereby improving the parsing speed and reducing memory usage.
It effectively improves the problem of slow image loading speed and high memory usage caused by fast sliding operations, and improves the efficiency of image switching.
Smart Images

Figure CN120276640A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and particularly to a method for switching pictures and an electronic device. Background Art
[0002] With the continuous development of electronic devices, in addition to application icons, electronic devices also allow users to add the tool components (widgets) of any application to the desktop of the electronic device in the form of desktop cards. Users can quickly and directly view the display information related to the application through the desktop cards. For example, users can add the widget of the gallery application to the desktop of the electronic device in the form of a desktop card to quickly view the pictures in the gallery application.
[0003] In addition, when the user intends to view other pictures in the gallery application, the user can also perform a sliding operation in the desktop card. The electronic device can parse the original picture of the previous picture (or the next picture) of the currently displayed picture according to the sliding direction corresponding to the user's sliding operation and display it on the desktop card.
[0004] However, when the user continuously performs sliding operations within a very short period of time (for example, 1 second), that is, when the user performs a fast sliding operation on the desktop card, for each sliding operation, the electronic device needs to parse and display the original picture corresponding to the sliding operation according to the sliding direction of the sliding operation, resulting in problems such as slow picture loading speed and high memory occupancy rate. Summary of the Invention
[0005] Embodiments of this application provide a method for switching pictures and an electronic device, which can effectively improve the problems of slow picture loading speed and high memory occupancy rate caused by fast sliding operations.
[0006] To achieve the above object, the embodiments of this application adopt the following technical solutions:
[0007] In a first aspect, this application provides a method for switching pictures, which is applied to an electronic device. The method includes: in response to a trigger operation, determining the operation type of the trigger operation; and when the operation type is a predicted trigger operation, displaying the original picture of the first picture and loading the thumbnail of the second picture.
[0008] The second picture is the picture displayed after the first picture.
[0009] The duration between the predicted trigger operation and the previous trigger operation is less than a preset duration. The preset duration can be 300 milliseconds (ms), or can be 200 ms. This application does not make a specific limitation on the preset duration.
[0010] As can be seen from the above method, when the duration between the current trigger operation and the previous trigger operation is less than a preset duration (for example, when the trigger operation is a fast sliding operation), the electronic device can display the original image of the first picture while loading the thumbnail of the second picture. The clarity of the thumbnail is much lower than that of the original image. Therefore, the speed of parsing the thumbnail is not only faster than that of parsing the original image, but also the storage space occupied by the thumbnail is much smaller than that of the original image, effectively improving the problems of slow image loading speed and high memory occupancy rate caused by fast sliding operations in the prior art.
[0011] In an alternative embodiment, when the operation type is not the expected trigger operation, the electronic device can display the original image of the first picture and load the original image of the second picture.
[0012] By the above method, the execution steps of the electronic device when the operation type is not the expected trigger operation are improved, making the image switching method provided by this application more complete. In addition, when the operation is not the expected trigger operation, loading the original image of the second picture can more quickly load the second picture when subsequently responding to the user's trigger operation to switch the picture displayed by the display component from the first picture to the second picture, improving the image loading speed.
[0013] In an alternative embodiment, the trigger operation can be an operation on the desktop card of the electronic device. The desktop card may include a display component and a plurality of preloading components. The display component is used to display the picture shown on the desktop card. The preloading component is used to load the picture to be displayed. The plurality of preloading components include a first preloading component.
[0014] On this basis, when the electronic device displays the original image of the first picture and loads the thumbnail of the second picture, it can display the original image of the first picture through the display component and load the thumbnail of the second picture through the first preloading component.
[0015] By the above method, a specific application scenario (applied to the desktop card) of the above image switching method is given, making the image switching method provided by this application more concrete.
[0016] In an alternative embodiment, the electronic device can respond to the operation of creating a desktop card and create a desktop card through a custom component.
[0017] Among them, the custom component includes at least one function control. Any function control is used to instruct the electronic device to execute the function corresponding to the function control.
[0018] In the above manner, the process of creating a desktop card for a target application on the desktop of the electronic device is enriched, so that subsequent users can perform a sliding operation in the desktop card, and the electronic device can execute the above-mentioned picture switching method, making the picture switching method provided by this application more complete.
[0019] In addition, the layout and style of each control in the custom component can not only be adjusted and modified accordingly according to the user's intention, but the custom component can also support adding various functional controls, so that the desktop card created through the custom component supports the functions corresponding to each control. For example, a sliding control can be added to the custom component, and the sliding control is used to support sliding the pictures in the desktop card. Correspondingly, the desktop card can support the picture sliding function. For another example, a refresh control can be added to the custom component, and the refresh control is used to support refreshing the pictures in the desktop card. Correspondingly, the desktop card can update the pictures in the target application according to a preset refresh duration.
[0020] In an optional implementation manner, the desktop card is created for a target application. When the electronic device creates a desktop card through the custom component in response to the operation of creating a desktop card, it can also perform verification on the target application in response to the operation of creating a desktop card; in the case where the target application belongs to the preset whitelist application, create a desktop card through the custom component.
[0021] In the above manner, after passing the verification, the electronic device can create a desktop card for the target application through the custom component, which not only enriches the process of creating a desktop card by the electronic device through the custom component, but also enhances the security of the desktop card creation process, so as to ensure that a desktop card is created for the application software that meets the constraint conditions, thereby improving the rigor of the picture switching method provided by this application.
[0022] In an optional implementation manner, the specification of the original picture of the above-mentioned first picture is the same as the card specification of the desktop card.
[0023] In the above manner, when the electronic device displays the original picture of the first picture, it can display the original picture of the first picture that is the same as the card specification, so that the size of the first picture matches the desktop card, thereby effectively improving the display effect of the desktop card and avoiding the phenomenon of the picture not matching the desktop card.
[0024] In an optional implementation manner, multiple preloading components can be used to load the thumbnail of the picture to be displayed. On this basis, before the electronic device displays the original picture of the first picture through the display component, it can also obtain the thumbnail of the first picture from the multiple preloading components; based on the thumbnail of the first picture, determine the picture path of the first picture, and finally obtain the original picture of the first picture based on the picture path and the first interface.
[0025] Among them, the first interface is used to obtain the original image of the picture. The picture path is used to indicate the storage location of the picture.
[0026] Through the above method, a specific implementation manner for an electronic device to obtain the original image of the first picture based on the thumbnail of the first picture is provided, which improves the feasibility of the picture switching method provided in this application.
[0027] In an alternative embodiment, before loading the thumbnail of the second picture, the electronic device can also obtain the picture path of the second picture, and then obtain the thumbnail of the second picture based on the picture path and the second interface.
[0028] Among them, the second interface is used to obtain the thumbnail of the picture. The picture path is used to indicate the storage location of the picture;
[0029] Through the above method, a specific implementable manner for an electronic device to load the thumbnail of the second picture is provided, which further improves the feasibility of the picture switching method provided in this application.
[0030] In a second aspect, this application also provides an electronic device, including a processor and a memory. The processor is coupled to the memory, and the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the electronic device implements the method according to any one of the first aspect.
[0031] In a third aspect, this application provides a computer-readable storage medium, including computer instructions; when the computer instructions run on an electronic device, the electronic device is caused to execute the method according to any one of the first aspect.
[0032] In a fourth aspect, this application provides a computer program product. When the computer program product runs on a computer, the computer is caused to execute the method according to the first aspect and any possible design manner thereof.
[0033] In a fifth aspect, this application provides a chip system, which includes one or more interface circuits and one or more processors. The interface circuits and the processors are interconnected by lines. The above chip system can be applied to an electronic device including a communication module and a memory. The interface circuit is used to receive a signal from the memory of the electronic device and send the received signal to the processor. The signal includes computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device can execute the method according to the first aspect and any possible design manner thereof.
[0034] Understandably, for the beneficial effects that can be achieved by the electronic device in the second aspect, the computer-readable storage medium in the third aspect, the computer program product in the fourth aspect, and the chip system in the fifth aspect provided above, reference can be made to the beneficial effects in the first aspect and any of its possible design manners, which will not be elaborated here. Description of the Drawings
[0035] Figure 1 A desktop schematic diagram of an electronic device provided by an embodiment of the present application;
[0036] Figure 2 A structural schematic diagram of an electronic device provided by an embodiment of the present application;
[0037] Figure 3 A software structure block diagram of an electronic device provided by an embodiment of the present application;
[0038] Figure 4 A flowchart of a picture switching method provided by an embodiment of the present application;
[0039] Figure 5 A layout schematic diagram between a display component and a preloading component provided by an embodiment of the present application;
[0040] Figure 6 A flowchart of a desktop card creation method provided by an embodiment of the present application;
[0041] Figure 7 A desktop schematic diagram of an electronic device provided by an embodiment of the present application;
[0042] Figure 8 A schematic diagram of an operable interface provided by an embodiment of the present application;
[0043] Figure 9 Another layout schematic diagram between a display component and a preloading component provided by an embodiment of the present application;
[0044] Figure 10 An interaction flowchart of another desktop card creation method provided by an embodiment of the present application;
[0045] Figure 11 An interaction flowchart of another picture switching method provided by an embodiment of the present application. Detailed Embodiments
[0046] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, "at least one" means one or more, and "a plurality" means two or more than two. In addition, in order to clearly describe the technical solutions in the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and roles. Those skilled in the art can understand that the terms "first", "second", etc. do not limit the quantity and execution order, and the terms "first", "second", etc. do not necessarily limit being different.
[0047] With the continuous development of communication technologies, electronic devices (such as smart phones) have become more and more popular and diversified. Regarding the human-computer interaction interface for the interaction between an electronic device and a user, its usability and friendliness have received increasing attention. The desktop of an electronic device is not only the operation entry for each application on the electronic device, but also an important interface carrier.
[0048] On the desktop of a traditional electronic device, application icons of each application installed in the electronic device are displayed, and the user can click on the application icon of any application to start the application. With the continuous development of electronic devices, in addition to application icons, the electronic device also allows the user to add the tool component (widget) of any application to the desktop of the electronic device in the form of a desktop card, and the user can quickly and directly view the display information related to the application through the widget.
[0049] In some embodiments, the user can add the widget of the gallery application to the desktop of the electronic device in the form of a desktop card. Exemplarily, as Figure 1 shown, the desktop card 101 is the widget of the gallery application, and the user can directly view the pictures in the gallery application through the desktop card 101.
[0050] In addition, when the user intends to view other pictures in the gallery application, the user can also perform a sliding operation in the desktop card, and the electronic device can parse the original picture of the previous picture (or the next picture) of the currently displayed picture according to the sliding direction corresponding to the user's sliding operation, and display it on the desktop card.
[0051] However, when the user continuously performs sliding operations within a very short period of time (such as 1 second), that is, when the user performs a rapid sliding operation on the desktop card, for each sliding operation, the electronic device needs to parse and display the original picture corresponding to the sliding direction of the sliding operation, resulting in problems such as slow picture loading speed and high memory occupancy rate.
[0052] To improve the above problems, an embodiment of the present application provides a picture switching method, which is applied to an electronic device. Specifically, the electronic device can respond to a trigger operation, determine the operation type of the trigger operation, and then, when the operation type is a predicted trigger operation, determine a first picture from the pictures to be displayed, and display the original picture of the first picture through a display component; and determine a second picture, and then load a thumbnail of the second picture through a preloading component. The pictures to be displayed are pictures loaded through the preloading component of the desktop card; the predicted trigger operation is used to indicate that the time duration between the trigger operation and the previous trigger operation is less than a preset time duration, and the second picture at least includes the display picture currently displayed on the electronic device.
[0053] As can be seen from the above method, when the time duration between the trigger operation and the previous trigger operation is less than the preset time duration, that is, the trigger operation is a fast sliding operation, the electronic device can only display the original picture of the first picture on the display component, and load the thumbnail of the second picture on the preloading component. The clarity of the thumbnail is much less than that of the original picture. Therefore, the speed of parsing the thumbnail is not only faster than that of parsing the original picture, but also the storage space occupied by the thumbnail is much less than the storage space occupied by the original picture, so as to effectively improve the problems of slow picture loading speed and high memory occupancy rate caused by fast sliding operations in the prior art.
[0054] Exemplarily, the electronic device in the embodiment of the present application may be a mobile phone, a tablet computer, a smart watch, a desktop type, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) / virtual reality (VR) device, etc., which are devices including a display screen. The embodiment of the present application does not impose special restrictions on the specific form of the electronic device.
[0055] Please refer to Figure 2 , which is a schematic structural diagram of an electronic device 200 provided by an embodiment of the present application. As Figure 2As shown, the electronic device 200 may include: a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc.
[0056] Among them, the above-mentioned sensor module 280 may include sensors such as a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor.
[0057] It can be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 200. In other embodiments, the electronic device 200 may include more or fewer components than shown, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0058] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modulation and demodulation 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.
[0059] The controller may be the nerve center and command center of the electronic device 200. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
[0060] A memory can also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can hold the instructions or data that the processor 210 has just used or recycled. If the processor 210 needs to use the instruction or data again, it can be directly called from the said memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0061] In some embodiments, the processor 210 may include one or more interfaces. The interfaces can 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.
[0062] It can be understood that the interface connection relationships between the modules illustrated in this embodiment are only illustrative and do not constitute a structural limitation on the electronic device 200. In other embodiments, the electronic device 200 may also adopt different interface connection methods or combinations of multiple interface connection methods in the above embodiments.
[0063] The charging management module 240 is used to receive a charging input from a charger. Herein, the charger can be a wireless charger or a wired charger. While charging the battery 242, the charging management module 240 can also supply power to the electronic device through the power management module 241.
[0064] The power management module 241 is used to connect the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives the inputs from the battery 242 and / or the charging management module 240 and supplies power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the wireless communication module 260, etc. In some embodiments, the power management module 241 and the charging management module 240 may also be provided in the same device.
[0065] The wireless communication function of the electronic device can be implemented by Antenna 1, Antenna 2, Mobile Communication Module 250, Wireless Communication Module 260, Modulation and Demodulation Processor, and Baseband Processor, etc. In some embodiments, Antenna 1 of the electronic device is coupled to Mobile Communication Module 250, and Antenna 2 is coupled to Wireless Communication Module 260, enabling the electronic device to communicate with the network and other devices through wireless communication technologies, such as communicating with wearable devices.
[0066] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 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, 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.
[0067] Mobile Communication Module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device. Mobile Communication Module 250 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. Mobile Communication Module 250 can receive electromagnetic waves by Antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves, and transmit them to the Modulation and Demodulation Processor for demodulation.
[0068] Mobile Communication Module 250 can also amplify the signal modulated by the Modulation and Demodulation Processor, and convert it into electromagnetic waves through Antenna 1 and radiate it out. In some embodiments, at least some functional modules of Mobile Communication Module 250 can be provided in Processor 210. In some embodiments, at least some functional modules of Mobile Communication Module 250 and at least some modules of Processor 210 can be provided in the same device.
[0069] Wireless Communication Module 260 can provide solutions for wireless communications including WLAN (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared Technology (IR), etc. applied to the electronic device.
[0070] Among them, GNSS may include Beidou Navigation Satellite System (BDS), Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).
[0071] The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 may also receive the signals to be sent from the processor 210, perform frequency modulation on them, amplify them, and convert them into electromagnetic waves through the antenna 2 for radiation.
[0072] The electronic device 200 realizes the display function through the GPU, the display screen 294, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor. The GPU is used to execute mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or change the display information.
[0073] The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel.
[0074] The electronic device 200 can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294, and the application processor, etc. The ISP is used to process the data fed back by the camera 293.
[0075] The camera 293 is used to capture static images or videos. In some embodiments, the electronic device may include one or N cameras 293, where N is a positive integer greater than 1. The above N cameras 293 may include a camera with a TOF camera sensor and a camera with an RGB camera sensor.
[0076] The external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the electronic device. The external memory card communicates with the processor 210 through the external memory interface 220 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0077] The internal memory 221 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 221. For example, in the embodiments of the present application, the processor 210 can execute the instructions stored in the internal memory 221, and the internal memory 221 can include a program storage area and a data storage area.
[0078] Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device (such as audio data, a phone book, etc.). In addition, the internal memory 221 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0079] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
[0080] The software system of the electronic device 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 application, taking the system with a layered architecture as an example, the software structure of the electronic device is exemplarily described.
[0081] Figure 3 The software structure block diagram of the electronic device provided by the embodiments of the present application is shown. 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 are the application layer, the application framework layer, the Android runtime and the system library, and the kernel layer.
[0082] The application layer may include a series of application packages. Exemplarily, the application packages may include applications such as desktop, gallery, music, video, and short message. Each application may also include a desktop card module and a desktop card data management module. For example, the gallery application may include a gallery desktop card module and a gallery desktop card data management module. The gallery desktop card data management module stores picture information (such as picture path, picture shooting time, etc.) of each picture included in the gallery application. The gallery desktop card module can parse out the thumbnail and original picture of the picture according to the picture path of each picture.
[0083] 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. Exemplarily, the application framework layer may include a widget framework, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, an edit manager, etc.
[0084] 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.
[0085] The content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc.
[0086] The view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.
[0087] The phone manager is used to provide the communication function of the electronic device. For example, the management of call status (including connection, disconnection, etc.).
[0088] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.
[0089] The notification manager enables an application to display notification information in the status bar. It can be used to convey informational messages, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that a download is complete, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of background running applications, or a notification that appears on the screen in the form of a dialogue window. For example, it can prompt text information in the status bar, emit a prompt tone, vibrate the electronic device, blink the indicator light, etc.
[0090] The edit manager is used to provide editing functions corresponding to each editing option when the application needs to edit data, so as to realize the editing of data (such as multimedia resources) in the application.
[0091] Android Runtime includes core libraries and a virtual machine. Android Runtime is responsible for the scheduling and management of the Android system.
[0092] The core libraries consist of 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.
[0093] 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 object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0094] The system libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0095] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0096] The media libraries support the playback and recording of various common audio and video formats, as well as static image files, etc. The media libraries can support multiple audio and video coding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0097] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.
[0098] The 2D graphics engine is a graphics engine for 2D drawing.
[0099] The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
[0100] The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure and the above software structure.
[0101] Taking the electronic device as a mobile phone as an example, the picture switching method provided by the embodiments of the present application will be described below with reference to the accompanying drawings.
[0102] In some embodiments, the picture switching method provided by the embodiments of the present application is applied to the desktop card of the electronic device, and can also be applied to the negative first screen interface of the electronic device, and can also be applied to the pull-down notification bar and standby scenarios of the electronic device, etc. The following takes the application to the desktop card of the electronic device as an example for introduction.
[0103] Each desktop card may include a display component (view) and multiple pre-loaded views. The display view is used to display the picture shown on the desktop card, and the pre-loaded view is used to load the picture to be displayed (such as the previous picture and / or the next picture of the picture shown on the desktop card).
[0104] Figure 4 It is a flowchart of a picture switching method provided by the embodiments of the present application. This method is applied to the above electronic device, as Figure 4 shown, the method includes:
[0105] S401, in response to a trigger operation, determine the duration between this trigger operation and the previous trigger operation.
[0106] Among them, the trigger operation is used to trigger the electronic device to switch the picture displayed on the desktop of the electronic device. Taking the trigger operation as an example for triggering the electronic device to switch the picture displayed on the desktop card of the electronic device, the trigger operation can be a sliding operation. The user can slide the desktop card of the electronic device to switch the picture displayed in the desktop card. For another example, the trigger operation can also be a click operation. The user can click the desktop card of the electronic device to switch the picture displayed in the desktop card.
[0107] The following takes this trigger operation as a sliding operation for illustration.
[0108] In the embodiments of the present application, the sliding operation can be a vertical slide or a horizontal slide. The embodiments of the present application do not make specific limitations on this.
[0109] In specific implementation, taking the example of a user's intention to switch the picture displayed in the desktop card of the mobile phone gallery application, the user can perform a sliding operation on the desktop card of the gallery application. After receiving the sliding operation, the mobile phone can respond to the sliding operation, obtain the trigger moment of the sliding operation, and determine the duration between the trigger moment of the sliding operation and the trigger moment of the previous sliding operation used to slide the desktop card according to the trigger moment of the sliding operation and the trigger moment of the previous sliding operation used to slide the desktop card.
[0110] Among them, the trigger moment of the sliding operation can be the moment when the electronic device senses the user's finger.
[0111] S402. Determine the operation type of the trigger operation according to the duration.
[0112] After determining the duration between the trigger operation and the previous trigger operation through S401, the electronic device can compare the duration with a preset duration. If the duration is less than the preset duration, the electronic device can determine the operation type of this trigger operation as an expected trigger operation; if the duration is greater than the preset duration, the electronic device can determine that the operation type of this trigger operation is not an expected trigger operation.
[0113] Among them, the expected trigger operation is used to represent that the duration between this trigger operation and the previous trigger operation is less than the preset duration.
[0114] In the embodiments of the present application, the preset duration is not specifically limited. For example, the preset duration can be 300 milliseconds (ms), or it can also be 200 ms.
[0115] S403. Whether the operation type of the trigger operation is an expected trigger operation; if so, execute S404; if not, execute S405.
[0116] S404. Display the original picture of the first picture and load the thumbnail of the second picture.
[0117] Among them, the second picture is the picture displayed after the first picture.
[0118] Specifically, after the electronic device determines that the operation type of this trigger operation is an expected trigger operation, the electronic device can first determine the first picture from the pictures to be displayed, and then obtain and display the original picture of the first picture. At the same time, the electronic device can determine the second picture from the gallery, and then obtain and load the thumbnail of the second picture.
[0119] It can be understood that the above gallery can be a database for storing each picture, or it can also be a gallery application.
[0120] The following introduces S404 in combination with a specific scenario.
[0121] Taking the picture switching method provided by the embodiments of this application as an example, which is applied to the desktop card of the mobile phone gallery application, and the first preloading component is included in multiple preloading components of the desktop card, the electronic device can display the original picture of the first picture on the display component and load the thumbnail of the second picture through the first preloading component.
[0122] Specifically, after the electronic device determines that the operation type of this trigger operation is a predicted trigger operation, the electronic device can first determine the first picture from the pictures to be displayed loaded by multiple preloading components, then obtain the original picture of the first picture, and display the original picture of the first picture on the display component. At the same time, the electronic device can determine the second picture from the gallery, then obtain the thumbnail of the second picture, and load the thumbnail of the second picture on the first preloading component.
[0123] In some embodiments, when the above-mentioned electronic device obtains the original picture of the first picture, in the case where multiple preloading components of the desktop card are used to load the original pictures of the pictures to be displayed, after the electronic device determines the first picture from the pictures to be displayed loaded by multiple preloading components, it can directly transfer the original picture of the first picture to the display component for display.
[0124] In the case where multiple preloading components of the desktop card are used to load the thumbnails of the pictures to be displayed, the electronic device can first determine the thumbnail of the first picture from the pictures to be displayed loaded by multiple preloading components based on the switching direction of the trigger operation, then obtain the picture path indicating the picture storage location of the first picture based on the thumbnail of the first picture, and finally obtain the original picture of the first picture based on this picture path and the first interface.
[0125] The first interface is used to obtain the original picture of each picture. For example, the BitmapFactory.decodeFile() interface.
[0126] In specific implementation, taking the first interface as the BitmapFactory.decodeFile() interface, the preloading component includes a front preloading component and a rear preloading component. The front preloading component is used to load the previous picture of the picture displayed on the desktop card, and the rear preloading component is used to load the next picture of the picture displayed on the desktop card. The front preloading component loads the thumbnail of the first picture to be displayed, and the rear preloading component loads the thumbnail of the second picture to be displayed as an example. In the case where the switching direction of the trigger operation indicates that the electronic device switches to the next picture of the currently displayed picture, the electronic device can determine the thumbnail of the second picture to be displayed as the thumbnail of the first picture. In the case where the switching direction indicates that the electronic device switches to the previous picture of the currently displayed picture, the electronic device can determine the thumbnail of the first picture to be displayed as the thumbnail of the first picture.
[0127] After that, the electronic device can obtain the picture path of the first picture, and call the BitmapFactory.decodeFile() interface to parse the original picture of the first picture through the picture path of the first picture. Finally, the original picture of the first picture is displayed through the display component of the desktop card.
[0128] Exemplarily, assume that there are N (N is a positive integer greater than zero) pictures in total. The current displayed picture is the first picture, the pre - preloading component is viewA, the display component is viewB (viewB is used to load the first picture), and the post - preloading component is viewC. As Figure 5 shown, viewA is located before viewB, and viewC is located after viewB. Then viewC is used to load the thumbnail of the second picture, and viewC is used to load the thumbnail of the Nth picture.
[0129] In the case where the switching direction of the trigger operation indicates that the electronic device switches to the next picture (i.e., the second picture) of the first picture, the electronic device can determine the thumbnail of the second picture as the thumbnail of the first picture. After that, the electronic device can obtain the picture path of the second picture, and call the BitmapFactory.decodeFile() interface to parse the original picture of the second picture through the picture path of the second picture. Finally, the original picture of the second picture is displayed through the display component of the desktop card.
[0130] In the case where the switching direction of the trigger operation indicates that the electronic device switches to the previous picture (i.e., the Nth picture) of the first picture, the electronic device can determine the thumbnail of the Nth picture as the thumbnail of the first picture. After that, the electronic device can obtain the picture path of the Nth picture, and call the BitmapFactory.decodeFile() interface to parse the original picture of the Nth picture through the picture path of the Nth picture. Finally, the original picture of the Nth picture is displayed through the display component of the desktop card.
[0131] In some embodiments, the specifications of the original picture of the first picture are the same as the card specifications of the desktop card. For example, the length and width of the original picture of the first picture are respectively the same as the length and width of the desktop card.
[0132] In some embodiments, when the electronic device obtains the thumbnail of the second picture, it can first determine the second picture based on the switching direction of the trigger operation, then obtain the picture path of the second picture, and obtain the thumbnail of the second picture based on the picture path of the second picture and the second interface.
[0133] Among them, the second interface is used to obtain the thumbnail of each picture, such as the ContentResolver.loadThumbnail() interface.
[0134] In specific implementation, taking the second interface as the ContentResolver.loadThumbnail() interface, and the preloading component includes a pre-preloading component and a post-preloading component, where the pre-preloading component loads the first picture to be displayed and the post-preloading component loads the second picture to be displayed as an example. When the switching direction indicates that the electronic device switches to the next picture of the currently displayed picture, the electronic device can determine the currently displayed picture and the next picture of the second picture to be displayed as the second picture. When the switching direction indicates that the electronic device switches to the previous picture of the currently displayed picture, the electronic device can determine the currently displayed picture and the previous picture of the first picture to be displayed as the second picture.
[0135] After that, the electronic device can obtain the picture path of the second picture and call the ContentResolver.loadThumbnail() interface to resolve the thumbnail of the second picture through the picture path of the second picture, and finally load the thumbnail of the second picture through the preloading component of the desktop card.
[0136] Exemplarily, assume that there are N pictures in total, the currently displayed picture is the first picture, the pre-preloading component is viewA, the display component is viewB (viewB is used to load the first picture), and the post-preloading component is viewC. Continuing to refer to Figure 5 , viewA is located before viewB, and viewC is located after viewB, then viewC is used to load the second picture, and viewC is used to load the Nth picture.
[0137] When the switching direction of the triggering operation indicates that the electronic device switches to the second picture, the electronic device can determine the first picture and the third picture as the second picture. After that, the electronic device can obtain the picture paths of the first picture and the third picture and call the ContentResolver.loadThumbnail() interface to resolve the thumbnail of the first picture through the picture path of the first picture and resolve the thumbnail of the third picture through the picture path of the third picture. Finally, load the thumbnail of the first picture through viewA and load the thumbnail of the third picture through viewC.
[0138] When the electronic device switches to the Nth picture in response to the switching direction indication of the triggering operation, the electronic device may determine the (N - 1)th picture and the first picture as the second picture. Thereafter, the electronic device may obtain the picture paths of the first picture and the (N - 1)th picture, and call the ContentResolver.loadThumbnail() interface to resolve the thumbnail of the first picture through the picture path of the first picture, and resolve the thumbnail of the (N - 1)th picture through the picture path of the (N - 1)th picture. Finally, the thumbnail of the (N - 1)th picture is loaded through viewA, and the thumbnail of the first picture is loaded through viewC.
[0139] In some embodiments, the specifications of the thumbnail of the second picture are the same as the card specifications of the desktop card. For example, the length and width of the thumbnail of the second picture are the same as the length and width of the desktop card, respectively.
[0140] S405, display the original picture of the first picture, and load the original picture of the second picture.
[0141] The specific implementation manner of this step may refer to the description of S404 above, and will not be elaborated here.
[0142] Through the above method, when the duration between the triggering operation and the previous triggering operation is less than the preset duration, that is, the triggering operation is a fast sliding operation, the electronic device may only display the original picture of the first picture on the display component, and load the thumbnail of the second picture on the preloading component. The clarity of the thumbnail is much lower than that of the original picture. Therefore, the speed of parsing the thumbnail is not only faster than the speed of parsing the original picture, but also the storage space occupied by the thumbnail is much smaller than the storage space occupied by the original picture, so as to effectively improve the problems of slow picture loading speed and high memory occupancy rate caused by fast sliding operations in the prior art.
[0143] In the scenario where the picture switching method provided in the embodiments of the present application is applied to the mobile phone desktop card, before performing the Figure 4 picture switching method shown, the user may also create a desktop card for the target application on the desktop of the electronic device. Figure 6 FIG. is a flowchart of a desktop card creation method provided in the embodiments of the present application, which is applied to the above-mentioned electronic device, as Figure 6 shown, the method includes:
[0144] S601, in response to an operation of creating a desktop card for the target application, verify the target application.
[0145] The target application may include multiple pictures.
[0146] Specifically, the user can long-press the application icon of the target application on the desktop of the electronic device. The electronic device can respond to the long-press operation of the user on the application icon of the target application and display an operable interface including a creation control for creating a desktop card. The user can click the creation control on the operable interface. The electronic device responds to the click operation of the user on the creation control, obtains the application identifier of the target application, and determines whether the application identifier of the target application is included in the preset whitelist applications to implement the verification of the target application.
[0147] Exemplarily, assume Figure 7 is a schematic diagram of the desktop of the electronic device, and the target application is the gallery application. The user can long-press the application icon 701 of the gallery application on the Figure 7 schematic diagram of the desktop shown. The electronic device can respond to the long-press operation of the user on the application icon of the target application and display Figure 8 the operable interface 801 shown. The operable interface 801 includes a creation control 802. The user can click the creation control 802. The electronic device responds to the click operation of the user on the creation control 802, obtains the application identifier of the gallery application, and determines whether the application identifier of the gallery application is included in the preset whitelist applications to implement the verification of the gallery application.
[0148] S602, when the target application belongs to the preset whitelist applications, create a desktop card through a custom component.
[0149] The custom component can support adding at least one function control so that after the desktop card is created through the custom component, the electronic device can execute the functions corresponding to each function control. For example, a sliding control can be added to the custom component. The sliding control is used to support sliding the pictures in the desktop card. Correspondingly, the electronic device can support the above Figure 5 described picture sliding function. For another example, a refresh control can be added to the custom component. The refresh control is used to support refreshing the pictures in the desktop card. Correspondingly, the electronic device can update the pictures in the target application according to the preset refresh duration.
[0150] Among them, the refresh control can include but is not limited to the ViewPager control. The layout of the ViewPager control can be modified so that when displaying pictures or switching pictures subsequently, the electronic device can set the pictures that fill the widget according to the card specifications of the desktop card to improve the display effect of the pictures.
[0151] In addition, the layout and style of each control in the custom component can also be adjusted and modified according to the user's intention. Compared with the components with fixed styles and fixed layouts in the traditional technology, using the custom component can effectively increase the diversity of widgets.
[0152] After obtaining the application identifier of the gallery application through S601, if the application identifier of the gallery application is included in the preset whitelist applications, it indicates that the verification is passed, and the electronic device can create a desktop card including a display component and multiple preloading components, and display the desktop card on the desktop of the electronic device.
[0153] S603. Display the original image of the first picture in the target application on the display component.
[0154] Specifically, after creating the desktop card through S602, the electronic device can first detect the card specification of the desktop card, then obtain the picture path of the first picture in the target application, and according to the specification and the picture path of the first picture, obtain the original image of the first picture that is consistent with the card specification, and finally display the original image of the first picture on the display component.
[0155] In some embodiments, the specification of the desktop card may include the width of the desktop card and the height of the desktop card.
[0156] S604. Determine the pictures to be displayed corresponding to the preloading components from multiple pictures of the target application according to the positional relationship between each preloading component and the display component.
[0157] Specifically, the electronic device can first determine the positional relationship between each preloading component and the display component. If the preloading component is located before the display component, the picture before the first picture is used as the picture to be displayed corresponding to the preloading component. If the preloading component is located after the display component, the picture after the first picture is used as the picture to be displayed corresponding to the preloading component.
[0158] For example, assume that the target application contains N pictures, N is a positive integer greater than 0, the preloading components include a pre - front - loading component and a post - loading component, the pre - front - loading component is located before the display component, and the post - loading component is located after the display component. The electronic device can use the Nth picture as the picture to be displayed corresponding to the pre - front - loading component, and use the second picture as the picture to be displayed corresponding to the post - loading component.
[0159] For another example, assume that the target application contains N pictures, and the preloading components include a first preloading component, a second preloading component, a third preloading component, and a fourth preloading component. Among them, the relationship between the display component, the first preloading component, the second preloading component, the third preloading component, and the fourth preloading component is as Figure 9As shown, the third preloading component is located before the first preloading component, the first preloading component is located before the display component, the second preloading component is located after the display component, and the fourth preloading component is located after the second preloading component. The electronic device can use the (N - 1)th picture as the picture to be displayed corresponding to the third preloading component, the Nth picture as the picture to be displayed corresponding to the first preloading component, the second picture as the picture to be displayed corresponding to the second preloading component, and the third picture as the picture to be displayed corresponding to the fourth preloading component.
[0160] S605. Load the original picture of the picture to be displayed on the preloading component.
[0161] Specifically, after determining the pictures to be displayed corresponding to each preloading component through S604, the electronic device can obtain the picture paths of each picture to be displayed, and then parse the original pictures of each picture to be displayed that are consistent with the specification according to the specification of the desktop card and the picture paths of each picture to be displayed. Finally, load the original pictures of each picture to be displayed on each preloading component.
[0162] In a specific implementation, taking the target application containing N pictures, the preloading component including a front preloading component and a rear preloading component, the front preloading component being located before the display component, and the rear preloading component being located after the display component as an example, the electronic device can first obtain the picture path of the second picture and the picture path of the Nth picture, and then parse the original picture of the second picture that is equal to the specification according to the specification of the desktop card and the picture path of the second picture, and parse the original picture of the Nth picture that is equal to the specification according to the specification and the picture path of the Nth picture. Finally, load the original picture of the Nth picture on the front preloading component and load the original picture of the second picture on the rear preloading component.
[0163] Through the above method, the process of the electronic device creating a desktop card for the target application on the desktop is enriched, so that the subsequent user can perform a sliding operation in the desktop card, and the electronic device can execute the above picture switching method, making the picture switching method provided by this application more complete.
[0164] In addition, the layout and style of each control in the custom component can not only be adjusted and modified accordingly according to the user's intention, but the custom component can also support adding various function controls so that the desktop card created through the custom component supports the functions corresponding to each control. For example, a sliding control can be added to the custom component, and the sliding control is used to support sliding the pictures in the desktop card. Correspondingly, the desktop card can support the picture sliding function. Another example is that a refresh control can be added to the custom component, and the refresh control is used to support refreshing the pictures in the desktop card. Correspondingly, the desktop card can update the pictures in the target application according to the preset refresh duration.
[0165] In some embodiments, the above-mentioned Figure 4 picture switching method and the above-mentioned Figure 6 desktop card creation method can also be implemented through the Figure 3 application layer and application framework layer shown below. Taking the target application as the gallery application, the preloading components include a pre-preloading component and a post-preloading component, and the specifications of the desktop card include the width and height of the desktop card as an example, the Figure 6 desktop card creation method shown below and the Figure 4 picture switching method shown below will be introduced.
[0166] Figure 10 FIG. shows an interaction flowchart of another desktop card creation method provided by an embodiment of the present application. This method is interactively implemented by a desktop application (hereinafter simply referred to as the desktop) in the application layer shown below, a gallery desktop card module and a gallery desktop card data management module in the gallery application (hereinafter simply referred to as the gallery), and a widget framework in the application framework layer. As Figure 3 shown below, this method includes: Figure 10
[0167] S1001, the desktop responds to an operation of creating a desktop card for the gallery application, and obtains the application identifier of the gallery application.
[0168] S1002, the desktop sends a creation request carrying the application identifier of the gallery application to the widget framework.
[0169] S1003, the widget framework sends a component creation instruction to the gallery desktop card module based on the application identifier of the gallery application.
[0170] S1004, the gallery desktop card module responds to the component creation instruction and creates a custom view layout.
[0171] In order to enable this custom view layout to be presented on the desktop of the electronic device in the form of a desktop card, this custom view layout can be a view inherited from RemoteView.
[0172] S1005, the gallery desktop card module adds a ViewPager to the custom view layout.
[0173] Among them, the ViewPager can be used to implement the sliding browsing of pictures.
[0174] S1006, the gallery desktop card module adds viewA, viewB, and viewC to the ViewPager.
[0175] Among them, viewB is a display component, viewA is located in front of viewB and is a preloaded component, and viewC is located behind viewB and is a postloaded component.
[0176] S1007, the gallery desktop card module sends a custom view layout including ViewPager, viewA, viewB, and viewC to the widget framework.
[0177] S1008, after receiving the custom view layout, the widget framework verifies the target application according to the application identifier of the target application.
[0178] S1009, when the verification by the widget framework passes, it creates a desktop card corresponding to the custom view layout.
[0179] S1010, the widget framework sends the desktop card to the desktop.
[0180] S1011, the desktop displays the desktop card and obtains the width and height of the desktop card.
[0181] S1012, the desktop sends the width and height of the desktop card to the gallery desktop card module.
[0182] S1013, after receiving the width and height of the desktop card, the gallery desktop card module sends a picture acquisition request to the gallery desktop card data management module.
[0183] S1014, after receiving the picture acquisition request, the gallery desktop card data management module obtains and stores the number of pictures included in the gallery application and the picture paths of each picture.
[0184] S1015, the gallery desktop card data management module sends the number of pictures N to the gallery desktop card module.
[0185] S1016, the gallery desktop card module sends a picture path acquisition request to the gallery desktop card data management module.
[0186] The picture path acquisition request includes the picture identifier of the first picture, the picture identifier of the second picture, and the picture identifier of the Nth picture.
[0187] S1017, the gallery desktop card data management module sends the picture path of the first picture, the picture path of the second picture, and the picture path of the Nth picture to the gallery desktop card module.
[0188] S1018. The gallery desktop card module parses the original image of the same width and height as the desktop card for each picture according to the picture path of each picture and the width and height of the desktop card.
[0189] Specifically, the gallery desktop card module parses the original image of the same width and height as the desktop card for the first picture according to the picture path of the first picture and the width and height of the desktop card; parses the original image of the same width and height as the desktop card for the second picture according to the picture path of the second picture and the width and height of the desktop card; and parses the original image of the same width and height as the desktop card for the Nth picture according to the picture path of the Nth picture and the width and height of the desktop card.
[0190] S1019. The gallery desktop card module loads the original image of the first picture in viewB, loads the original image of the second picture in viewC, and loads the original image of the Nth picture in viewA.
[0191] Through Figure 10 After creating the desktop card in the shown manner, the user can slide the desktop card according to their own needs to switch the picture displayed by the display component of the desktop card.
[0192] Figure 11 shows the interaction flowchart of another picture switching method provided by the embodiment of the present application. This method is implemented by the interaction of the desktop application (hereinafter simply referred to as the desktop) and the gallery desktop card module and the gallery desktop card data management module in the gallery application (hereinafter simply referred to as the gallery) shown in Figure 3 As shown, this method includes: Figure 11 As shown, this method includes:
[0193] S1101. In response to the user's first sliding operation on the desktop card of the gallery application, the desktop sends a sliding event corresponding to the first sliding operation to the gallery desktop card module.
[0194] The first sliding operation instructs the electronic device to switch to the second picture.
[0195] S1102. The gallery desktop card module records the trigger time t1 of the first sliding operation.
[0196] S1103. The gallery desktop card module sends a picture path acquisition request to the gallery desktop card data management module.
[0197] The picture path acquisition request contains the picture identifier of the third picture.
[0198] S1104. The gallery desktop card data management module sends the picture path of the third picture to the gallery desktop card module.
[0199] S1105, the gallery desktop card module parses the original image of the third picture that has the same width and height as the desktop card based on the picture path of the third picture and the width and height of the desktop card.
[0200] S1106, the gallery desktop card module loads the original image of the second picture in viewB, loads the original image of the third picture in viewC, and loads the original image of the first picture in viewA.
[0201] S1107, in response to the user's second sliding operation on the desktop card of the gallery application, the desktop sends a sliding event corresponding to the second sliding operation to the gallery desktop card module.
[0202] The second sliding operation indicates that the electronic device switches to the third picture.
[0203] S1108, the gallery desktop card module records the trigger time t2 of the second sliding operation.
[0204] S1109, the gallery desktop card module determines the operation type of the second sliding operation based on the trigger time t1 of the first sliding operation and the trigger time t2 of the second sliding operation.
[0205] Specifically, based on the trigger time t1 of the first sliding operation and the trigger time t2 of the second sliding operation, the duration t = t2 - t1 between the first sliding operation and the second sliding operation can be determined. If t is less than the preset duration, the second sliding operation is determined as the expected trigger operation. If t is greater than or equal to the preset duration, the second sliding operation is determined as the non-expected trigger operation.
[0206] S1110, the gallery desktop card module sends a picture path acquisition request to the gallery desktop card data management module.
[0207] The picture path acquisition request contains the picture identifier of the fourth picture.
[0208] S1111, the gallery desktop card data management module sends the picture path of the fourth picture to the gallery desktop card module.
[0209] S1112, in the case where the operation type of the second sliding operation is the expected trigger operation, the gallery desktop card module parses the thumbnail of the fourth picture that has the same width and height as the desktop card based on the picture path of the fourth picture and the width and height of the desktop card.
[0210] S1113, the gallery desktop card module parses the thumbnail of the second picture that has the same width and height as the desktop card based on the picture path of the second picture and the width and height of the desktop card.
[0211] S1114. The gallery desktop card module loads the original image of the third picture in viewB, loads the thumbnail of the fourth picture in viewC, and loads the thumbnail of the second picture in viewA.
[0212] In addition, when the operation type of the second sliding operation is an unexpected trigger operation, the gallery desktop card module can parse out the original image of the fourth picture that is equal in width and height to the desktop card based on the picture path of the fourth picture and the width and height of the desktop card, and load the original image of the third picture in viewB, load the original image of the fourth picture in viewC, and load the original image of the second picture in viewA.
[0213] S1115. The desktop responds to the third sliding operation of the user on the desktop card of the gallery application and sends a sliding event corresponding to the third sliding operation to the gallery desktop card module.
[0214] The third sliding operation instructs the electronic device to switch to the fourth picture.
[0215] S1116. The gallery desktop card module records the trigger moment t3 of the third sliding operation.
[0216] S1117. The gallery desktop card module determines the operation type of the third sliding operation based on the trigger moment t2 of the second sliding operation and the trigger moment t3 of the third sliding operation.
[0217] Specifically, based on the trigger moment t2 of the second sliding operation and the trigger moment t3 of the third sliding operation, the duration t = t3 - t2 between the second sliding operation and the third sliding operation can be determined. If t is less than the preset duration, the third sliding operation is determined to be an expected trigger operation. If t is greater than or equal to the preset duration, the third sliding operation is determined to be an unexpected trigger operation.
[0218] S1118. The gallery desktop card module sends a picture path acquisition request to the gallery desktop card data management module.
[0219] S1119. The gallery desktop card data management module sends the picture path of the fifth picture to the gallery desktop card module.
[0220] S1120. When the operation type of the third sliding operation is an expected trigger operation, the gallery desktop card module parses out the thumbnail of the fifth picture that is equal in width and height to the desktop card based on the picture path of the fifth picture and the width and height of the desktop card.
[0221] S1121, the gallery desktop card module parses the original image of the fourth picture that has the same width and height as the desktop card based on the picture path of the fourth picture and the width and height of the desktop card, and parses the thumbnail of the third picture that has the same width and height as the desktop card based on the picture path of the third picture and the width and height of the desktop card.
[0222] S1122, the gallery desktop card module loads the original image of the fourth picture in viewB, loads the thumbnail of the fifth picture in viewC, and loads the thumbnail of the third picture in viewA.
[0223] In addition, when the operation type of the third sliding operation is an unexpected trigger operation, the gallery desktop card module can parse the original image of the fifth picture that has the same width and height as the desktop card based on the picture path of the fifth picture and the width and height of the desktop card, and load the original image of the fourth picture in viewB, load the original image of the fifth picture in viewC, and load the original image of the third picture in viewA.
[0224] In summary, for the picture switching method provided by the embodiment of the present application, when the trigger operation (or sliding operation) is a fast sliding operation, only the original image of the first picture can be displayed on the display component, while the thumbnail of the second picture is loaded on the preloading component. The clarity of the thumbnail is much less than that of the original image. Therefore, the speed of parsing the thumbnail is not only faster than that of parsing the original image, but also the storage space occupied by the thumbnail is much smaller than that occupied by the original image, effectively improving the problems of slow picture loading speed and high memory occupancy rate caused by fast sliding operations in the prior art.
[0225] Optionally, the embodiment of the present application provides a picture switching method applied to an electronic device. The method includes the following steps A - B.
[0226] Step A: In response to a trigger operation, determine the operation type of the trigger operation.
[0227] Wherein, the trigger operation is used to trigger the electronic device to switch the picture displayed on the desktop of the electronic device.
[0228] Step B: When the operation type is an expected trigger operation, display the original image of the first picture and load the thumbnail of the second picture.
[0229] Wherein, the duration between the expected trigger operation and the previous trigger operation is less than a preset duration; the second picture is the picture displayed after the first picture.
[0230] An embodiment of the present application further provides an electronic device, which includes a display screen, a memory, and one or more processors; the display screen, the memory are coupled to the processor; wherein, computer program code is stored in the memory, and the computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device is caused to execute the multimedia resource editing method provided in the foregoing embodiment. The specific structure of the electronic device may refer to Figure 3 the structure of the electronic device shown in
[0231] An embodiment of the present application further provides a computer-readable storage medium, which includes computer instructions. When the computer instructions run on an electronic device, the electronic device is caused to execute the multimedia resource editing method provided in the foregoing embodiment.
[0232] An embodiment of the present application further provides a computer program product, which includes executable instructions. When the computer program product runs on an electronic device, the electronic device is caused to execute the picture switching method provided in the foregoing embodiment.
[0233] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0234] In several embodiments provided in the present application, it should be understood that the disclosed apparatus / devices and methods can be implemented in other ways. For example, the apparatus / device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0235] The units described as separate components may or may not be physically separated. The components displayed as units may be one physical unit or multiple physical units, that is, they can be located in one place, or they can be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0236] In addition, in each embodiment of the present application, each functional unit can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0237] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs that can store program codes.
[0238] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for picture switching, characterized in that, Applied to an electronic device, including: In response to a trigger operation, determining the operation type of the trigger operation; the trigger operation is used to trigger the electronic device to switch the picture displayed on the desktop of the electronic device; When the operation type is a predicted trigger operation, displaying the original picture of the first picture and loading the thumbnail of the second picture; the time duration between the predicted trigger operation and the previous trigger operation is less than a preset time duration; the second picture is the picture to be displayed after the first picture.
2. The method according to claim 1, wherein The method further includes: When the operation type is not a predicted trigger operation, displaying the original picture of the first picture and loading the original picture of the second picture.
3. The method according to claim 1, characterized in that The trigger operation is an operation on the desktop card of the electronic device; the desktop card includes a display component and a plurality of preloading components; the display component is used to display the picture shown on the desktop card; the preloading component is used to load the picture to be displayed; The plurality of preloading components include a first preloading component; The displaying the original picture of the first picture and loading the thumbnail of the second picture includes: Displaying the original picture of the first picture through the display component and loading the thumbnail of the second picture through the first preloading component.
4. The method according to claim 3, wherein The method further includes: In response to an operation of creating a desktop card, creating the desktop card through a custom component; the custom component includes at least one function control; any function control is used to instruct the electronic device to execute the function corresponding to the function control.
5. The method according to claim 4, wherein The desktop card is created for a target application; The creating the desktop card through a custom component in response to an operation of creating a desktop card includes: In response to an operation of creating a desktop card, verifying the target application; When the target application belongs to a preset whitelist application, creating the desktop card through the custom component.
6. The method according to any one of claims 3-5, characterized in that, The specification of the original picture of the first picture is consistent with the card specification of the desktop card.
7. The method according to claim 3, wherein The plurality of preloading components are used to load the thumbnails of the pictures to be displayed; Before displaying the original picture of the first picture through the display component, the method further includes: Determining the thumbnail of the first picture from the plurality of preloading components; Based on the thumbnail of the first picture, obtaining the picture path of the first picture; the picture path is used to indicate the picture storage location; Based on the picture path and a first interface, obtaining the original picture of the first picture; the first interface is used to obtain the original picture of the picture.
8. The method according to claim 1, wherein Before loading the thumbnail of the second picture, the method further includes: Obtaining the picture path of the second picture; the picture path is used to indicate the picture storage location; Based on the picture path and a second interface, obtaining the thumbnail of the second picture; the second interface is used to obtain the thumbnail of the picture.
9. An electronic device, characterized in that, Including a processor and a memory, the processor and the memory are coupled, and the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the electronic device implements the method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, Including computer instructions; When the computer instructions are run on the electronic device, the electronic device is caused to execute the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Generation method and device of desktop member
CN105068747A
Image uploading and browsing method and device and storage medium
CN109905466A
Notification message display method and electronic equipment
CN113824842A
Electronic device with less response time and method for reducing response time of an electronic device
TW201019213A
Method for customizing restricted desktop on mobile terminal and mobile terminal thereof
US20170169197A1