Picture switching method and electronic device

By identifying the first preloaded component in the desktop card of the electronic device and passing images between the display component and the preloaded component, the problem of slow loading and unresponsiveness when switching images is solved, thus improving the user experience.

CN120276639BActive Publication Date: 2026-06-09HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2023-12-29
Publication Date
2026-06-09

Smart Images

  • Figure CN120276639B_ABST
    Figure CN120276639B_ABST
Patent Text Reader

Abstract

The application provides a picture switching method and an electronic device, and relates to the technical field of terminals. The method can effectively improve the problems of slow picture loading and picture not following in the picture switching process. The method comprises the following steps: in response to a trigger operation on a desktop card, determining a first preloading component in the components of the desktop card, then delivering a first picture loaded in the first preloading component to a display component, and displaying the first picture through the display component. The trigger operation is used to trigger the electronic device to switch the picture displayed on the desktop card. The components of the desktop card comprise the display component and a plurality of preloading components. The display component is used to display the picture displayed on the desktop card, and the preloading components are used to load the picture to be displayed. The plurality of preloading components comprise the first preloading component.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to an image switching method and an electronic device. Background Technology

[0002] With the continuous development of electronic devices, in addition to application icons, these devices also allow users to add widgets of any application to the desktop as desktop cards. Users can quickly and directly view information related to that application through these desktop cards. For example, a user can add the Gallery application widget to the desktop as a desktop card to quickly view images in the Gallery application.

[0003] In addition, users can perform swipe gestures within the gallery app's desktop cards. Correspondingly, the electronic device can switch the views within the widgets in response to these swipes, thus changing the displayed image. When the currently displayed image is the last image, there is no next image. Therefore, the electronic device does not immediately generate a view to load the next image. Instead, after the user's swipe ends, it uses a navigation function to reposition to the first image and then generates a view to load that first image, achieving the effect of switching from the last image to the first image.

[0004] In summary, when using the above technical solutions to switch between the last and first images, it often results in slow image loading, leading to a lack of responsiveness during the image switching process. Summary of the Invention

[0005] This application provides an image switching method and an electronic device, which can effectively improve the problems of slow image loading and unresponsive images during image switching.

[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0007] In a first aspect, this application provides an image switching method applied to an electronic device. The method includes: in response to a trigger operation on a desktop card, determining a first preloaded component in the components of the desktop card, then passing a first image loaded in the first preloaded component to a display component, and displaying the first image through the display component.

[0008] The trigger action is used to change the image displayed on the desktop card by the electronic device. The trigger action can be a click or a swipe.

[0009] The desktop card consists of a display component and multiple preloaded components. The display component is used to display the image on the desktop card; the preloaded components are used to load the image to be displayed; and the multiple preloaded components include a first preloaded component.

[0010] When switching images using the above method, only the image needs to be passed between the display component and the first preload component. There's no need to switch the view (component) that loads the image, nor is it necessary to destroy or create a new view. Therefore, even when switching from the last image to the first image, or vice versa, only the last or first image loaded in the first preload component needs to be passed to the display component to achieve the switch between the last and first images. This avoids the lag issues that occur with traditional image switching techniques and effectively improves the problem of slow image loading.

[0011] In one alternative implementation, when the electronic device determines a first preloaded component among the components of a desktop card in response to a trigger operation on the desktop card, it may determine the switching direction of the trigger operation in response to the trigger operation on the desktop card, and then determine the first preloaded component from a plurality of preloaded components based on the switching direction of the trigger operation.

[0012] The above method enriches the process of determining the first preloaded component in electronic devices, making the image switching method provided in this application more complete.

[0013] In one alternative implementation, the multiple preloading components may include a pre-preloading component and a post-preloading component. The pre-preloading component loads the previous image displayed on the desktop card. The post-preloading component loads the next image displayed on the desktop card.

[0014] Based on this, when the electronic device determines the first preloaded component from multiple preloaded components based on the switching direction of the trigger operation, it can determine the subsequent preloaded component as the first preloaded component if the switching direction instructs the electronic device to switch to the next image; and determine the previous preloaded component as the first preloaded component if the switching direction instructs the electronic device to switch to the previous image.

[0015] The above method provides a specific implementation method for an electronic device to determine the first preloaded component based on the sliding direction of a sliding operation, thereby making the method for determining the first preloaded component in the electronic device of this application clearer and enhancing the implementability of the image switching method provided in this application.

[0016] In one alternative implementation, the electronic device may also delete the image displayed on the display component or pass the image displayed on the display component to the second preload component before passing the first image loaded in the first preload component to the display component of the desktop card.

[0017] The first preloading component and the second preloading component are used to load one of the previous image and the next image displayed on the desktop card, respectively.

[0018] In one alternative implementation, the electronic device may load the first image in the first preloading component before passing the first image loaded in the first preloading component to the display component.

[0019] Using the above method, the electronic device can preload the first image in the first preloading component, so that when the electronic device receives a trigger operation, it can directly pass the first image in the first preloading component to the display component without having to retrieve the first image again, thereby speeding up image loading and further improving the problem of slow image loading in traditional technology.

[0020] In an alternative implementation, prior to the steps described above, the electronic device may also create a desktop card via a custom component in response to the operation of creating a desktop card.

[0021] The custom component may contain at least one functional control. Any functional control is used to instruct the electronic device to perform the function corresponding to that control.

[0022] The above method enriches the process of creating desktop cards for target applications on the desktop of electronic devices, so that users can perform swiping operations on the desktop cards and the electronic devices can execute the above image switching method, making the image switching method provided in this application more complete.

[0023] Furthermore, the layout and style of each control in a custom component can be adjusted and modified according to the user's intent. Custom components also support the addition of various functional controls, enabling desktop cards created through them to support the corresponding functions. For example, a sliding control can be added to a custom component to support sliding images on the desktop card, thus enabling image sliding functionality. Another example is a refresh control, which allows updating images on the desktop card according to a preset refresh interval.

[0024] In one alternative implementation, the desktop card is created for the target application. When the electronic device creates a desktop card via a custom component in response to the desktop card creation operation, it can also verify the target application in response to the desktop card creation operation; if the target application belongs to a preset whitelist of applications, the desktop card is created via the custom component.

[0025] In this way, after verification, electronic devices can create desktop cards for target applications through custom components. This not only enriches the process of creating desktop cards through custom components, but also enhances the security of the desktop card creation process, ensuring that desktop cards are created for applications that meet the constraints, thereby improving the rigor of the image switching method provided in this application.

[0026] In one alternative implementation, the desktop card is created for the target application, and the custom component may include a refresh control. This refresh control instructs the electronic device to update the image displayed on the desktop card according to a preset refresh interval.

[0027] Based on this, the electronic device can also determine the number of images contained in the target application, and if the number of images is greater than a preset number, update the images displayed on the desktop card according to the refresh interval.

[0028] Using the above method, a refresh control can be added to a custom component to achieve the effect of automatically switching the images in the desktop card.

[0029] In a second aspect, this application also provides an electronic device including a processor and a memory, wherein the processor and the memory are coupled, and the memory stores program instructions, which, when executed by the processor, cause the electronic device to implement any of the methods in the first aspect.

[0030] Thirdly, this application provides a computer-readable storage medium including computer instructions; when the computer instructions are executed on an electronic device, they cause the electronic device to perform the method as described in any of the first aspects.

[0031] Fourthly, this application provides a computer program product that, when run on a computer, causes the computer to perform a method as described in the first aspect and any of its possible design methods.

[0032] Fifthly, this application provides a chip system including one or more interface circuits and one or more processors. The interface circuits and processors are interconnected via lines. The aforementioned chip system can be applied to electronic devices including communication modules and memory. The interface circuits are used to receive signals from the memory of the electronic device and send the received signals to the processor, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device can perform the method as described in the first aspect and any of its possible design embodiments.

[0033] Understandably, the beneficial effects achievable by the electronic device of the second aspect, the computer-readable storage medium of the third aspect, the computer program product of the fourth aspect, and the chip system of the fifth aspect provided above can be referenced to the beneficial effects of the first aspect and any of its possible design embodiments, which will not be repeated here. Attached Figure Description

[0034] Figure 1 A desktop illustration of an electronic device provided in an embodiment of this application;

[0035] Figure 2 A schematic diagram of the components included in the tool components provided in the embodiments of this application;

[0036] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0037] Figure 4 A software structure block diagram of an electronic device provided in an embodiment of this application;

[0038] Figure 5 A flowchart illustrating an image switching method provided in this application embodiment;

[0039] Figure 6 This application provides a schematic diagram of the layout between a display component and a preloaded component according to an embodiment of the present application.

[0040] Figure 7 A flowchart illustrating a desktop card creation method provided in this application embodiment;

[0041] Figure 8 A desktop illustration of an electronic device provided in an embodiment of this application;

[0042] Figure 9 A schematic diagram of an operable interface provided in an embodiment of this application;

[0043] Figure 10 This is a schematic diagram illustrating the layout between another display component and a preloaded component provided in an embodiment of this application.

[0044] Figure 11 This is a schematic diagram illustrating the layout between another display component and a preloaded component provided in an embodiment of this application.

[0045] Figure 12 An interactive flowchart illustrating a desktop card creation method provided in an embodiment of this application;

[0046] Figure 13 An interactive flowchart of an image switching method provided in an embodiment of this application;

[0047] Figure 14 An interactive flowchart of another image switching method provided in an embodiment of this application. Detailed Implementation

[0048] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. In the description of this application, unless otherwise stated, "at least one" refers to one or more, and "more than one" refers to two or more. Furthermore, to facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first," "second," etc., are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.

[0049] With the continuous development of communication technology, electronic devices (such as smartphones) are becoming increasingly common and diverse. The usability and user-friendliness of the human-computer interaction interface (HCI) for these devices are receiving increasing attention. The desktop of an electronic device is not only the entry point for various applications but also an important interface carrier.

[0050] Traditional electronic devices display application icons for all installed applications on their desktops, allowing users to launch any application by clicking its icon. With the continuous development of electronic devices, in addition to application icons, users can now add widgets for any application to their desktop as desktop cards. These widgets allow users to quickly and directly view information related to that application.

[0051] In some embodiments, users can add a gallery app widget to the desktop of the electronic device as a desktop card. For example, such as... Figure 1 As shown, desktop card 101 is a widget for the gallery application, allowing users to directly view images in the gallery application through desktop card 101.

[0052] Typically, a gallery app widget can contain multiple views. Each view is used to load one image. When a user intends to browse other images in the gallery app, they can also perform a swipe gesture on the screen cards; the electronic device switches between views to change the images.

[0053] For example, a gallery app widget can contain Figure 2 The five views shown are viewA, viewB, viewC, viewD, and viewE. ViewA contains image A, viewB contains image B, viewC contains image C, viewD contains image D, and viewE contains image E. Assume viewC is the currently displayed view, meaning the gallery application's widget is currently displaying image C.

[0054] When a user swipes down on a desktop card, the electronic device can set view B as view A, view C as view B, view D as view C, and view E as view D to switch between images and display image D. Simultaneously, the electronic device can also destroy the original view A and create a new view after the original view E as view E to load the next image after image E.

[0055] When the currently displayed image is the last image, there is no next image. Therefore, the electronic device does not immediately generate a view to load the next image. Instead, after the user's swipe operation ends, it redirects to the first image via a jump operation and then generates a view to load the first image, thus achieving the effect of switching from the last image to the first image.

[0056] When using the above technical solution to switch between the last and first images, it often results in slow image loading, leading to a lack of responsiveness during the image switching process.

[0057] To address the aforementioned issues, this application provides an image switching method. In response to a swipe operation on a desktop card, an electronic device determines a first preloaded component within the desktop card's components, then transfers a first image loaded in the first preloaded component to the desktop card's display component, and displays the first image through the display component.

[0058] Therefore, this application only needs to transfer the image between the display component and the first preloading component when switching images, without switching the view that loads the image or destroying or generating a new view. Thus, even when switching from the last image to the first image, or vice versa, only the last or first image loaded on the first preloading component needs to be transferred to the display component to achieve the switch between the last and first images. This avoids the lag issues that occur in traditional image switching techniques and effectively improves the problem of slow image loading.

[0059] For example, the electronic device in this application embodiment may be a mobile phone, tablet computer, smartwatch, desktop, laptop, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, etc., including a display screen. This application embodiment does not impose any special restrictions on the specific form of the electronic device.

[0060] Please refer to Figure 3 This is a schematic diagram of the structure of an electronic device 300 provided in an embodiment of this application. Figure 3 As shown, the electronic device 300 may include: a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, a headphone jack 370D, a sensor module 380, buttons 390, a motor 391, an indicator 392, a camera 393, a display screen 394, and a subscriber identification module (SIM) card interface 395, etc.

[0061] The aforementioned sensor module 380 may include sensors such as pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and bone conduction sensors.

[0062] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 300. In other embodiments, the electronic device 300 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0063] Processor 310 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. The different processing units may be independent devices or integrated into one or more processors.

[0064] The controller can be the nerve center and command center of the electronic device 300. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0065] The processor 310 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. This memory can store instructions or data that the processor 310 has just used or that are used repeatedly. If the processor 310 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.

[0066] In some embodiments, the processor 310 may include one or more interfaces. 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.

[0067] It is understood that the interface connection relationships between the modules illustrated in this embodiment are merely illustrative and do not constitute a structural limitation on the electronic device 300. In other embodiments, the electronic device 300 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0068] The charging management module 340 receives charging input from a charger, which can be a wireless charger or a wired charger. While charging the battery 342, the charging management module 340 can also supply power to electronic devices via the power management module 341.

[0069] The power management module 341 connects the battery 342, the charging management module 340, and the processor 310. The power management module 341 receives input from the battery 342 and / or the charging management module 340, and supplies power to the processor 310, internal memory 321, external memory, display screen 394, camera 393, and wireless communication module 360, etc. In some embodiments, the power management module 341 and the charging management module 340 may also be housed in the same device.

[0070] The wireless communication function of an electronic device can be implemented through antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, modem processor, and baseband processor. In some embodiments, antenna 1 and mobile communication module 350 are coupled, and antenna 2 and wireless communication module 360 ​​are coupled, enabling the electronic device to communicate with networks and other devices, such as wearable devices, via wireless communication technology.

[0071] 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 one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0072] The mobile communication module 350 can provide solutions for wireless communication applications in electronic devices, including 2G / 3G / 4G / 5G. The mobile communication module 350 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation.

[0073] The mobile communication module 350 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 350 can be housed in the processor 310. In some embodiments, at least some functional modules of the mobile communication module 350 and at least some modules of the processor 310 can be housed in the same device.

[0074] Wireless communication module 360 ​​can provide solutions for wireless communication applications in electronic devices, including WLAN (such as wireless fidelity, Wi-Fi) networks, Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, and other wireless communication technologies.

[0075] GNSS can include the BeiDou Navigation Satellite System (BDS), the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0076] The wireless communication module 360 ​​can be one or more devices integrating at least one communication processing module. The wireless communication module 360 ​​receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 310. The wireless communication module 360 ​​can also receive signals to be transmitted from processor 310, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0077] Electronic device 300 implements display functions through a GPU, a display screen 394, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 310 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0078] The display screen 394 is used to display images, videos, etc. The display screen 394 includes a display panel.

[0079] Electronic device 300 can perform shooting functions through ISP, camera 393, video codec, GPU, display 394, and application processor. ISP is used to process data fed back by camera 393.

[0080] The camera 393 is used to capture still images or videos. In some embodiments, the electronic device may include one or N cameras 393, where N is a positive integer greater than 1. The aforementioned N cameras 393 may include cameras with TOF camera sensors and cameras with RGB camera sensors.

[0081] The external storage interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 310 through the external storage interface 320 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0082] Internal memory 321 can be used to store computer executable program code, which includes instructions. Processor 310 executes various functional applications and data processing of the electronic device by running the instructions stored in internal memory 321. For example, in this embodiment, processor 310 can execute instructions stored in internal memory 321, which may include a program storage area and a data storage area.

[0083] The program storage area can store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.). The data storage area can store data created during the use of the electronic device (such as audio data, phonebook, etc.). Furthermore, the internal memory 321 can include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0084] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0085] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses a layered architecture system as an example to illustrate the software structure of an electronic device.

[0086] Figure 4 A software architecture block diagram of an electronic device provided in an embodiment of this application is shown. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0087] The application layer can include a series of application packages. For example, an application package can include applications such as desktop, gallery, music, video, and messaging. Each application can also include a desktop card module and a desktop card data management module. For instance, a gallery application can include a gallery desktop card module and a gallery desktop card data management module. The gallery desktop card data management module stores image information (such as image path, image capture time, etc.) for each image contained in the gallery application. The gallery desktop card module can retrieve the thumbnail and original image of each image based on its image path.

[0088] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes predefined functions. For example, 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 editor manager, etc.

[0089] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0090] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0091] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0092] A phone manager is used to provide communication functions for electronic devices. For example, it manages call status (including connection and disconnection).

[0093] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0094] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0095] The edit manager provides editing functionality for various editing options when an application needs to edit data, enabling the editing of data (such as multimedia resources) within the application.

[0096] The Android Runtime consists of core libraries and a virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system.

[0097] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

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

[0099] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0100] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0101] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0102] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0103] A 2D graphics engine is a graphics engine for 2D drawing.

[0104] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0105] The methods described in the following embodiments can all be implemented in electronic devices having the above-described hardware and software structures.

[0106] In some embodiments, the image switching method provided in this application can be applied to the desktop of an electronic device, or to the negative one screen interface of an electronic device, or to the pull-down notification bar and standby scenario of an electronic device. The following description uses the application to the desktop of an electronic device as an example.

[0107] The following description uses a mobile phone as an example to illustrate the image switching method provided in the embodiments of this application, with reference to the accompanying drawings.

[0108] Figure 5 A flowchart illustrating an image switching method provided in this application embodiment, wherein the method is applied to the aforementioned electronic device, such as... Figure 5 As shown, the method includes:

[0109] S501, in response to a trigger operation on a desktop card, determines the switching direction of the trigger operation.

[0110] The trigger operation is used to instruct the electronic device to switch the displayed image. For example, the trigger operation can be a swipe operation, where the user swipes a desktop card on the electronic device to switch the image displayed on the desktop card. Alternatively, the trigger operation can be a click operation, where the user clicks a desktop card on the electronic device to switch the image displayed on the desktop card.

[0111] The following explanation uses a sliding operation as an example to illustrate the triggering action.

[0112] The sliding operation can be a vertical sliding or a horizontal sliding, and this application embodiment does not specifically limit the sliding operation.

[0113] Desktop cards are desktop cards created for a target application. The target application can be any application software installed on the electronic device, such as a gallery application. The following explanation uses a gallery application as the target application.

[0114] In some embodiments, the electronic device may, in response to a trigger operation on a desktop card, determine the number of images contained in the target application, and if the number of images is greater than a preset number, determine the switching direction of the trigger operation.

[0115] The preset quantity can be set according to the actual situation. For example, when the number of images is greater than 1, the user can switch between images, so in this scenario, the preset quantity can be set to 1.

[0116] In practice, taking the user's intention to switch the images displayed on the desktop card of the Gallery app as an example, the user can perform a swipe operation on the desktop card of the Gallery app. After the phone receives the swipe operation, it can determine the number of images contained in the Gallery app.

[0117] The electronic device can then compare the number of images with a preset number. If the number of images is less than or equal to the preset number, the electronic device may not respond to the swipe operation. If the number of images is greater than the preset number, the electronic device can further determine the swipe direction of the swipe operation.

[0118] For example, assuming the target application contains 1 image and the preset number is 1, the electronic device can choose not to respond to the swipe operation after determining the number of images in the target application.

[0119] For example, assuming the target application contains 10 images and the preset number is 1, after determining the number of images in the target application, the electronic device can further determine the sliding direction of the sliding operation.

[0120] S502, based on the switching direction of the trigger operation, determines the first preloaded component among the components of the desktop card.

[0121] The desktop card components can include a display component and multiple preloaded components. The display component is used to display the image shown on the desktop card.

[0122] The preload component is used to load images to be displayed. Optionally, each preload component can be used to load one image to be displayed (e.g., the previous or next image loaded on the display component).

[0123] The first preloaded component is any one of the multiple preloaded components.

[0124] After determining the switching direction of the trigger operation via S501, the electronic device can determine the first preloaded component from multiple preloaded components of the desktop card according to the switching direction of the trigger operation.

[0125] In some embodiments, taking as an example that multiple preloading components include a pre-loading component and a post-loading component, wherein the pre-loading component is used to load the previous image displayed on the desktop card, and the post-loading component is used to load the next image displayed on the desktop card, when the switching direction of the trigger operation instructs the electronic device to switch to the next image, the electronic device can determine the post-loading component as the first preloading component; when the switching direction of the trigger operation instructs the electronic device to switch to the previous image, the electronic device can determine the pre-loading component as the first preloading component.

[0126] In practical implementation, assume the layout between the display component, the pre-loaded component, and the post-loaded component is as follows: Figure 6 As shown, viewA is the pre-loaded component, viewB is the display component, and viewC is the pre-loaded component. When the switching direction of the trigger operation instructs the electronic device to switch to the next image, the electronic device can identify viewC as the first pre-loaded component; when the switching direction of the trigger operation instructs the electronic device to switch to the previous image, the electronic device can identify viewA as the first pre-loaded component.

[0127] S503 passes the image displayed on the display component to the second preloaded component.

[0128] Specifically, the first preloading component and the second preloading component are used to load one and the other of the previous and next images displayed on the desktop card, respectively. Specifically, when the first preloading component is used to load the previous image displayed on the desktop card, the second preloading component is used to load the next image displayed on the desktop card. Conversely, when the first preloading component is used to load the next image displayed on the desktop card, the second preloading component is used to load the previous image displayed on the desktop card.

[0129] Specifically, the image displayed on the display component is passed to the second preload component, and the image is displayed through the second preload component.

[0130] In some embodiments, the electronic device may also delete the image displayed on the display component before passing the image displayed on the display component to the second preload component, thereby clearing the display component and preparing it to display the first image loaded in the first preload component.

[0131] S504, the first image loaded in the first preloaded component is passed to the display component, and the first image is displayed through the display component.

[0132] See also Figure 6 Assuming viewA loads image A, viewB loads image B, and viewC loads image C, and viewC is the first preloaded component determined by S503, the electronic device can pass image B loaded by viewB to viewA and load image B through viewA. It can also pass image C from viewC to viewB and display image C through viewB.

[0133] In addition, the electronic device can detect the card specifications of the desktop card and obtain the image path of the second image. Then, based on the card specifications and the image path, it can obtain a second image that matches the card specifications and finally load the second image on the first preloading component.

[0134] The second image is either the image following or the image preceding the first image. Specifically, if the sliding direction of the sliding operation indicates that the electronic device should switch to the next image, the second image is the image following the first image; if the sliding direction of the sliding operation indicates that the electronic device should switch to the previous image, the second image is the image preceding the first image.

[0135] In some embodiments, the specifications of the desktop card may include the width and height of the desktop card. In some embodiments, the electronic device may also load the first image in the first preloading component before passing the first image loaded in the first preloading component to the display component.

[0136] Specifically, loading the first image in the first preloading component is similar to loading the second image in the first preloading component, as described above, and will not be repeated here.

[0137] Using the above method, the electronic device can preload the first image in the first preloading component, so that when the electronic device receives a trigger operation, it can directly pass the first image in the first preloading component to the display component without having to retrieve the first image again, thereby speeding up image loading and further improving the problem of slow image loading in traditional technology.

[0138] In summary, this application only requires the transfer of images between the display component and the first preloading component when switching images, without switching the view that loads the images or destroying or creating a new view. Therefore, even when switching from the last image to the first image, or vice versa, it is only necessary to transfer the last or first image loaded on the first preloading component to the display component to achieve the switch between the last and first images. This avoids the lag issues that occur in traditional image switching techniques and effectively improves the problem of slow image loading.

[0139] In execution Figure 5 Before the image switching method shown, users can also create desktop cards for the target application on the desktop of their electronic devices. Figure 7 A flowchart illustrating a desktop card creation method provided in this application embodiment, wherein the method is applied to the aforementioned electronic device, such as... Figure 7 As shown, the method includes:

[0140] S701 verifies the target application in response to the operation of creating a desktop card for the target application.

[0141] The target application contains multiple images.

[0142] Specifically, a user can long-press the target application's icon on the desktop of an electronic device. The device responds to this long-press action by displaying an interactive interface containing a creation control for creating a desktop card. The user can then click on the creation control within this interface. In response, the device retrieves the target application's identifier and determines whether it is included in a pre-defined whitelist of applications, thus verifying the target application.

[0143] For example, suppose Figure 8 This is a desktop illustration of an electronic device, targeting a gallery application where users can... Figure 8 As shown in the desktop illustration, long-pressing the Gallery app icon 801 will cause the electronic device to respond to the user's long-press action on the Gallery app icon 801 and display... Figure 9 The operable interface 901 shown includes a creation control 902. The user can click the creation control 902. The electronic device responds to the user's click on the creation control 902, obtains the application identifier of the gallery application, and determines whether the application identifier of the gallery application is included in the preset whitelist of applications, so as to realize the verification of the gallery application.

[0144] S702 creates desktop cards using custom components when the target application is on the preset whitelist.

[0145] Custom components can support the addition of at least one functional control, enabling electronic devices to perform the corresponding functions of each control after desktop cards are created using the custom component. For example, a sliding control can be added to the custom component to support sliding images within the desktop cards, thereby allowing the electronic device to support the aforementioned functions. Figure 5 The image swiping function mentioned above. For example, a refresh control can be added to a custom component to support refreshing images in the desktop card. Accordingly, the electronic device can update the images in the target application according to a preset refresh interval.

[0146] The refresh control may include, but is not limited to, the ViewPager control. The layout of the ViewPager control can be modified so that when displaying or switching images, the electronic device can set the image to fill the widget according to the card size of the desktop card, thereby improving the image display effect.

[0147] In addition, the layout and style of each control in a custom component can be adjusted and modified according to the user's intention. Compared with components with fixed styles and layouts in traditional technologies, using custom components can effectively increase the diversity of widgets.

[0148] The target application can contain multiple images.

[0149] After obtaining the application identifier of the gallery application through S701, if the application identifier of the gallery application is included in the preset whitelist of applications, it indicates that the gallery application belongs to the preset whitelist of applications. The electronic device can create and display a desktop card containing a display component and multiple preloaded components through a custom component, and display the desktop card on the desktop of the electronic device.

[0150] S703 displays the first image in the target application on the display component.

[0151] Specifically, after a desktop card is created via S702, the electronic device can first detect the card specifications of the desktop card, then obtain the image path of the first image in the target application, and based on the card specifications and the image path of the first image, obtain the first image that matches the card specifications, and finally display the first image on the display component.

[0152] S704, based on the positional relationship between each preloaded component and the display component, determines the image to be displayed corresponding to the preloaded component from multiple images of the target application.

[0153] Specifically, the electronic device can first determine the positional relationship between each preloaded component and the display component. If the preloaded component is located before the display component, then the image before the first image is used as the image to be displayed corresponding to the preloaded component. If the preloaded component is located after the display component, then the image after the first image is used as the image to be displayed corresponding to the preloaded component.

[0154] For example, suppose the target application contains N images, where N is a positive integer greater than 0, and multiple pre-loading components include a pre-loading component and a post-loading component. The electronic device can determine the second image in the target application as the image to be displayed corresponding to the post-loading component, and determine the Nth image in the target application as the image to be displayed corresponding to the pre-loading component.

[0155] For example, suppose the target application contains N images, and multiple preloading components include a first pre-loading component, a second pre-loading component, a first post-loading component, and a second post-loading component. The relationships between the display component, the first pre-loading component, the second pre-loading component, the first post-loading component, and the second post-loading component are as follows: Figure 10As shown, the first pre-loading component is located before the second pre-loading component, the second pre-loading component is located before the display component, the first post-loading component is located after the display component, and the second post-loading component is located after the first post-loading component. The electronic device can use the (N-1)th image as the image to be displayed corresponding to the first pre-loading component, the Nth image as the image to be displayed corresponding to the second pre-loading component, the second image as the image to be displayed corresponding to the first post-loading component, and the third image as the image to be displayed corresponding to the second post-loading component.

[0156] S705 loads the image to be displayed on the preload component.

[0157] Specifically, after determining the images to be displayed corresponding to each preloaded component through S704, the electronic device can obtain the image paths of each image to be displayed, and then, based on the card specifications of the desktop card and the image paths of each image to be displayed, obtain each image to be displayed that matches the card specifications, and finally load each image to be displayed on each preloaded component.

[0158] In specific implementation, taking an application containing N images as an example, where the preloading component includes a pre-loading component and a post-loading component, the electronic device can first obtain the image path of the second image and the image path of the Nth image. Then, based on the card specifications of the desktop card and the image path of the second image, it can obtain the second image that matches the card specifications. Based on the card specifications and the image path of the Nth image, it can obtain the Nth image that matches the card specifications. Finally, it can load the Nth image on the pre-loading component and load the second image on the post-loading component.

[0159] The above method enriches the process of creating desktop cards for target applications on the desktop of electronic devices, so that users can perform swiping operations on the desktop cards and the electronic devices can execute the above image switching method, making the image switching method provided in this application more complete.

[0160] Furthermore, the layout and style of each control in a custom component can be adjusted and modified according to the user's intent. Custom components also support the addition of various functional controls, enabling desktop cards created through them to support the corresponding functions. For example, a sliding control can be added to a custom component to support sliding images on the desktop card, thus enabling image sliding functionality. Another example is a refresh control, which allows updating images on the desktop card according to a preset refresh interval.

[0161] In some embodiments, at least one functional control may further include a refresh control, which instructs the electronic device to update the image displayed on the desktop card according to a preset refresh interval. Furthermore, after loading the image to be displayed on the preloading component, the electronic device can determine the number of images contained in the target application, and then, if the number of images exceeds a preset number, update the image loaded on the display component according to the refresh interval.

[0162] The refresh duration can be 5 seconds or 10 seconds. This application embodiment does not specifically limit the refresh duration.

[0163] In specific implementation, taking a preset quantity of 1 and a refresh time of 5 seconds as an example, the electronic device can first determine the number of images contained in the target application. If the number of images contained in the target application is greater than 1, the electronic device can pass the images in the display component to the pre-loaded component in front of the display component every 5 seconds, pass the images in the post-loaded component of the display component to the display component, and obtain the image path of the next image in the post-loaded component. Then, according to the card specifications of the desktop card and the image path of the next image, the next image with the same specifications as the card is obtained, and finally the next image is loaded on the post-loaded component.

[0164] For example, assuming the current time is 10:00:00, viewA is a preloaded component, viewB is the display component, and viewC is a preloaded component. Figure 11 As shown, viewA loads the last image, viewB loads the first image, and viewC loads the second image. The target application contains 10 images. At the current time of 10:00:05, the electronic device can destroy the images in viewA, then pass the first image from viewB to viewA, pass the second image from viewC to viewB, and obtain the image path of the third image. Afterward, the electronic device can obtain the third image, matching the card's specifications, based on the card's dimensions and the image path. Finally, it loads the third image in viewC, completing one refresh operation. Subsequent refresh operations are similar to the above steps and will not be described in detail here.

[0165] The above method allows you to add a refresh control to a custom component to automatically switch images on the desktop card. Compared to the traditional method of refreshing images through interaction between the desktop card module in the application layer and the widget framework in the application framework layer, adding a refresh control to a custom component allows you to directly generate and issue refresh commands at the application layer, without needing to do so through the widget framework. Therefore, it not only allows for custom refresh times but also significantly reduces image refresh duration.

[0166] In some embodiments, the above Figure 5 The image switching method shown is the same as the one described above. Figure 7 The desktop card creation method shown can also be used via Figure 4 The application layer and application framework layer shown are used to implement this. The following will use a gallery application as the target application. The preloaded components include pre-loaded components and post-loaded components. The desktop card specifications, including the width and height of the desktop card, will be used as an example. Figure 5 The image switching method shown is the same as the one described above. Figure 7 The method for creating desktop cards will be introduced.

[0167] Figure 12 This illustration shows an interactive flowchart of a desktop card creation method provided in an embodiment of this application. The method consists of... Figure 4 The application layer shown includes the desktop application (hereinafter referred to as Desktop), the gallery application (hereinafter referred to as Gallery) including the Gallery Desktop Card module and Gallery Desktop Card Data Management module, as well as the widget framework interaction implementation in the application framework layer, such as... Figure 12 As shown, the method includes:

[0168] S1201, the desktop responds to the operation of creating a desktop card for the Gallery application and obtains the application identifier of the Gallery application.

[0169] S1202, the desktop sends a creation request carrying the application identifier of the gallery application to the widget framework.

[0170] S1203, the widget framework sends component creation instructions to the gallery desktop card module based on the application identifier of the gallery application.

[0171] S1204, the Gallery Desktop Card module responds to the component creation command and creates a custom view layout.

[0172] To enable this custom view layout to be displayed as a desktop card on the desktop of an electronic device, the custom view layout can be a view that inherits from RemoteView.

[0173] S1205, the Gallery Desktop Card module adds a ViewPager to the custom view layout.

[0174] ViewPager can be used to implement swiping browsing of images.

[0175] S1206, the Gallery Desktop Card module adds viewA, viewB, and viewC to ViewPager.

[0176] In this context, viewB is the display component, viewA is located before viewB and is the first preloaded component, and viewC is located after viewB and is the second preloaded component.

[0177] S1207, the Gallery Desktop Card module sends a custom view layout containing ViewPager, viewA, viewB, and viewC to the widget framework.

[0178] S1208, after the widget framework receives the custom view layout, it verifies the target application based on the application identifier of the target application.

[0179] S1209, if the widget framework passes the verification, it creates the desktop card corresponding to the custom view layout.

[0180] S1210, the widget framework sends the desktop card to the desktop.

[0181] S1211, Display the desktop card on the desktop and obtain the width and height of the desktop card.

[0182] S1212, the desktop sends the width and height of the desktop card to the gallery desktop card module.

[0183] S1213, after receiving the width and height of the desktop card, the gallery desktop card module sends an image retrieval request to the gallery desktop card data management module.

[0184] S1214 After receiving the image retrieval request, the Gallery Desktop Card Data Management Module retrieves and stores the number of images contained in the Gallery application and the image path of each image.

[0185] S1215, the Gallery Desktop Card Data Management Module sends the number of images N to the Gallery Desktop Card Module.

[0186] S1216, the Gallery Desktop Card module sends an image path retrieval request to the Gallery Desktop Card Data Management module.

[0187] The image path retrieval request contains the image identifiers of the first image, the second image, and the Nth image.

[0188] S1217, the Gallery Desktop Card Data Management Module sends the image paths of the first image, the second image, and the Nth image to the Gallery Desktop Card Module.

[0189] S1218, the gallery desktop card module obtains the original image with the same width and height as the desktop card based on the image path of each image and the width and height of the desktop card.

[0190] Specifically, the gallery desktop card module obtains the original image of the first image with the same width and height as the desktop card based on the image path of the first image and the width and height of the desktop card; it obtains the original image of the second image with the same width and height as the desktop card based on the image path of the second image and the width and height of the desktop card; and it obtains the original image of the Nth image with the same width and height as the desktop card based on the image path of the Nth image and the width and height of the desktop card.

[0191] S1219, the Gallery Desktop Card module loads the original image of the first image into viewB, the original image of the second image into viewC, and the original image of the Nth image into viewA.

[0192] pass Figure 11 After creating the desktop card as shown, users can manually update it by swiping the card according to their needs. Electronic devices can also automatically update the desktop card by updating the images loaded on the display component based on the refresh time of the refresh control. The following will demonstrate... Figure 12 Users can slide the desktop card to describe their needs, and through... Figure 13 For electronic devices, the refresh control can also be used to update the images loaded on the display components.

[0193] Figure 13 This paper illustrates an interactive flowchart of an image switching method provided in an embodiment of this application. The method consists of... Figure 4 The interaction between the Gallery Desktop Card module and the Gallery Desktop Card Data Management module in the application layer desktop application (hereinafter referred to as Desktop) and gallery application (hereinafter referred to as Gallery) is implemented as follows: Figure 13 As shown, the method includes:

[0194] S1301, after receiving the user's swipe operation on the desktop card of the Gallery application, the desktop sends a swipe status acquisition instruction to the Gallery desktop card module.

[0195] The swipe gesture instructs the electronic device to switch to the second image.

[0196] The swipe state acquisition command is used to indicate whether the desktop card can be swiped. For example, if the swipe state is 1, it indicates that the desktop card can be swiped; if the swipe state is 0, it indicates that the desktop card cannot be swiped.

[0197] S1302, the Gallery Desktop Card module retrieves the number of images in the gallery.

[0198] S1303, the gallery desktop card module sends the sliding status of the desktop card to the desktop based on the number of pictures in the gallery.

[0199] S1304, when the desktop indicates that the desktop card can be swiped in the swiping state, the desktop sends the swiping event corresponding to the swiping operation to the gallery desktop card module.

[0200] S1305, the Gallery Desktop Card module responds to this swipe event and gradually switches viewB to viewC.

[0201] S1306, after the desktop detects that the user has ended the swipe operation, it sends a swipe end event to the gallery desktop card module.

[0202] S1307, the Gallery Desktop Card module responds to the end of the swipe event by setting viewB as the display component, destroying the image loaded on viewA, and passing the image loaded on viewB to viewA, and passing the image loaded on viewC to viewB.

[0203] S1308, the Gallery Desktop Card module sends an image path retrieval request to the Gallery Desktop Card Data Management module.

[0204] The image path retrieval request contains the image identifier of the third image.

[0205] S1309, the Gallery Desktop Card Data Management Module sends the image path of the third image to the Gallery Desktop Card Module.

[0206] S1310, the gallery desktop card module retrieves a third image with the same width and height as the desktop card based on the image path of the third image and the width and height of the desktop card.

[0207] S1311, the Gallery Desktop Card module loads the third image on viewC.

[0208] When switching images using the above method, the image transfer only needs to be completed between the display component and the first preloading component. Even when switching from the last image to the first image, or from the first image to the last image, it is only necessary to transfer the last image or the first image loaded on the first preloading component to the display component to achieve the switching between the last image and the first image. Therefore, it can effectively improve the unresponsiveness and slow image loading problems that occur in traditional technology during image switching.

[0209] Figure 14 This paper illustrates an interactive flowchart of another image switching method provided in an embodiment of this application. The method is described by... Figure 4 The interaction between the Gallery app (hereinafter referred to as Gallery) and the Gallery desktop card data management module is shown below. Figure 14 As shown, the method includes:

[0210] S1401, The Gallery Desktop Card module determines the number of images contained in the Gallery application.

[0211] S1402, the gallery desktop card module sends a refresh command to itself every t seconds when the number of images exceeds the preset number.

[0212] Where t is the preset refresh duration.

[0213] S1403, the Gallery Desktop Card module responds to the refresh command and gradually switches viewB to viewC.

[0214] S1404, When the Gallery Desktop Card module completely switches from viewB to viewC, viewB is reset as the display component, and the images loaded on viewA are destroyed. At the same time, the images loaded on viewB are passed to viewA, and the images loaded on viewC are passed to viewB.

[0215] S1405, the Gallery Desktop Card module sends an image path retrieval request to the Gallery Desktop Card Data Management module.

[0216] The image path retrieval request contains the image identifier of the third image.

[0217] S1406, the Gallery Desktop Card Data Management Module sends the image path of the third image to the Gallery Desktop Card Module.

[0218] S1407, the gallery desktop card module retrieves a third image with the same width and height as the desktop card based on the image path of the third image and the width and height of the desktop card.

[0219] S1408, the Gallery Desktop Card module loads the third image on viewC.

[0220] The above method allows you to add a refresh control to a custom component to automatically switch images on the desktop card. Compared to the traditional method of refreshing images through interaction between the desktop card module in the application layer and the widget framework in the application framework layer, adding a refresh control to a custom component allows you to directly generate and issue refresh commands at the application layer, without needing to do so through the widget framework. Therefore, it not only allows for custom refresh times but also significantly reduces image refresh duration.

[0221] Optionally, embodiments of this application provide an image switching method applied to an electronic device, the method comprising the following steps A-C.

[0222] Step A: In response to a trigger action on a desktop card, identify the first preloaded component in the desktop card's components.

[0223] The trigger operation is used to instruct the electronic device to switch the image displayed on the desktop card. The desktop card components include a display component and multiple preloaded components. The display component shows the image displayed on the desktop card. The preloaded components load the image to be displayed. The multiple preloaded components include a first preloaded component.

[0224] Step B: Pass the first image loaded in the first preloaded component to the display component.

[0225] Step C: Display the first image using the display component.

[0226] This application also provides an electronic device, which includes a display screen, a memory, and one or more processors; the display screen, the memory, and the processors are coupled; wherein the memory stores computer program code, which includes computer instructions, and when the computer instructions are executed by the processor, the electronic device performs the multimedia resource editing method provided in the foregoing embodiments. The specific structure of this electronic device can be referred to... Figure 3 The structure of the electronic device shown is illustrated.

[0227] This application also provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the multimedia resource editing method provided in the foregoing embodiments.

[0228] This application also provides a computer program product containing executable instructions that, when run on an electronic device, cause the electronic device to perform the image switching method provided in the foregoing embodiments.

[0229] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0230] In the several embodiments provided in this application, it should be understood that the disclosed apparatus / device and method can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0231] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0232] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0233] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0234] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for switching images, characterized in that, Applied to electronic devices, including: In response to a trigger operation on a desktop card, a first preloaded component is determined from the components of the desktop card; the trigger operation is used to trigger the electronic device to switch the image displayed on the desktop card; the components of the desktop card include a display component and multiple preloaded components; the display component is used to display the image displayed on the desktop card; the preloaded component is used to load the image to be displayed; the multiple preloaded components include a pre-loaded component and a post-loaded component, the pre-loaded component is used to load the previous image displayed on the desktop card, and the post-loaded component is used to load the next image displayed on the desktop card; when the switching direction of the trigger operation indicates that the electronic device switches to the next image, the first preloaded component is the post-loaded component; when the switching direction of the trigger operation indicates that the electronic device switches to the previous image, the first preloaded component is the pre-loaded component. The first image loaded in the first preloaded component is passed to the display component; The first image is displayed through the display component.

2. The method according to claim 1, characterized in that, In response to a trigger operation on a desktop card, determining a first preloaded component among the components of the desktop card includes: In response to a trigger operation on a desktop card, determine the switching direction of the trigger operation; Based on the switching direction of the trigger operation, the first preloaded component is determined from the plurality of preloaded components.

3. The method according to claim 1 or 2, characterized in that, Before passing the first image loaded in the first preloaded component to the display component, the method further includes: Delete the image displayed on the display component; or, The image displayed on the display component is passed to the second preloading component; the first preloading component and the second preloading component are respectively used to load one and the other of the previous and next images of the image displayed on the desktop card.

4. The method according to claim 1, characterized in that, Before passing the first image loaded in the first preloaded component to the display component, the method further includes: Load the first image in the first preload component.

5. The method according to claim 4, characterized in that, The specifications of the first image are consistent with the specifications of the desktop card.

6. The method according to claim 1, characterized in that, The method further includes: In response to the operation of creating a desktop card, the desktop card is created through a custom component; the custom component includes at least one functional control; any functional control is used to instruct the electronic device to perform the function corresponding to the functional control.

7. The method according to claim 6, characterized in that, The desktop cards are created for the target application; The operation of creating a desktop card, which involves creating the desktop card using a custom component, includes: In response to the desktop card creation operation, the target application is verified; If the target application is a pre-defined whitelist application, the desktop card is created using the custom component.

8. The method according to claim 6, characterized in that, The desktop card is created for the target application; the at least one functional control includes a refresh control; the refresh control is used to instruct the electronic device to update the image displayed on the desktop card according to a preset refresh interval; The method further includes: Determine the number of images contained in the target application; If the number of images exceeds a preset number, the images displayed on the desktop card are updated according to the refresh interval.

9. An electronic device, characterized in that, The device includes a processor and a memory, the processor and the memory being coupled together, the memory storing program instructions, which, when executed by the processor, cause the electronic device to perform the method of any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, Includes computer instructions; When the computer instructions are executed on the electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-8.