Method for dragging and dropping picture, and related apparatus
By re-drawing and copying the content of the image when the user presses the target control for a long time, and creating a drag and drop box on the electronic device, the problem of cumbersome content delivery operations is solved, and rapid copying and storage is achieved, improving the user experience.
Patent Information
- Application Number
- PCT/CN2024/107357
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-06
- Filing Date
- 2024-07-24
- Publication Date
- 2025-03-13
AI Technical Summary
In the prior art, the operation of transferring content between different applications is more cumbersome, which reduces the user's experience of using electronic devices.
By long pressing the target control, if the electronic device determines that the format of the drawable object of the target control is not the first format, re-draws the drawn picture and creates a drag box to copy and store the image content of the target control, reduce the number of operations, and pull up the second application during the drag and drop.
It realizes rapid copying and storing of the image content of the target control, and prompts the user that the content has been copied through the display of the drag box, reducing the cumbersomeness of user operations and improving the user's experience of electronic devices.
Smart Images

Figure CN2024107357_13032025_PF_FP_ABST
Abstract
Description
Picture dragging method and related device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on September 6, 2023, with application number 202311150709.5 and application name “Picture Dragging Method and Related Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a picture dragging method and related devices. Background Art
[0003] With the development of terminal technology, electronic devices provide the function of copying and pasting content in applications. In a possible implementation, a user can forward content in one application on the electronic device to another application, thereby realizing the transfer and processing of content between different applications.
[0004] However, the operation of transferring content between different applications is relatively cumbersome, which may reduce the user experience of using electronic devices.
[0005] Summary of the Invention
[0006] An embodiment of the present application provides a picture dragging method, which is applied to the field of terminal technology. When a user long presses a target control, if the electronic device determines that the format of the drawable object of the target control is not a first format, the electronic device redraws the drawn picture according to the drawable object of the target control. The content of the drawn picture includes the picture content of the target control, thereby copying and storing the picture content of the target control, which can reduce the number of operations for copying the picture content of the target control. A drag box can also be created to display the drawn picture in the drag box. By displaying the drag box, the user is prompted that the picture content of the target control has been copied and stored, and the user can drag. The drag box can move with the first touch operation, and the electronic device can also pull up a second application during the movement to reduce the number of operations to start the service of receiving the picture content of the target control, which can improve the user's experience of using the electronic device.
[0007] In a first aspect, an embodiment of the present application provides a method for dragging an image, the method comprising:
[0008] The electronic device displays a first interface of a first application, the first interface includes a first view, and the first view includes a first picture. The electronic device receives a first touch operation on the first picture. When the first touch operation is long pressed, when the electronic device determines that the format of the drawable object of the first picture is not the first format, the electronic device obtains the drawable object of the first picture, redraws the second picture according to the drawable object of the first picture, and creates a drag box. The content of the second picture includes the content of the first picture. The second picture is displayed in the drag box. When the first touch operation moves, the drag box moves with the first touch operation. In response to the first touch operation moving to the first area of the display screen of the electronic device, the electronic device pulls up the second application and displays the window of the second application in the second area of the display screen. The window of the second application includes one or more icons, each icon corresponding to a service that can receive the picture displayed by the drag box. The first format is, for example, a bitmap format.
[0009] In this way, when the first touch operation is long pressed, if the electronic device determines that the format of the drawable object of the first picture is not the first format, the electronic device obtains the drawable object of the first picture, redraws the second picture according to the drawable object of the first picture, and creates a drag box. The content of the second picture is the same as that of the first picture. The electronic device can display the drag box, and the second picture is displayed in the drag box to prompt the user that the content of the first picture has been copied and stored. The user can drag and drop, which can reduce the number of operations to copy the content of the first picture. The drag box can move with the first touch operation, and also realize pulling up the second application during the movement of the first touch operation. The window of the second application includes one or more icons to facilitate the user to select the target business. The target business is the business corresponding to the target icon. In this way, the user's experience of using the electronic device can be improved.
[0010] In one possible implementation, before the electronic device obtains the drawable object of the first picture, the method further includes: the electronic device determines whether the format of the first view is the second format. When the electronic device determines that the format of the first view is the second format, the electronic device determines whether the format of the drawable object of the first picture is the first format. Alternatively, when the electronic device determines that the format of the first view is not the second format, the electronic device obtains the display area resources of the first view, redraws the third picture according to the display area resources of the first view, and creates a drag box. The third picture can be displayed in the drag box. The display area resources of the first view include the drawable object and the blank area of the first picture, and the content of the third picture includes the content of the first picture. The second format is, for example, the inherited ImageView format in the embodiment of Figure 4.
[0011] In this way, when the format of the first view is not the second format, the electronic device obtains the display area resources of the first view. The third image redrawn by the electronic device based on the display area resources of the first view can not only contain the content of the first image, but also include a blank area. This allows the content of the first image to be copied and stored when the user long presses the image, reducing the number of operations required to copy the content of the first image. The third image can also be displayed in the created drag box. The display of the drag box can prompt the user that the copying and storage of the content of the first image has been completed and the user can continue dragging.
[0012] In a possible implementation, the method further includes: when the electronic device determines that the format of the drawable object of the first picture is the first format, the electronic device obtains the first picture and creates a drag box in which the first picture can be displayed.
[0013] In this way, when the format of the first view is the second format and the format of the drawable object of the first picture is the first format, the electronic device obtains the drawable object of the first picture, that is, obtains the bitmap corresponding to the first picture, and creates a drag box so that the drag box displays the first picture. When the user long presses, the content of the first picture can be copied and stored without redrawing the image resources of the first view. This not only reduces the number of operations for copying the content of the first picture, but also creates the drag box more quickly than when redrawing the drawable object of the first picture, prompting the user earlier that the copying and storage of the content of the first picture have been completed and the user can drag.
[0014] In a possible implementation, the first format is a bitmap format, and the second format represents an implementation that inherits the native image view of Android.
[0015] In this way, by judging the form of the image resource of the first view, different acquisition methods can be used to obtain the picture displayed in the drag box. By judging the format of the first view, different acquisition methods can be used to obtain the picture displayed in the drag box.
[0016] In one possible implementation, the method further includes: when the electronic device redraws the second image based on the drawable object of the first image, the electronic device starts a first timer, the first timer being set to a first duration, and when the first timer reaches the first duration, the electronic device deletes the stored second image.
[0017] In this way, sufficient storage space can be provided for the next storage of picture content, and the probability of malicious spread of pictures stored in the electronic device can be reduced.
[0018] It is understood that if the electronic device stores the first picture, then when the first timer reaches the first duration, the electronic device deletes the stored first picture. If the electronic device stores the third picture, then when the first timer reaches the first duration, the electronic device deletes the stored third picture.
[0019] In one possible implementation, the method further includes: when the first touch operation moves to a position of a target icon among the one or more icons, in response to the first touch operation being lifted, the second application transmits a universal resource identifier (URI) of an image displayed in the drag box to a service corresponding to the target icon. The service corresponding to the target icon obtains the image displayed in the drag box based on the URI.
[0020] In this way, the first touch operation moves to the position of the target icon in one or more icons. In response to the first touch operation being lifted, the second application passes the Uri to the business corresponding to the target icon. The business corresponding to the target icon obtains the content of the first picture based on the Uri, thereby realizing convenient and fast transmission of the content of the first picture between the first application and the target business, reducing the user's operation steps to start the target business, and improving the user experience.
[0021] In one possible implementation, the method further includes: when the first touch operation moves to a third area of the display screen and the drag box moves to the third area along with the first touch operation, in response to the first touch operation being lifted, the electronic device controls the drag box to return to the position where the dragging started, and the electronic device deletes a stored image displayed by the drag box. The third area does not include the second area.
[0022] In this way, in a scenario where the first touch operation is lifted without moving to the second area, in response to the first touch operation being lifted, the electronic device controls the drag box to return to the position where the dragging started, thereby realizing a visual experience of drag cancellation, which can improve the user experience. The electronic device deletes the stored pictures included in the drag box to provide sufficient storage space for the next storage of the picture content, and can also reduce the probability of the pictures stored in the electronic device being maliciously spread.
[0023] In a possible implementation, the second area is a sidebar on the right side of the display screen.
[0024] In this way, a display space is reserved for the window of the first application to facilitate the user to view and search, and it is also convenient for the user to drag the drag box and select the target icon, which can improve the user experience.
[0025] In one possible implementation, before the electronic device obtains a drawable object for a first image, the electronic device further includes: in response to a first touch operation, the electronic device starting a second timer and a third timer, the second timer setting a second timer duration, the third timer setting a third timer duration, the third timer duration being the sum of the second timer duration and a delay duration. If the first touch operation is maintained and a long press is performed, in response to the second timer reaching the second time duration, the electronic device displays a first pop-up window around the first image, the first pop-up window including one or more controls. If the first touch operation is maintained and a long press is performed, in response to the third timer reaching the third time duration, the electronic device queries that the electronic device displayed the first pop-up window in response to the first touch operation, and the electronic device starts a fourth timer setting a fourth timer duration, the fourth timer setting a fourth time duration being greater than or equal to the delay duration. The electronic device obtains the drawable object for the first image, redraws the drawable object for the first image to obtain a second image, and creates a drag box, including: in response to the fourth timer reaching the fourth time duration, the electronic device obtains the drawable object for the first image, redraws the drawable object for the first image to obtain the second image, creates a drag box, and displays the drag box.
[0026] In this way, the third duration can be used to determine whether the user intention corresponding to the first touch operation is a drag intention. When the first touch operation is kept long pressed, if the third timer reaches the third duration, the electronic device displays a pop-up window. The user intention corresponding to the first touch operation may be the intention to operate the pop-up window, or it may be the intention to drag. The fourth timer and the fourth duration can be used to further accurately determine whether the user intention corresponding to the first touch operation is a drag intention. If the first touch operation is not moved or lifted when the fourth timer reaches the fourth duration, it can be determined that the user intention corresponding to the first touch operation is a drag intention. The electronic device can display a drag box to prompt the user that the copying of the content of the first picture has been completed and can be dragged when the first touch operation is not lifted or moved. The number of operations for copying the content of the first picture can be reduced, thereby improving the user's experience of using the electronic device. The third duration is the sum of the second duration and the delay duration, and can also achieve compatibility between the display logic of the drag box and the display logic of the pop-up window.
[0027] In one possible implementation, the method further includes: the electronic device displays a second interface of a third application, the second interface includes a second view, and the second view includes a fourth image. In response to a second touch operation on the fourth image, the electronic device starts a second timer and a third timer. When the second touch operation is long pressed, in response to the second timer reaching a second duration, the electronic device displays a second pop-up window around the fourth image, the second pop-up window including one or more controls. When the third timer does not reach the third duration, in response to the second touch operation being moved or lifted, the electronic device turns off the third timer.
[0028] Thus, if the third timer does not reach the third duration and the second touch operation moves or is lifted, it can indicate that the user intention corresponding to the second touch operation is not a drag intention. After determining that the user intention is not a drag intention, the electronic device turns off the third timer, terminates the subsequent drag process, and reduces power consumption of ineffective dragging.
[0029] In a possible implementation, the method further includes: the electronic device displays a third interface of a fourth application, the third interface includes a third view, and the third view includes a fifth picture. In response to the third touch operation on the fifth picture, the electronic device starts the second timer and the third timer. When the third touch operation is kept long pressed, in response to the second timer reaching the second duration, the electronic device displays a third pop-up window around the fifth picture, and the third pop-up window includes one or more controls. When the third touch operation is kept long pressed, in response to the third timer reaching the third duration, the electronic device queries that the electronic device has displayed the third pop-up window in response to the third touch operation, and the electronic device starts a fourth timer, and the timing duration of the fourth timer is the fourth duration. The fourth duration is greater than or equal to the delay duration. When the fourth timer does not reach the fourth duration, in response to the third touch operation moving or lifting, the electronic device turns off the fourth timer.
[0030] Thus, if the fourth timer does not reach the fourth duration and the third touch operation is moved or the third touch operation is lifted, it can indicate that the user intention corresponding to the third touch operation is not a drag intention. After determining that the user intention is not a drag intention, the electronic device turns off the fourth timer, terminates the subsequent drag process, and reduces power consumption of ineffective dragging.
[0031] In a second aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory. The memory stores computer-executable instructions. The processor executes the computer-executable instructions stored in the memory, causing the electronic device to perform the method of the first aspect.
[0032] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method of the first aspect.
[0033] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is run, it enables the computer to execute the method of the first aspect.
[0034] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the method of the first aspect.
[0035] It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] FIG1 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application;
[0037] FIG2 is a software structure block diagram of the electronic device 100 provided in an embodiment of the present application;
[0038] FIG3 is a diagram of a picture dragging scene provided in an embodiment of the present application;
[0039] FIG4 is a flowchart of a module interaction provided in an embodiment of the present application;
[0040] FIG5 is a flowchart of module interaction in a scenario where a finger moves before a third timer times out, according to an embodiment of the present application;
[0041] FIG6 is a flowchart of module interaction in a scenario where a finger is lifted before the third timer times out, according to an embodiment of the present application;
[0042] FIG7 is a scene diagram of a new window popping up around a target control provided by an embodiment of the present application;
[0043] FIG8 is a schematic diagram of a bitmap acquisition process according to an embodiment of the present application;
[0044] FIG9 is a flowchart of module interaction in a finger movement scenario after calling the drag framework interface according to an embodiment of the present application;
[0045] FIG10 is a flowchart of a module interaction in a scenario where a finger is lifted after calling an interface of a drag framework according to an embodiment of the present application;
[0046] FIG11 is a flowchart of another module interaction in a scenario where a finger is lifted after calling an interface of a drag framework according to an embodiment of the present application;
[0047] FIG12 is another module interaction flow chart provided in an embodiment of the present application;
[0048] FIG13 is a schematic diagram of a display interface provided in an embodiment of the present application;
[0049] FIG14 is a scene diagram of a finger being lifted after calling the drag frame interface according to an embodiment of the present application;
[0050] FIG15 is a schematic diagram of the process of saving a whitelist provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] To facilitate a clear description of the technical solutions of the embodiments of the present application, some of the terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0052] 1. Electronic devices
[0053] The electronic devices of the embodiments of the present application may include handheld devices, vehicle-mounted devices, etc. with image processing functions. For example, some electronic devices include: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving cars, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, in-vehicle devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks. The terminal equipment in the network (PLMN), etc., is not limited to this in the embodiments of the present application.
[0054] As an example and not a limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as hearing aids, glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0055] In addition, in the embodiment of the present application, the electronic device can also be an electronic device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-to-object interconnection.
[0056] The electronic devices in the embodiments of the present application may also be referred to as: user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0057] In the embodiments of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also known as main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as the Linux operating system, the Unix operating system, the Android operating system, the iOS operating system, or the Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0058] 2. Touch events
[0059] A touch event refers to an event generated by an electronic device when a finger touches the display screen of the electronic device. A touch event includes a touch type, a touch position, and a sampling point. Touch types include down, move, and up. The touch position can be the coordinates of the point where the finger contacts the display screen. The sampling point can represent the timestamp of the touch operation. Touch events include down events, move events, or up events. If the touch type of a touch event is down, the touch event can be called a down event. If the touch type of a touch event is move, the touch event can be called a move event. If the touch type of a touch event is up, the touch event can be called a lift event.
[0060] It is understandable that the display screen of the electronic device may be a touch screen.
[0061] 3. Falling events
[0062] A drop event is an event generated by an electronic device when a finger first touches its display. A drop event includes the touch type, touch location, and sampling point. The sampling point of a drop event can be the time when the finger first touches the display.
[0063] 4. Mobile Events
[0064] A move event is generated when a finger touches the display of an electronic device and the device samples the touch position at a fixed sampling frequency while the finger remains on the display. A move event includes the touch type "move," the touch position, and the sampling point. While the finger remains on the display, the device generates and transmits a move event each time it samples the touch position at a fixed sampling frequency.
[0065] It is understandable that after a finger touches the display screen for the first time, the finger presses the display screen for a long time, or the finger moves on the display screen, the electronic device will continue to generate and transmit movement events at a fixed sampling frequency.
[0066] Exemplarily, the event processing framework of the electronic device can generate a drop event and a move event in the process of a finger long pressing the display screen, and pass an event to the module that needs the event each time an event is generated. When receiving a move event, the module that needs the event can determine whether the operation of the finger on the display screen is a long press operation or a move operation based on the first threshold and the distance between the touch position of the move event and the touch position of the drop event. The distance between the touch position of the move event and the touch position of the drop event can be called an offset. Exemplarily, if the offset does not exceed the first threshold, the electronic device can determine that the operation of the finger on the display screen is a long press operation. If the offset exceeds the first threshold, the electronic device can determine that the operation of the finger on the display screen is a move operation.
[0067] 5. Raise event
[0068] A lift event is an event generated by an electronic device when a finger is lifted from the display screen of the electronic device, that is, when the finger leaves the display screen. A lift event includes a touch type up, a touch position, and a sampling point. The sampling point of a lift event can be the first sampling point after the finger is lifted where the electronic device does not capture the touch position. The touch position in a lift event can be the touch position of the last move event before the finger is lifted. The touch position in a lift event can represent the position where the finger is lifted.
[0069] 6. Bitmap
[0070] A bitmap is a representation of an image in memory. A bitmap is a collection of pixels. Any image loaded into memory becomes a bitmap object.
[0071] 7. Drawable
[0072] A drawable can have multiple formats. For example, a drawable can be a bitmap drawable (BitmapDrawable), a vector drawable (VectorDrawable), or a custom drawable (custom drawable).
[0073] 8. Some terms
[0074] In the embodiments of this application, terms such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the terms "first chip" and "second chip" are used solely to distinguish between different chips and do not define their order. Those skilled in the art will understand that terms such as "first" and "second" do not define the quantity or execution order, and do not necessarily define differences.
[0075] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0076] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0077] It should be noted that the "at..." in the embodiments of the present application can be the instant when a certain situation occurs, or it can be a period of time after the situation occurs, and the embodiments of the present application do not specifically limit this. In addition, the display interface provided in the embodiments of the present application is only an example, and the display interface can also include more or less content.
[0078] In order to better understand the embodiment of the present application, the structure of the electronic device according to the embodiment of the present application is described below with reference to FIG1 and FIG2 :
[0079] FIG1 shows a schematic structural diagram of an electronic device 100 .
[0080] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0081] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0082] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0083] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0084] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0085] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0086] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0087] FIG2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application.
[0088] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers: from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, the hardware abstraction layer, and the Linux kernel layer.
[0089] The application layer can include a series of application packages.
[0090] As shown in FIG2 , the application package may include social networking, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0091] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0092] As shown in FIG2 , the application framework layer may include a window management framework, a content recognition and filling framework, a content storage service, a view framework, a drag and drop framework, a resource manager, a notification manager, an event processing framework, and the like.
[0093] The window management framework can be used to manage window programs. The window management framework can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0094] The content recognition filling framework is a new module added in the embodiment of the present application. It can be used to obtain the content of the control and use this content to create a drag box so that the drag frame controls the movement of the drag box following the movement of the finger to realize the dragging of the content of the control.
[0095] The content storage service is also a new module added to the embodiments of this application. It can be used to store image bitmaps and periodically clear these bitmaps. Bitmaps can be used to create drag boxes and process services. As a system service, the information stored in the content storage service cannot be accessed by unauthorized applications, thus improving the security of the stored information.
[0096] The view framework can include visual controls, such as text controls for displaying text and image controls for displaying images. The view framework can be used to build applications. A display interface can be composed of one or more views. Both text controls and image controls are views. For example, the display interface presented on the WeChat chat page can include multiple text controls and multiple image controls.
[0097] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0098] The drag frame can be used to monitor changes in the touch position in the window management framework and control the movement of the drag frame as the touch position changes.
[0099] The event processing framework is used to obtain the original input event corresponding to the touch operation from the kernel layer (including touch coordinates, touch operation timestamp and other information) and identify the control corresponding to the input event.
[0100] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0101] The Android Runtime consists of the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0102] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0103] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0104] The system library can include multiple functional modules, such as a surface manager, a multimedia library, a graphics rendering library (such as OpenGL ES), a relational database, etc.
[0105] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0106] The multimedia library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0107] The graphics rendering library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0108] Relational databases are used to store preset data.
[0109] The hardware abstraction layer may include an audio abstraction interface, a Bluetooth abstraction interface, etc.
[0110] The Linux kernel layer is the layer between hardware and software. The kernel layer may include display drivers, camera drivers, Bluetooth drivers, audio drivers, USB drivers, wifi1q drivers, etc.
[0111] The following describes the workflow of the software and hardware of the electronic device 100 in combination with the social application activation scenario.
[0112] When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, touch operation timestamp, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a single-click operation and the control corresponding to the single-click operation is a control of a social application icon, the social application calls the application framework layer's interface to launch the social application.
[0113] Some electronic devices provide a function for forwarding content in applications. In a possible implementation, content from one application can be transferred to another application in the following ways:
[0114] S1. A user taps a display screen of an electronic device to open an application, such as Application A. In response to the user's tap, the electronic device displays an interface of Application A. Application A's interface may include at least one control, such as an image control a. Application A may be the WeChat application.
[0115] S2. The user clicks on the picture control a. In response to the user's click operation, the electronic device displays the picture of the picture control a and the download control in full screen.
[0116] S3. The user can click the download control to save the image of the image control a to the album application.
[0117] S4. The user clicks or slides the display screen to switch application A to the background, or exits application A.
[0118] S5. The user taps the display screen of the electronic device to open another application on the electronic device, such as application B. Application B can be an image processing application or another application, such as a note-taking application. In response to the user's tap, the electronic device displays the display interface of application B, which can include an add button.
[0119] S6. The user clicks the add button. In response to the user's click operation, the electronic device displays a display interface of the photo album application, where the display interface of the photo album application includes the picture of the picture control a.
[0120] S7: The user may click on the image of the image control a in the display interface of the photo album application. In response to the user's click operation, the electronic device adds the image of the image control a to the display interface of application B.
[0121] S8. The user may operate on the display interface of application B to process the image of image control a.
[0122] In this way, the image of the image control a is transferred and processed between different applications (such as application A and application B).
[0123] However, transferring the image of image control a between application A and application B requires the user to click the image of image control a twice to complete the copying and storage of the image of image control a. This operation is cumbersome and may reduce the user experience of using the electronic device.
[0124] In view of this, an embodiment of the present application provides a method for dragging a picture. When the user long presses the target control, if the electronic device determines that the format of the drawable object of the target control is not a first format (for example, a bitmap format), the electronic device redraws the drawn picture according to the drawable object of the target control. The content of the drawn picture includes the picture content of the target control, thereby copying and storing the picture content of the target control. This can reduce the number of operations for copying the picture content of the target control, and can also create a drag box so that the drag box displays the drawn picture. By displaying the drag box to prompt the user that the picture content of the target control has been copied and stored, the user can drag. The drag box can move with the first touch operation, and the electronic device can also pull up the second application during the movement of the first touch operation. It can also reduce the number of operations to start the service of receiving the picture content of the target control, and can improve the user's experience of using the electronic device.
[0125] The first application may be any application on the electronic device. For example, the first application may be a WeChat application, a QQ application, a note application, a music application, or an image processing application.
[0126] The image dragging method provided by this application is described below with reference to some embodiments.
[0127] Taking the first application as the WeChat application and the target page of the first application as a chat page of the WeChat application as an example, Figure 3 shows a picture dragging scene diagram provided by an embodiment of the present application.
[0128] The user can tap the display of the electronic device to open the target page of the first application. The electronic device may display the interface shown in Figure 3a. The interface shown in Figure 3a includes controls 301, 302, 303, 304, 305, 306, 309, the text "aaa", controls 310, 311, an input box 312, 313, and 314. Controls 301, 303, 305, and 306 may all be image controls. Image controls may contain images. Controls 302 and 304 may all be text controls. Text controls may contain text content. As shown in Figure 3a, controls 301, 303, and 305 may be WeChat avatars. Controls 302, 304, and 306 may contain chat content, with control 306 being a picture taken by the user using the electronic device. Control 309 indicates a return. aaa indicates a friend's nickname. Control 310 indicates more. Control 311 is a control for representing speech, control 313 is a control for representing expression, and control 314 is a control for representing addition.
[0129] In the interface shown in a in Figure 3, the user can long press the control 306, and the electronic device responds to the long press operation, and the electronic device can display the interface shown in b in Figure 3. As shown in the interface in b in Figure 3, the interface may include long press feedback 307. For other display contents of the interface shown in b in Figure 3, please refer to the contents of the interface shown in a in Figure 3, which will not be repeated here. The long press feedback 307 can be superimposed on the interface of the control 306 corresponding to the long press position. On the interface shown in b in Figure 3, the control 306 displays a shadow. The control 306 displays a shadow to prompt the user that the electronic device is generating a drag box.
[0130] It is understood that when a user long presses the display screen of an electronic device, the electronic device will display long press feedback. The long press feedback can be visual feedback or tactile feedback. The visual feedback can be long press feedback 307 as shown in FIG3 b. If the long press feedback is tactile feedback, the long press feedback is not visible.
[0131] On the interface shown in b in Figure 3, the user's finger can be kept pressed, and the electronic device can display the interface shown in c in Figure 3. As shown in the interface in c in Figure 3, the interface includes a drag box 308, and the position of the drag box 308 is consistent with the touch position of the finger. The drag box 308 includes the picture content of the control 306, the drag box shadow and the drag box rounded corners. The drag box 308 can be generated by the electronic device using the picture content of the control 306 in response to the user's long press operation on the interface shown in b in Figure 3. For other display contents of the interface shown in c in Figure 3, please refer to the contents of the interface shown in b in Figure 3, which will not be repeated here. On the interface shown in c in Figure 3, the control 306 does not display a shadow.
[0132] It is understood that a hotspot can be set on the display screen of an electronic device. For example, the hotspot can be hotspot 31 shown in FIG3C. Hotspot 31 is not visible. The hotspot can represent a preset area. When a user's finger touches the hotspot, a second application can be launched. The second application can be used to provide an entry point for transferring the content of the drag box.
[0133] In the interface shown in c of Figure 3 , the user can move the finger to make the drag box 308 move along with the finger. When the finger moves to the hot zone 31 of the electronic device display, the electronic device can display the interface shown in d of Figure 3 .
[0134] As shown in d in Figure 3, the interface includes a drag box 308, a page window 30 of the first application, a sidebar 32, and an invisible hot zone 31. The sidebar 32 includes an icon 321 of the QQ application, an icon 322 of the music application, an icon 323 of the image processing application, an icon 324 of the note application, an icon 325 of the send to WeChat status service, an icon 326 of the send to QQ friends service, and an icon 327 of the video application. The drag box 308 is above the page window 30. The drag box 308 can be displayed on the interface above the page window 30. The content in the page window 30 refers to the content of the interface shown in a in Figure 3, which will not be repeated here.
[0135] The sidebar 32 may represent a window for a second application. The window for the second application includes multiple sub-service icons. A sub-service may be any application on the electronic device, or any service provided by the application. For example, a sub-service may be an application such as the QQ application, WeChat application, a note application, a music application, or an image processing application. A sub-service may also include a service provided by the WeChat application that sends to WeChat status or a service provided by the QQ application that sends to QQ friends.
[0136] The sub-service icons can be displayed in a flowing manner in the sidebar 32. The user can drag the drag box 308 onto the target sub-service icon, so that the target sub-service uses the image content of the control 306 to perform service processing.
[0137] For example, taking the target sub-business as a note processing application, on the interface shown in FIG3 d, the user can drag the drag box 308 to the top of the note application icon 324 by moving a finger. The electronic device can display the interface shown in FIG3 e. For the content of the interface shown in FIG3 e, refer to the content of the interface shown in FIG3 d. The difference between the interface shown in FIG3 e and the interface shown in FIG3 d is that in the interface shown in FIG3 e, the drag box 308 is located above the note application icon 324 in the sidebar 32.
[0138] On the interface shown in e of Figure 3 , the user can lift their finger, and the electronic device can display the interface shown in f of Figure 3 . The interface shown in f of Figure 3 includes a control 341 indicating return, a control 342 indicating the previous step, a control 343 indicating the next step, a control 344 indicating selection, a title input box 345, the text "Today 8:00", a control 346 indicating a category, and the image content 347 of control 306.
[0139] The user drags the drag box 308 over the note-taking application icon 324 and lifts their finger. The second application recognizes that the icon corresponding to the touch location of the lift event is the note-taking application icon, and the second application can determine that the target sub-service is the note-taking application. The second application can pull up the note-taking application, allowing the note-taking application to obtain the image content of the control 306, and then the electronic device displays the page shown in FIG. 3 f, so that the user can continue to operate on the page shown in FIG. 3 f.
[0140] For example, taking the Send to QQ Friends service provided by the QQ application as the target sub-service, in the interface shown in FIG3(d), the user can move a finger to drag the drag box 308 above the Send to QQ Friends service icon 326. The electronic device may display the interface shown in FIG3(g). The interface shown in FIG3(g) includes a page window 30, a sidebar 32, a drag box 308, and a long press feedback 307. The sidebar 32 includes an icon 323 for an image processing application, an icon 324 for a note application, an icon 325 for a Send to WeChat Status service, an icon 326 for a Send to QQ Friends service, an icon 327 for a video application, an icon 328 for a Weibo application, and an icon 329 for an album application. In the interface shown in FIG3(g), the drag box 308 is located above the Send to QQ Friends service icon 326 in the sidebar 32.
[0141] On the interface shown in g in Figure 3, the user can lift his finger, and the electronic device can display the interface shown in h in Figure 3. The interface shown in h in Figure 3 includes a close control 361, the text "Send to", a multi-select control 362, a search box 363, the text "Recent Chats", a create new chat control 364, a my computer control 365, a friend B control 366, a group chat A control 367, a friend C control 368, and a group chat B control 369.
[0142] The user drags the drag box 308 over the Send to QQ Friends service icon 326. When the user lifts their finger, the second application identifies the icon corresponding to the touch location of the lift event as the Send to QQ Friends service icon. The second application determines that the target sub-service is the Send to QQ Friends service. The second application launches the QQ application, causing the QQ application to launch the Send to QQ Friends service. This in turn enables the Send to QQ Friends service to obtain the image content of control 306, causing the electronic device to display the interface shown in Figure 3(h) so that the user can continue to operate on the interface shown in Figure 3(h). On the interface shown in Figure 3(h), the user can select a friend or group chat by clicking a friend control or group chat control. The image in control 306 will be sent to the selected friend or group chat. A friend control, for example, is the Friend B control 366 or the Friend C control 368 in the interface shown in Figure 3(h). A group chat control, for example, is the Group Chat A control 367 or the Group Chat B control 369 in the interface shown in Figure 3(h).
[0143] The image dragging method provided in this embodiment enables the copying of the image content of the target control when the user long presses the target control (such as control 306). By displaying a drag box, the user can be prompted that the copying of the image content of the target control has been completed. The user can drag the drag box. When the user drags the drag box and moves it above the target sub-service icon, the user can lift it up. In response to the user's lift-up operation, the second application identifies the target sub-service and pulls up the target sub-service, so that the sub-service obtains the image content of the target control in a timely manner for business processing. The image dragging method provided in this embodiment enables the user to long press the target control and then move the finger, so that the image content of the target control is transferred to the target sub-service. The image of the target control can be copied without clicking the image of the target control twice. The user does not need to click the application corresponding to the target sub-service multiple times. The target sub-service can be pulled up by the second application, so that the target sub-service obtains the image content of the target control. The overall operation is simple and convenient, which can improve the user's experience of using electronic devices.
[0144] The above describes the scenario of dragging the image of the target control of the first application in conjunction with the drag scenario shown in FIG3 .
[0145] In the dragging scenario shown in FIG3 , the format of the image control in the first application may be the second format or not. The format of the image control is the second format, for example, the format of the image control is an inherited ImageView format. Inheriting ImageView can mean inheriting the implementation of the native Android image control (ImageView). The implementation of the native Android image control (ImageView), for example, the code writing method and design pattern of the native Android image control (ImageView). The format of the image control in the first application is an inherited ImageView format, which can be understood as the implementation of the image control in the first application inheriting the implementation of the native Android image control (ImageView). It can be understood that the format of the image control in the first application is an inherited ImageView format, and the implementation of the image control in the first application inherits the implementation of the native Android image control (ImageView). The implementation of the image control in the first application can also extend the functionality of the native ImageView. The format of the image control is not the second format, for example, the format of the image control is not an inherited ImageView format, or the format of the image control is not an inherited ImageView format. The non-inherited ImageView format can be a format customized by the application developer (or third party).
[0146] Image controls that inherit the ImageView format can proactively report their image content. Image controls that do not inherit the ImageView format cannot proactively report their image content. The image control format can be set by the developer of the first application.
[0147] The following describes a method for dragging an image in a scenario where the image control of the first application can actively report image content and a method for dragging an image in a scenario where the image control of the first application cannot actively report image content.
[0148] For the scenario where the picture control of the first application can actively report the picture content, FIG4 shows a module interaction flow chart provided in an embodiment of the present application.
[0149] As shown in FIG4 , the image dragging method provided in the embodiment of the present application includes:
[0150] S100: A user opens a first application interface.
[0151] For example, the user may click on the display screen of the electronic device to open the target page of the first application.
[0152] S101. An application (APP) loads the contents of each view (view) in a target page into a view framework (view framework).
[0153] In this way, it is convenient to display each control and the content of each control in the target page. The target page displayed by the electronic device may be an interface as shown in a of FIG3 .
[0154] It is understood that each time a user opens a page of the first application, the application loads the content of each view in that page through the view framework. For example, if a user opens page A of the first application, the application loads the content of each view in page A through the view framework. If the user switches page A to page B of the first application, the application loads the content of each view in page B through the view framework.
[0155] S102: The view framework transfers the root layout of the target page to the content recognition and filling framework.
[0156] For example, when the view framework obtains the content of each view in the target page, it can generate a root layout of the target page. The root layout can include DecorView. The view framework passes the root layout to the content-aware fill framework.
[0157] It is understandable that each time a user opens a page, the view framework can pass the root layout of the page opened by the user to the content recognition filling framework.
[0158] The content-aware fill framework obtains the root layout of the target page so that the required image control can be found from the root layout. It can be understood that the image control belongs to the view.
[0159] S103: The content recognition and filling framework determines whether the application package name and / or page name of the target page is in the whitelist.
[0160] For example, the whitelist may include multiple application package names (package names) that support system dragging, multiple page names (activity names) that support system dragging, and multiple control names (view names) that support system dragging. Optionally, the whitelist may also include the type of control corresponding to the control name. For example, the whitelist format may be as follows:
[0161] In this field, version represents the version. encoding represents the encoding. whiteList represents the whitelist. com.XXXXX.xhs represents the application package name. com.test.white.demo represents the application package name. com.XXX.XXX represents the application package name. com.XXX.MainActivity represents the page name. com.XXX.TextMainActivity2 represents the page name. activitya_viewa represents the control name. activitya_viewb represents the control name. ccTextView represents the control name. ddView represents the control name. The control name can indicate the class of the control in the page to which it belongs. type represents the type. "text" in type="text" represents the text type. "image" in type="image" represents the image type.
[0162] Controls with different control names can have different or the same types. For example,<view name=“activitya_viewa”type=“text” / > It can indicate that the type of the control named activitya_viewa is a text type, or that the control named activitya_viewa is a text control.<view name=“activitya_viewb”type=“image” / > It can indicate that the type of the control named activitya_viewb is a picture type, or that the control named activitya_viewb is a picture control.<view name=“ddView”type=“image” / > It can indicate that the type of the control named ddView is also a picture type, or that the control named ddView is a picture control.
[0163] The names of different controls can be the same or different. For example, in the interface shown in b in Figure 3, the page name is com.XXX.MainActivity. Controls 301, 303, 305, and 306 can all be named activitya_viewb. Controls 302 and 304 can both be named activitya_viewa.
[0164] The content-aware fill framework can determine whether the application package name and / or page name of the root layout is in the whitelist. For example, based on the application package name and / or page name of the root layout, the content-aware fill framework checks whether the application package name and / or page name is included in a pre-stored whitelist.
[0165] S104: The content recognition filling framework transmits the judgment result to the view framework.
[0166] For example, the judgment result may include a negative judgment result or a positive judgment result. A negative judgment result is, for example, false. A positive judgment result is, for example, true.
[0167] If the application package name and page name of the target page are not in the whitelist, the content recognition fill framework can transmit false to the view framework. In this way, after the view framework subsequently receives a drop event of touching the control of the first application, it is not necessary to pass the drop event to the content recognition fill framework to terminate the subsequent drag process. The application package name and page name of the target page are not in the whitelist, which may indicate that the first application does not support system drag. The fact that the first application does not support system drag may indicate that the first application is a protected application. When it is determined that the application package name and page name of the root layout are not in the whitelist, subsequent drag-related actions may not be performed to save power consumption of electronic devices caused by invalid dragging, and the protected first application will not be spread due to random dragging by the user.
[0168] If the target page's application package name and / or page name is in the whitelist, the content-aware fill framework can transmit a true value to the view framework. In this way, upon receiving a drop event for a control touching the first application, the view framework can pass the drop event to the content-aware fill framework to continue the subsequent drag process.
[0169] S200: The event processing framework obtains a touch event indicating that a target control is touched.
[0170] For example, the target control can be any image control in the target page. In this embodiment, the target control is still described as control 306 in the interface shown in FIG. 3B. Touch events associated with a target control being touched can include a drop event and a move event. For example, when a user long-presses a target control with their finger and does not lift the finger, the event processing framework can sequentially receive a drop event and at least one move event.
[0171] S201: The event processing framework transmits a touch event to the window management framework.
[0172] Exemplarily, in response to a long press operation by the user, the event processing framework sequentially transmits a drop event and a move event to the window management framework.
[0173] It is understandable that as long as the finger is not lifted, the event processing framework will continue to transmit the movement event to the window management framework.
[0174] S202: The window management framework transmits the touch event to the view framework.
[0175] S203: If the view framework has received a positive result transmitted by the content recognition and filling framework, the view framework transmits the touch event to the content recognition and filling framework.
[0176] For example, if the view framework receives true from the content recognition filling framework in step S104, the view framework transmits the drop event to the content recognition transmission framework when receiving the drop event. When the view framework receives the move event, the view framework transmits the move event to the content recognition transmission framework.
[0177] Alternatively, if the view framework receives a false value from the content-aware fill framework in step S104, the view framework does not pass the drop event to the content-aware fill framework upon receiving the drop event, thereby terminating the subsequent drag process. The view framework also does not pass the move event to the content-aware transmission framework upon receiving the move event.
[0178] S204: The content recognition filling framework responds to the drop event and sets a third timer.
[0179] For example, the third timing duration of the third timer is the sum of the system long press duration of the electronic device and the first extended duration, that is, the third timing duration = the system long press duration + the first extended duration. The third timer can be a message processing handler.
[0180] The system long press duration is the duration used by the native system of the electronic device to determine the intention of a long press. The system long press duration can be 400 milliseconds. The first extended duration can be 50 milliseconds.
[0181] The third timing duration is greater than the system long press duration. On the one hand, it can achieve compatibility between the image dragging method provided in the embodiment of the present application and the native system logic of the electronic device. On the other hand, it can be used to determine whether the user's long press intention is a drag intention, and can also be used to guide further judgment of the user's long press intention.
[0182] For example, if the user's long press duration reaches the system long press duration, a new window pops up on the electronic device around the target control. When the third timer reaches the third timing duration, the content recognition filling framework can execute steps S209-S213 to further determine whether the user's real intention of long pressing is to drag or to operate the new window.
[0183] If the user's long press duration reaches the system long press duration, and no new window pops up on the electronic device around the target control, then when the third timer reaches the third timing duration, the content recognition filling framework can determine that the user's true intention of long press is dragging intention. The content recognition filling framework does not need to further judge the user's long press intention, and directly executes drag-related actions without further judging the user's long press intention.
[0184] For example, after the third timer is set, there may be a scenario where the finger is long pressed, the finger is moved, or the finger is lifted, and the content recognition filling framework may receive a movement event or a lift event.
[0185] After the third timer is set and before the third timer expires, if the content-aware fill framework receives a move event, the content-aware fill framework may determine whether the distance between the touch location of the move event and the touch location of the drop event exceeds a second threshold. Optionally, the second threshold may be the same as or different from the first threshold.
[0186] If the distance between the touch position of the move event and the touch position of the drop event exceeds the second threshold, it may indicate that the user's operation is a move operation or finger movement, or it may indicate that the user's operation intention is not a drag intention. The content recognition filling framework cancels the third timer to terminate subsequent drag-related actions.
[0187] If the distance between the touch position of the moving event and the touch position of the drop event does not exceed the second threshold, it may indicate that the user's operation is a long press operation or a long press of the finger. It may also indicate that the user's operation intention may be a drag intention, or it may be an intention to make the electronic device pop up a new window. In this case, the content recognition filling frame will not be processed.
[0188] The module interaction flow chart in the finger movement scenario before the third timer exceeds the third timing duration is shown in the subsequent Figure 5. For ease of understanding, the module interaction flow chart shown in Figure 5 will be described later.
[0189] After the third timer is set and before the third timer exceeds the third timing duration, if the content-recognizing fill framework receives a lift event, which can indicate that the user's operation is a lift operation or finger lift, or that the user's operation intention is not a drag intention, the content-recognizing fill framework cancels the third timer to terminate the execution of subsequent drag-related steps. The process of the content-recognizing fill framework receiving a lift event is similar to the process of the content-recognizing fill framework receiving a drop event, and will not be repeated here.
[0190] The module interaction flow chart in the scenario where the finger is lifted before the third timer exceeds the third timing duration is shown in the subsequent Figure 6. For ease of understanding, the module interaction flow chart shown in Figure 6 will be described later.
[0191] When the third timer reaches the third timing duration, the content recognition filling framework executes step S209.
[0192] Optionally, before the third timer exceeds the third timing duration and the drag box is created, if the content recognition filling framework determines that the user's operation is a moving operation or a lifting operation based on the moving event or the lifting event, indicating that the user's operation intention is not a dragging intention, then the content recognition filling framework can terminate the execution of subsequent drag-related steps.
[0193] Both the moving operation and the lifting operation indicate that the user's operation intention is not a dragging intention. When the content recognition filling framework determines that the user's operation intention is not a dragging intention, the third timer is canceled or the subsequent drag-related steps are terminated. In this way, the power consumption of the electronic device can also be reduced.
[0194] S205: The touch event is transmitted internally in the view framework.
[0195] Exemplarily, after receiving the drop event, the view framework transmits the drop event to the root layout of the target page based on the touch position of the event.
[0196] For example, the drop event can be transmitted layer by layer in the order of application → page → control.
[0197] In this way, if the format of the target control inherits the ImageView format, when the target control receives the drop event, the target control can execute step S206.
[0198] It can be understood that when the user long presses the target control, the touch event includes a drop event and a move event. The specific implementation method of the internal transmission of the move event in the view frame is similar to the specific implementation method of the internal transmission of the drop event in the view frame, which will not be repeated here.
[0199] Optionally, steps S203 and S205 may be performed concurrently.
[0200] S206: The target control in the view framework receives the drop event, and the target control reports the view entity of the target control to the content recognition and filling framework.
[0201] For example, in this embodiment, the implementation of the target control of the first application inherits the implementation of the native image control (imageview) and supports reporting the view entity corresponding to the target control to the content recognition and filling framework. The view entity is, for example, an Object. The view entity includes information such as the specific name of the target control, the image content, the image width, the image length, and the image position in the window. The position of the image in the window can be referred to as the display position of the image or the display position of the target control.
[0202] S207: The content recognition and filling framework determines whether the view entity reported by the target control is a valid view entity.
[0203] Exemplarily, the content-aware filling framework may call a control name acquisition method to obtain the control name of the target control from the view entity.
[0204] The content-aware fill framework determines whether the control name of the target control is in the whitelist.
[0205] If so, the content recognition and filling framework determines that the reported view entity is a valid view entity, and can store the view entity in the memory to facilitate subsequent execution of drag-related steps.
[0206] If not, the content recognition filling framework determines that the reported view entity is an invalid view entity. The content recognition filling framework cancels the third timer, clears the obtained view entity and touch event, and terminates the execution of subsequent drag-related actions. In this way, the power consumption of invalid dragging can be saved.
[0207] Taking the target control's name as activitya_viewb and the control name acquisition method as Object.getClass().getSimpleName() as an example, illustratively, the content-aware filling framework can call Object.getClass().getSimpleName() to obtain the control name activitya_viewb from the view entity.
[0208] The content-aware fill framework determines that activitya_viewb is in the whitelist and that the view entity reported by the target control is a valid view entity. The content-aware fill framework stores the view entity reported by the target control in memory.
[0209] S208: The view framework responds to the touch event.
[0210] Exemplarily, the view framework may set a second timer in response to the drop event, and the timing duration of the second timer may be a second timing duration, which is equal to the system long press duration.
[0211] If the view framework receives a move event before the second timer reaches the system long press duration, it determines whether the distance between the touch position of the move event and the touch position of the drop event exceeds the first threshold. If so, the view framework cancels the second timer. If not, the view framework does not process the event.
[0212] Before the second timer reaches the system long press duration, if the view framework receives a lift event, the view framework cancels the second timer.
[0213] When the second timer reaches the system long press duration, the view framework executes the long press related steps of the native system of the electronic device. For example, the view framework can execute the related steps of popping up a new window around the target control.
[0214] The view framework executes a scenario in which a new window pops up around the target control. For details, please refer to the detailed description in the subsequent step S210.
[0215] The relevant steps performed by the view framework in response to touch events are the logic of the native system of the electronic device. The content recognition and filling framework determines that the user's long press operation intention is a drag intention through the third timer, and the view framework determines that the user's long press operation intention is an intention to pop up a new window through the second timer, and the third timing duration of the third timer of the content recognition and filling framework is greater than the second timing duration of the second timer. In this way, the picture dragging method provided in the embodiment of the present application is compatible with the logic of the native system, and the picture dragging method provided in the embodiment of the present application will not affect the execution logic of the native system of the electronic device.
[0216] Optionally, S206 and S208 may be executed concurrently.
[0217] S209: When the third timer reaches a third timing duration, the content recognition and filling framework queries the window management framework whether a new window pops up around the target control.
[0218] For example, when the user long-presses the target control for the duration of the system long-press duration, the electronic device may or may not pop up a new window around the target control. Therefore, when the third timer reaches the third time duration, the content recognition and filling framework needs to query the window management framework whether a new window has popped up around the target control. Based on whether a new window has popped up, the content recognition and filling framework can determine whether the user's long-press operation actually intends to cause the electronic device to pop up a new window or to drag the control.
[0219] The third timing duration is greater than the system long press duration, so that the content recognition filling framework executes this step later than the electronic device pops up a new window around the target control, which can reduce the probability of inaccurate query results in the new window popping up due to the query timing of the new window popping up being earlier than the new window popping up timing.
[0220] S210: The window management framework determines whether a new window pops up around the target control.
[0221] Exemplarily, Figure 7 shows a scene diagram of an electronic device provided by an embodiment of the present application popping up a new window around a target control. When the second timer reaches the system long press duration, the electronic device can display the interface shown in Figure 7. As shown in the interface of Figure 7, the interface includes a new window 71. The pop-up position of the new window 71 is around the target control. The new window 71 may include an edit control 711, a forwarding control 712, a favorite control 713, a multi-select control 714, a reference control 715 and a delete control 716. For other contents in this interface, please refer to the contents of the interface shown in b in Figure 3, which will not be repeated here.
[0222] After the window management framework determines that a new window pops up around the target control, the window management framework may execute step S211.
[0223] Alternatively, if the window management framework determines that no new window has popped up around the target control, the window management framework may notify the content recognition and fill framework that no new window has popped up. The content recognition and fill framework may then determine that the user's true intention of the long press operation is a dragging intention, and the content recognition and fill framework may skip steps S212-S213 and directly execute step S214a. This can reduce power consumption associated with executing steps S212-S213, and can also promptly generate the drag box, improving the user experience.
[0224] S211. The window management framework notifies the content recognition filling framework to pop up a new window.
[0225] If a new window pops up around the target control, the user's long press operation intention may be either a dragging intention or a non-drag intention. For example, the user may operate the new window that pops up. Therefore, the content recognition filling framework needs to perform step S212 to further determine the user's actual operation intention.
[0226] S212: The content recognition filling framework sets a fourth timer, wherein a fourth timing duration of the fourth timer is equal to the second extension duration.
[0227] The second extension time period may be the same as or different from the first extension time period.
[0228] Exemplarily, the second extended duration may be greater than the first extended duration, for example, the second extended duration may be 100 milliseconds.
[0229] S213: When the fourth timer reaches the fourth timing duration, the content recognition filling framework determines that the user's finger has not moved or been lifted.
[0230] Exemplarily, the fourth timer may be a message processing handler.
[0231] After the fourth timer is set, there may be a scenario where the finger is long pressed, moved, or lifted, and the content recognition fill framework may receive a move event or a lift event.
[0232] After setting the fourth timer and before the fourth timer exceeds the fourth timing duration, if the content recognition filling framework receives a move event, the content recognition filling framework can determine whether the distance between the touch position of the move event and the touch position of the drop event exceeds the second threshold.
[0233] If the distance between the touch position of the move event and the touch position of the drop event exceeds the second threshold, it may indicate that the user's operation is a move operation or finger movement, or it may indicate that the user's operation intention is not a drag intention. The content recognition filling framework cancels the fourth timer to terminate the execution of subsequent drag-related steps.
[0234] If the distance between the touch position of the move event and the touch position of the drop event does not exceed the second threshold, it may indicate that the user's operation is a long press operation or a long press of the finger. It may also indicate that the user's operation intention may be a drag intention or an intention to operate a new window. In this case, the content recognition filling frame will not be processed.
[0235] After setting the fourth timer and before the fourth timer exceeds the fourth timing duration, if the content recognition fill framework receives a lift event, indicating that the user operation is a lift operation or finger lift, and it may also indicate that the user's operation intention is not a drag intention, then the content recognition fill framework cancels the fourth timer to terminate the execution of subsequent drag-related steps.
[0236] When the first event received by the content recognition filling framework after the fourth timer reaches the fourth timing duration is a move event, the content recognition filling framework can determine whether the distance between the touch position of the move event and the touch position of the drop event exceeds the second threshold.
[0237] If the distance between the touch position of the move event and the touch position of the drop event exceeds the second threshold, it may indicate that the user's operation is a move operation or finger movement, or it may indicate that the user's operation intention is not a drag intention or that the user's operation intention is to switch windows. The content recognition filling framework terminates the execution of subsequent drag-related steps.
[0238] If the distance between the touch position of the move event and the touch position of the drop event does not exceed the second threshold, it can indicate that the user's operation is a long press operation, and it can also indicate that the real intention of the long press operation is a drag intention, then the content recognition filling frame executes step S214a. The long press operation means that the finger is neither moved nor lifted.
[0239] When the first event received by the content recognition filling framework after the fourth timer reaches the fourth timing duration is a lift event, indicating that the user's operation is a lift operation or finger lift, the content recognition filling framework terminates the execution of subsequent drag-related steps.
[0240] Both the move and lift operations indicate that the user's intention was not to drag. When the content recognition and filling framework determines that the user's intention was not to drag, the fourth timer is canceled or subsequent drag-related steps are terminated, thereby reducing the power consumption of the electronic device. The fourth timer can be used to accurately determine whether the user's true intention of a long press operation in the scenario where a new window pops up on the electronic device is to drag, thereby improving the accuracy of identifying the user's intention.
[0241] It can be understood that the user's finger not moving may also mean that the user's finger is not lifted.
[0242] Optionally, if the content recognition filling framework determines that the user's finger moves or is lifted, the content recognition filling framework may also clear the stored image content and the layout of the target control, and clear the third timer and the fourth timer.
[0243] S214a: There is an image in the memory, and the content recognition filling framework obtains the bitmap corresponding to the image from the memory.
[0244] For example, a view entity includes image content. The view entity reported by the target control is stored in memory, and the image is also stored in the memory. The content-aware fill framework can determine whether the view entity of the target control exists in the memory. If so, the content-aware fill framework can determine whether the image of the target control exists in the memory.
[0245] The content-aware fill framework can obtain the bitmap corresponding to the image of the target control from the view entity. For details on obtaining the bitmap corresponding to the image of the target control from the view entity, please refer to the embodiment shown in Figure 8. For ease of understanding, the embodiment shown in Figure 8 will be described later.
[0246] S215: The content recognition and filling framework transfers the obtained bitmap to the content storage service.
[0247] For example, the content identification and filling framework transfers the acquired bitmap to the content storage service, which stores the bitmap so that the target sub-service can subsequently acquire the bitmap from the content storage service.
[0248] The content storage service is a system service. Without authorization, other applications and services cannot obtain the bitmap stored in the content storage service from the content storage service. This can reduce the risk of information diffusion caused by the bitmap of the target control being obtained by other unauthorized applications when the electronic device executes the image dragging method provided in the embodiment of the present application, and can improve the security of the image content storage of the target control.
[0249] S216 : After storing the bitmap, the content storage service returns the universal resource identifier (Uri) of the bitmap to the content identification and filling framework.
[0250] For example, a Uri may represent the storage path of a bitmap. The Uri may consist of "content: / / " and the path of the data.
[0251] Optionally, a Uri can consist of "content: / / ," the data path, and an identification ID. For example, after the content storage service stores the bitmap corresponding to the image of the target control, the content storage service returns the bitmap's Uri as content: / / aaa / bbb / ccc / ddd / 123456 to the content-aware populate framework. aaa / bbb / ccc / ddd represents the data path, and 123456 represents the identification ID of the target control. The identification ID is a unique identifier assigned by the content storage service to the stored bitmap.
[0252] Optionally, S213 and S214a can be executed concurrently. In this way, the copying and storage of the image content of the target control can be completed as early as possible, so that the drag box can be created as early as possible.
[0253] S217 , the content-aware fill framework uses the obtained bitmap to create a drag box with a shadow and rounded corners.
[0254] For example, the content-aware fill framework can call an image width acquisition method to obtain the image width of the target control from the view entity of the target control. The content-aware fill framework can call an image height acquisition method to obtain the image height of the target control from the view entity of the target control. The content-aware fill framework can call an image position acquisition method to obtain the display position of the image from the view entity of the target control.
[0255] For example, the content-aware fill framework can call the imageView.getWidth() method to obtain the image width value of the target control, such as int width=imageView.getWidth(), where width represents the obtained image width value, which is, for example, 350.
[0256] The content-aware fill framework can call the imageView.getHeight() method to obtain the image height value of the target control, such as int height=imageView.getHeight(), where height represents the obtained image height value, which is, for example, 600.
[0257] The content-aware fill framework may include a drag shadow builder module. The content-aware fill framework may transmit the acquired bitmap, the display position of the image, the image width, and the image height to the drag shadow builder module.
[0258] The drag box creation module uses the bitmap, the display position of the image, the image width, the image height and the configuration parameters preset in the drag box creation module to create a drag box with a shadow and rounded corners. The configuration parameters preset in the drag box creation module may include the length and width of the drag box (out shadow size), the position of the finger on the drag box (out shadow touch point), the shadow format of the drag box, the shadow color of the drag box and the rounded corners of the drag box. The position of the finger on the drag box is related to the width and height of the image. For example, the position of the finger on the drag box can be calculated by the drag box creation module based on the width and height of the image.
[0259] The drag box created by the drag box creation module is shown as the drag box 308 in the interface shown in c in Figure 3. The image content of the drag box 308 is the same as the image content of the target control (i.e., control 306). The ratio of the width to the height of the drag box 308 is the same as the ratio of the image width to the image height of the control 306. The starting position of the drag box 308 is the same as the display position of the control 306. The drag box 308 also includes a drag box shadow and a drag box rounded corners. The shadow and rounded corners of the drag box 308 are the same as the drag box shadow and drag box rounded corners of the drag box 308 in the interface shown in c in Figure 3.
[0260] After determining that the user's intention of the long press operation is a drag intention, a drag box is generated. The electronic device can display the drag box to prompt the user that the image content of the target control has been copied and stored. The user can drag and complete the copying and storage of the image content of the target control when the user long presses the target control. In this way, the user's experience of dragging pictures can be improved, thereby improving the user's experience of using the electronic device.
[0261] It is understandable that, since the image dragging method provided in the embodiment of the present application does not affect the execution logic of the native system of the electronic device, the image dragging method provided in the embodiment of the present application does not affect the new window that pops up on the electronic device. For example, the new window that pops up on the electronic device will not disappear due to the display of the drag box.
[0262] S218: The content recognition filling framework calls the interface of the dragging framework.
[0263] Exemplarily, the content recognition fill framework calls the interface of the drag frame and passes the Uri and the created drag box 308 to the drag frame interface, so that the drag frame controls the movement of the drag box 308 as the finger moves, and passes the Uri to the second application when the finger moves into the window of the second application and is lifted.
[0264] S219: The drag frame monitors the window management frame and controls the drag frame to move as the finger moves.
[0265] For example, after the content recognition filling framework calls the interface of the drag framework, a scene of finger movement may occur. In this scene, the drag framework monitors the window management framework, obtains the touch position of the finger in real time, and controls the drag box 308 to move with the movement of the finger.
[0266] For example, after the content recognition and filling framework calls the drag framework interface, the electronic device can display the interface shown in Figure 3c. In the interface shown in Figure 3c, if the user moves the finger, the electronic device can display the interface shown in Figure 3d. From the interfaces shown in Figures 3c and 3d, it can be seen that the position of the drag box 308 is consistent with the touch position of the finger, so that the drag box 308 moves with the movement of the finger. In this way, the user's experience of using the electronic device can be improved.
[0267] After calling the drag frame interface, the module interaction flow chart in the finger movement scenario is shown in the subsequent Figure 9. For ease of understanding, the module interaction flow shown in Figure 9 will be explained later.
[0268] Optionally, after the content recognition filling framework calls the interface of the drag frame, a scene of the finger being lifted may also occur. In the scene where the finger is lifted, the drag frame can perform different steps according to different lifting positions. Exemplarily, if the lifting position of the finger (or the position where the display screen was last touched) is within the sidebar, step S220 can be executed. If the position where the finger is lifted is within the window of the target page, the drag frame controls the drag frame to return to the drag starting position. The drag starting position is, for example, the position where the target control is located or the long press position.
[0269] A flowchart for one module interaction scenario, in which a finger is lifted after invoking the drag framework interface, is shown in Figure 10. Another flowchart for another module interaction scenario, in which a finger is lifted after invoking the drag framework interface, is shown in Figure 11. For ease of understanding, the module interaction processes shown in Figures 10 and 11 are described below.
[0270] S220: The window management framework launches the second application, so that the second application launches a sub-service.
[0271] Exemplarily, when the finger moves to the hot zone, the window management framework pulls up the second application, and the display screen displays the sidebar (or the window of the second application). The sidebar is the sidebar 32 in the interface shown in d in Figure 3. The user can continue to move the finger, drag the drag box to the top of the target sub-business icon and lift the finger. The second application can obtain the lift event from the drag frame. The second application can determine that the sub-business of the icon corresponding to the touch position of the lift event is the target sub-business. The second application can pull up the target sub-business. The second application passes the Uri to the target sub-business. The target sub-business obtains the bitmap corresponding to the image of the target control from the content storage service according to the Uri, and uses the bitmap for business processing.
[0272] For example, as shown in FIG3 , in the interface shown in FIG3 c , the user can move a finger. When the finger moves into a hot zone 31 on the electronic device display, the window management framework pulls up a second application, causing the electronic device to display the interface shown in FIG3 d . The sidebar 32 can display icons of multiple sub-services in a fluid manner, so that the user can drag the drag box 308 over the target sub-service icon and then lift the finger, causing the target sub-service to perform service processing using the image content of the target control.
[0273] For example, taking the target sub-service as a note application, on the interface shown in d of Figure 3 , the user moves a finger to drag the drag box 308 onto the note application icon 324. The electronic device may display the interface shown in e of Figure 3 .
[0274] On the interface shown in e in Figure 3, the user can lift his finger, and the electronic device can display the interface shown in f in Figure 3. When the user lifts his finger, the drag frame can determine that the touch position of the lift event is within the sidebar 32. The touch position of the lift event can represent the position where the user's finger is lifted. The drag frame passes the lift event and the Uri of the bitmap corresponding to the image of the target control to the second application. The second application recognizes that the sub-business icon corresponding to the touch position of the lift event is the icon of the note application. The second application can determine that the target sub-business is a note application. The second application pulls up the note application. The second application passes the Uri to the note application. The note application obtains the bitmap according to the Uri, so that the electronic device displays the page shown in f in Figure 3, so that the user can continue to operate on the page shown in f in Figure 3.
[0275] For example, taking the target sub-service as the "Send to QQ Friends" service of the QQ application, on the interface shown in FIG3 d, the user moves his finger and drags the drag box 308 over the "Send to QQ Friends" service icon 326. The electronic device may display the interface shown in FIG3 g.
[0276] On the interface shown in g in Figure 3, the user can lift his finger, and the electronic device can display the interface shown in h in Figure 3. When the user lifts his finger, the drag frame can recognize that the touch position of the lift event is within the sidebar 32. The drag frame passes the lift event and Uri to the second application. The second application recognizes that the icon corresponding to the touch position of the lift event is the icon of the send to QQ friend service. The second application can determine that the target sub-service is the send to QQ friend service. The second application pulls up the QQ application, and then pulls up the send to QQ friend service. The second application passes the Uri to the send to QQ friend service. The send to QQ friend service obtains the bitmap according to the Uri, so that the electronic device displays the page shown in h in Figure 3, so that the user can continue to operate on the page shown in h in Figure 3. On the interface shown in h in Figure 3, the user can select a friend or group chat by clicking the friend control or group chat control to send the bitmap to the selected friend or group chat.
[0277] The module interaction process in the scenario where the user drags the drag box 308 onto the target sub-service icon and then lifts his finger can also be referred to the detailed description of the embodiment shown in FIG. 10 .
[0278] The picture dragging method provided in this embodiment, in a scenario where the picture control of the first application can actively report the picture content, reports a view entity containing information such as the control name, picture content, picture width, picture length and picture position in the window of the target control through the target control. If it is determined that the reported view entity is a valid view entity, when the third timer and the fourth timer accurately determine that the true intention of the user's long press operation is the drag intention, or when the third timer accurately determines that the true intention of the user's long press operation is the drag intention, the bitmap corresponding to the picture of the target control is obtained from the view entity and stored, so as to complete the copying and safe storage of the picture content of the target control when the user long presses the target control, without having to click the picture of the target control twice to achieve the copying and storage of the picture of the target control. The picture dragging method provided in this embodiment also uses the obtained bitmap , picture width, picture length and the position of the picture in the window generate a drag box, and the display of the drag box is used to prompt the user that the copying and storage of the picture content of the target control has been completed. The user can drag and drop, and the drag box is controlled by the drag frame to move with the movement of the finger, thereby realizing the dragging of the picture of the target control. When the drag box is dragged above the target sub-business icon, the second application pulls up the target sub-business, and the target sub-business can be opened without the user performing an opening operation on the target sub-business. The second application obtains the Uri of the bitmap from the drag frame and passes the Uri to the target sub-business, so that the target sub-business obtains the picture content of the target control according to the Uri in order to perform business processing in time, and realizes that the picture content is quickly transferred between the first application and the target sub-business when the picture dragging method is compatible with the logic of the native system, which can improve the user experience of using the electronic device.
[0279] The above describes the module interaction process in the scenario where the image control of the first application can actively report the image content. The following describes the module interaction process in the scenario where the image control of the first application cannot actively report the image content.
[0280] For the scenario where the picture control of the first application cannot actively report the picture content, FIG12 shows another module interaction flow chart provided in an embodiment of the present application.
[0281] The difference between Figure 12 and Figure 4 is that Figure 12 does not include steps S206, S207 and S214a in the embodiment of Figure 4, and Figure 12 also includes steps S214b-1, S214b-2 and S214b-3. Steps S206, S207 and S214a can represent a method of obtaining image content by filling the framework with content recognition in a scenario where the target control supports image content reporting. Steps S214b-1, S214b-2 and S214b-3 can represent a method of obtaining image content by filling the framework with content recognition in a scenario where the target control does not support image content reporting. The remaining steps in Figure 12 are similar to the corresponding steps in the embodiment of Figure 4. Similar steps will not be repeated in this embodiment.
[0282] As shown in FIG12 , the image dragging method provided in the embodiment of the present application includes:
[0283] S100: A user opens a first application interface.
[0284] S101. An application (APP) loads the contents of each view in a target page into a view framework.
[0285] S102: The view framework transfers the root layout of the target page to the content recognition and filling framework.
[0286] S103: The content recognition and filling framework determines whether the application package name and / or page name of the target page is in the whitelist.
[0287] S104: The content recognition filling framework transmits the judgment result to the view framework.
[0288] S200: The event processing framework obtains a touch event indicating that a target control is touched.
[0289] S201: The event processing framework transmits a touch event to the window management framework.
[0290] S202: The window management framework transmits the touch event to the view framework.
[0291] S203: If the view framework has received a positive result transmitted by the content recognition and filling framework, the view framework transmits the touch event to the content recognition and filling framework.
[0292] S204: The content recognition filling framework responds to the drop event and sets a third timer.
[0293] S205: The touch event is transmitted internally in the view framework.
[0294] Optionally, steps S203 and S205 may be performed concurrently.
[0295] S208: The view framework responds to the touch event.
[0296] S209: When the third timer reaches a third timing duration, the content recognition and filling framework queries the window management framework whether a new window pops up at the location of the target control.
[0297] S210: The window management framework determines whether a new window pops up around the target control.
[0298] S211. The window management framework notifies the content recognition filling framework to pop up a new window.
[0299] S212: The content recognition filling framework sets a fourth timer, wherein a fourth timing duration of the fourth timer is equal to the second extension duration.
[0300] S213: When the fourth timer reaches the fourth timing duration, the content recognition filling framework determines that the user's finger has not moved or been lifted.
[0301] S214b-1. The image does not exist in the memory. The content recognition filling framework traverses the root layout to find the control corresponding to the touch position according to the touch position of the drop event, and obtains the control name.
[0302] For example, since the target control is not an ImageView-inherited control, when the target control receives a drop event, it cannot report its view entity to the content-aware fill framework. Therefore, the view entity does not exist in the memory.
[0303] If the content-aware fill framework determines that the target control's view entity does not exist in memory, it also determines that the target control's image does not exist in memory. The content-aware fill framework can then traverse the root layout to find the control corresponding to the touch location of the drop event and obtain the control name of the found control. The found control is the target control.
[0304] Optionally, if the image does not exist in memory, the content-aware fill framework can also traverse the root layout to find the control corresponding to the touch position of the most recently received motion event.
[0305] Optionally, S213 and S214b-1 can be executed concurrently. In this way, the copying and storage of the image content of the target control can be completed as early as possible, so that the drag box can be created as early as possible.
[0306] S214b-2. The content recognition filling framework determines whether the control name of the found control is in the whitelist.
[0307] Illustratively, the content-aware filling framework may determine whether the control name of the found control is in the whitelist.
[0308] If so, the content recognition filling framework executes step S214b-3.
[0309] If not, the content-aware fill framework does not execute subsequent drag-related steps, and the content-aware fill framework can clear the third timer, the fourth timer, and the obtained event.
[0310] S214b-3. The content recognition filling framework obtains the bitmap corresponding to the image of the target control from the view entity corresponding to the found control.
[0311] It can be understood that the root layout is part of the view framework. The content-aware fill framework finds the target control from the root layout, which means that the content-aware fill framework finds the view entity of the target control from the view framework. The content-aware fill framework can also obtain the bitmap corresponding to the target control from the view entity of the target control.
[0312] The content recognition filling framework obtains the bitmap corresponding to the target control from the view entity of the target control, which can be seen in the embodiment shown in Figure 8. For ease of understanding, the embodiment shown in Figure 8 will be described in detail later.
[0313] S215: The content recognition and filling framework transfers the obtained bitmap to the content storage service.
[0314] S216 : After storing the bitmap, the content storage service returns the universal resource identifier (Uri) of the bitmap to the content identification and filling framework.
[0315] S217 , the content-aware fill framework uses the obtained bitmap to create a drag box with a shadow and rounded corners.
[0316] S218: The content recognition filling framework calls the interface of the dragging framework.
[0317] S219: The drag frame monitors the window management frame and controls the drag frame to move as the finger moves.
[0318] S220: The window management framework launches the second application, so that the second application launches a sub-service.
[0319] The picture dragging method provided by this embodiment, in a scenario where the picture control of the first application cannot actively report the picture content, when the third timer and the fourth timer are used to accurately determine that the real intention of the user's long press operation is a drag intention, or when the third timer is used to accurately determine that the real intention of the user's long press operation is a drag intention, the root layout is traversed to find the control corresponding to the touch position of the drop event (i.e., the target control), or the root layout is traversed to find the control corresponding to the touch position of the most recently received move event (i.e., the target control), and the view entity of the target control is found from the view frame. If it is determined that the control name of the found control is in the whitelist, the bitmap corresponding to the picture of the target control can be obtained from the view entity of the target control and stored, so that the picture content of the target control is copied and safely stored when the user long presses the target control, without having to click the picture of the target control twice to copy and store the picture of the target control. The image dragging method provided in the embodiment also uses the bitmap, image width, image length and the position of the image in the window to generate a drag box, and displays the drag box to prompt the user that the copying and storage of the image content of the target control has been completed. The user can drag and control the drag box to move with the finger through the drag frame, thereby realizing the dragging of the image of the target control. When the drag box is dragged above the target sub-business icon, the second application pulls up the target sub-business, and the target sub-business can be opened without the user performing an opening operation on the target sub-business. The second application obtains the Uri of the bitmap from the drag frame and passes the Uri to the target sub-business, so that the target sub-business obtains the image content of the target control according to the Uri in order to perform business processing in a timely manner, thereby realizing that the image content is quickly transferred between the first application and the target sub-business when the image dragging method is compatible with the logic of the native system, which can improve the user's experience of using the electronic device.
[0320] The following describes how to obtain the bitmap corresponding to the target control from the view entity of the target control in conjunction with Figure 8. Figure 8 shows a schematic diagram of the process of obtaining the bitmap provided by an embodiment of the present application.
[0321] As shown in Figure 8, if the target control's format inherits the ImageView format, the content-aware fill framework can execute steps S801-S804 to obtain the bitmap corresponding to the target control's image from the view entity in memory. The content-aware fill framework can also execute steps S801, S802, S803, and S805 to obtain the bitmap corresponding to the target control's image from the view entity in memory. If the target control's format does not inherit the ImageView format, the content-aware fill framework can execute steps S801, S802, and S806 to obtain the bitmap corresponding to the target control's image from the view entity of the target control in the view framework.
[0322] S801: The content recognition filling framework has identified that the target control is a picture control.
[0323] Exemplarily, the content-aware fill framework searches the whitelist for the control type (type) corresponding to the control name of the target control. For example, if the control name of the target control is activitya_viewb, the content-aware fill framework searches the whitelist for the control name activitya_viewb and finds that the type of the control is image. The content-aware fill framework identifies that the type of the target control is an image type, that is, the content-aware fill framework identifies that the target control is an image control. The content-aware fill framework can execute step S802.
[0324] S802: The content recognition filling framework determines whether the format of the target control inherits the ImageView format.
[0325] Exemplarily, the content-aware fill framework may call an inherited ImageView check method to determine whether the format of the target control is an inherited ImageView format.
[0326] For example, the inherited ImageView check method can be the view instanceof ImageView method. If the content-aware fill framework calls the view instanceof ImageView method and the result is true, the content-aware fill framework determines that the target control's format is inherited from the ImageView format. If the content-aware fill framework calls the view instanceof ImageView method and the result is false, the content-aware fill framework determines that the target control's format is not inherited from the ImageView format, or the content-aware fill framework determines that the target control's format is not inherited from the ImageView format.
[0327] If it is determined that the format of the target control inherits the ImageView format, the content recognition filling framework executes step S803.
[0328] If it is determined that the format of the target control does not inherit the ImageView format, the content recognition filling framework executes step S806.
[0329] S803: The content recognition filling framework determines whether the drawable object of the target control is a drawable object in bitmap format.
[0330] Exemplarily, the view entity reported by the target control includes a drawable object (drawable). The drawable object includes the image content of the target control.
[0331] The content-aware fill framework may call a drawable object format acquisition method to determine whether the format of the drawable object in the view entity is a drawable object in a bitmap format.
[0332] For example, the content-aware fill framework calls the imageview.getDrawable() method.
[0333] If the result obtained is bitmapDrawable, the content-aware fill framework determines that the drawable object of the target control is a drawable object in bitmap format, and the content-aware fill framework can execute step S804.
[0334] If the result obtained is not bitmapDrawable, the content-aware fill framework determines that the drawable object of the target control is not a drawable object in the bitmap format, and the content-aware fill framework can execute step S805.
[0335] S804: The content recognition filling framework calls the first bitmap acquisition method to obtain the bitmap corresponding to the image of the target control from the view entity.
[0336] Exemplarily, the first bitmap obtaining method is, for example, the drawable.getbitmap() method.
[0337] If the content-aware fill framework determines in step S803 that the drawable object in the view entity is in bitmap format, it calls the drawable.getbitmap() method to obtain a bitmap-formatted drawable object from the view entity uploaded by the target control. The obtained bitmap-type drawable object is the bitmap of the image corresponding to the target control. For example, getbitmap = drawable.getbitmap().
[0338] S805. The content-aware filling framework calls the second bitmap acquisition method to acquire the bitmap corresponding to the image of the target control from the view entity.
[0339] Exemplarily, the second bitmap acquisition method is, for example, the drawable.draw(canvas) method.
[0340] When the content-aware fill framework determines in step S803 that the format of the drawable object in the view entity is not in bitmap format, the content-aware fill framework can control the target control to call the drawable.draw(canvas) method. The view entity of the target control can extract the drawable, and use the canvas parameter provided by the drawable.draw(canvas) method to draw the extracted drawable to obtain the bitmap corresponding to the drawable. The canvas parameter is used to specify the target canvas for drawing. The target canvas specified by the canvas parameter provided by the drawable.draw(canvas) method is a canvas dedicated to drawing drawables. The bitmap corresponding to the drawable, that is, the bitmap corresponding to the picture of the target control, can also represent the content of the drawable object on the canvas. The target control passes the bitmap obtained by drawing the view entity to the content-aware fill framework. For example, get bitmap = drawable.draw(canvas).
[0341] S806. The content-aware filling framework calls the third bitmap acquisition method to acquire the bitmap corresponding to the image of the target control from the view entity.
[0342] Exemplarily, the third bitmap acquisition method is, for example, the view.draw(canvas) method.
[0343] If the target control's format doesn't inherit the ImageView format, regardless of whether the target control's view entity contains a drawable, the view entity cannot independently extract the drawable. Consequently, the bitmap corresponding to the target control's image cannot be obtained using the second bitmap acquisition method. The target control's view entity contains the target control's display area resources. These resources can include the target control's image content and may also include blank areas within the target control's display area.
[0344] When the content-recognizing filling framework determines in step S802 that the format of the target control does not inherit the ImageView format, the content-recognizing filling framework can control the target control to call the view.draw(canvas) method. The view entity of the target control extracts the display area resources of the target control, and uses the canvas parameters provided by the view.draw(canvas) method to draw the extracted display area resources to obtain the bitmap corresponding to the display area resources. The target canvas specified by the canvas parameters provided by the view.draw(canvas) method is a canvas dedicated to drawing display area resources. The bitmap corresponding to the display area resources is the bitmap corresponding to the picture of the target control. The target control passes the bitmap corresponding to the display area resources to the content-recognizing filling framework. For example, get bitmap = view.draw(canvas).
[0345] If the display area resource of the target control contains the image content of the target control and does not contain a blank area, the content-aware filling framework calls the third bitmap acquisition method to obtain the bitmap corresponding to the image of the target control from the view entity, which contains the image content of the target control and does not contain a blank area.
[0346] If the display area resource of the target control includes the image content and blank area of the target control, the content-aware fill framework calls the third bitmap acquisition method to obtain the bitmap corresponding to the image of the target control from the view entity, which includes the image content and blank area of the target control.
[0347] For example, taking the first application as Toutiao application, an image control in a page of Toutiao application as the target control, and the format of the target control not inheriting the ImageView format as an example, FIG13 shows a schematic diagram of the display interface of Toutiao application.
[0348] As shown in Figure 13, the interface includes a control 131 indicating return, a control 132 indicating voice playback, a control 133 indicating search, a control 134 indicating more, an icon 135 indicating the blogger, a follow control 136, a text control 137, a target control 130, a text control 138, a share control 1391, a message control 1392, a like control 1393, and a favorite control 1394. Target control 130 includes a blank area 1301 within its display area and image content 1302. Both blank area 1301 and image content 1302 are display area resources of target control 130.
[0349] Since the format of the target control 130 does not inherit the ImageView format, the content-aware filling framework calls the third bitmap acquisition method to obtain a bitmap from the view entity of the target control that contains not only the image content 1302 but also the blank area 1301 .
[0350] It is understood that the bitmap obtained by the content-aware fill framework by calling the first or second bitmap acquisition method contains the image content of the target control and does not contain blank areas. However, the bitmap obtained by the content-aware fill framework by calling the third bitmap acquisition method from the view entity can contain the image content of the target control and may also contain blank areas.
[0351] S807: The content-aware filling framework passes the obtained bitmap to the content storage service, and the content storage service returns the Uri of the bitmap to the content-aware filling framework.
[0352] The specific implementation principle and technical effect of this step are similar to those of steps S215-S216 in the embodiment of FIG4 , and are also similar to those of steps S215-S216 in the embodiment of FIG12 , and are not repeated here.
[0353] S808: The process of obtaining the bitmap by the content recognition filling framework ends.
[0354] For ease of understanding, FIG5, FIG6, FIG9, FIG10 and FIG11 are respectively described below.
[0355] Figure 5 shows a flow chart of module interaction in a scenario where a finger moves before the third timer exceeds the third timer duration in an embodiment of the present application. As shown in Figure 5, the image dragging method provided in the embodiment of the present application may further include the following steps:
[0356] S300a, after step S204 and before step S209, the event processing framework receives a movement event.
[0357] S301: The event processing framework transmits a move event to the window management framework.
[0358] S302: The window management framework transmits a move event to the view framework.
[0359] S303a: The view framework transmits the move event to the content recognition fill framework.
[0360] S304. The content recognition filling framework determines whether the distance between the touch position of the move event and the touch position of the drop event is greater than a second threshold. If it is less than or equal to the second threshold, no processing is performed. If it is greater than the second threshold, the third timer is canceled.
[0361] For example, the distance between the touch position of the move event and the touch position of the drop event may be referred to as the move distance. The second threshold may be 10 pixels.
[0362] The moving distance being less than or equal to the second threshold may indicate that the user's operation is a long press operation. At this time, the third timer has not timed out, so the content recognition filling framework does not process it.
[0363] A movement distance greater than the second threshold may indicate that the user's intention is other than a dragging intention. Other intentions may include an intention to switch pages. The content-aware fill framework may cancel the third timer to terminate subsequent drag-related steps. The content-aware fill framework may also clear the obtained image content and touch events.
[0364] It is understandable that after step S204 and before step S209, the user's finger does not leave the display screen and moves, and the electronic device can execute the steps shown in the embodiment of Figure 5 each time it generates a movement event.
[0365] It is understandable that, before the fourth timer exceeds the fourth timing duration, if the finger moves, the module interaction process in this scenario is similar to the module interaction process shown in Figure 5 and will not be repeated here.
[0366] The picture dragging method provided by this embodiment is that after the content recognition filling framework sets the timer and before the set timer times out, if the user's finger moves, the content recognition filling framework obtains the moving distance by comparing the touch position of the moving event with the touch position of the drop event. If the moving distance is less than or equal to the second threshold, it can be judged that the user's operation intention may be a drag intention, and the content recognition filling framework can do nothing. If the moving distance is greater than the second threshold, it can be judged that the user's operation intention is not a drag intention, and the content recognition filling framework can cancel the set timer to terminate the execution of subsequent drag-related actions. In this way, by comparing the moving distance with the second threshold, the user's operation intention can be accurately judged. Based on the comparison result of the moving distance and the second threshold, the electronic device does not process or terminates the execution of subsequent drag-related actions, which can reduce the power consumption of the electronic device caused by invalid dragging, and thus improve the user's experience of using the electronic device.
[0367] Figure 6 shows a flow chart of module interaction in a scenario where a finger is lifted before the third timer exceeds the third timer duration in an embodiment of the present application. As shown in Figure 6, the image dragging method provided in the embodiment of the present application may further include the following steps:
[0368] S400a, after step S204 and before step S209, the event processing framework receives a lift event.
[0369] S401: The event processing framework transmits a lift event to the window management framework.
[0370] S402: The window management framework transmits a lift event to the control framework.
[0371] S403a: The control framework transmits the lift event to the content-aware filling framework.
[0372] S404: The content recognition filling framework cancels the third timer.
[0373] If the finger is lifted before the third timer exceeds the third timing duration, it may indicate that the user's intention is not to drag. The content recognition filling framework can cancel the third timer and terminate the execution of subsequent drag-related steps to reduce the power consumption of the electronic device caused by invalid dragging.
[0374] It is understandable that, before the fourth timer exceeds the fourth timing duration, if the finger is lifted, the module interaction process in this scenario is similar to the module interaction process shown in Figure 6 and will not be repeated here.
[0375] The picture dragging method provided in this embodiment has the following characteristics: after the content recognition filling framework sets a timer, before the set timer times out, if the user's finger is lifted, the content recognition filling framework can determine that the user's operation intention is not a dragging intention. The content recognition filling framework can cancel the timer to cause the electronic device to terminate the execution of subsequent drag-related steps, thereby reducing the power consumption of the electronic device caused by invalid dragging, and improving the user's experience of using the electronic device.
[0376] Figure 9 shows a flow chart of module interaction in a finger movement scenario after calling the drag framework interface in an embodiment of the present application. As shown in Figure 9, the image dragging method provided by the embodiment of the present application also includes:
[0377] S300b: After step S218, the event processing framework receives a movement event.
[0378] S301: The event processing framework transmits a move event to the window management framework.
[0379] S302: The window management framework transmits a move event to the view framework.
[0380] S303b: The view framework transmits the move event to the drag framework.
[0381] S305 , the drag frame controls the drag frame to move along with the movement of the touch position.
[0382] While the finger remains on the display and is moving across it, the drag frame continues to receive movement events from the event processing framework at a fixed sampling frequency, via steps S301, S302, and S303b. The drag frame can control the movement of the drag frame as the touch position moves. The specific implementation and technical effects of the movement of the drag frame as the touch position moves can be found in step S219 of the embodiment of FIG. This embodiment will not be further described here.
[0383] The image dragging method provided in this embodiment allows the drag frame to move with the touch position after invoking the drag frame interface. This allows the user to experience the flexible dragging and moving of the drag frame more intuitively. The user can flexibly move the drag frame over the icon of the target sub-service in the sidebar, allowing the target sub-service to promptly use the image content of the target control for service processing. This improves the user's experience with the electronic device.
[0384] Figure 10 shows a flow chart of module interaction in a scenario where a finger is lifted after calling the drag framework interface in an embodiment of the present application. As shown in Figure 10, the image dragging method provided in the embodiment of the present application also includes:
[0385] S400b: After step S218, the event processing framework receives a lift event indicating that the user has lifted their finger.
[0386] For example, after step S218, if the second application is launched, the electronic device displays a sidebar. When the user's finger moves to above the target sub-service icon in the sidebar, the finger is lifted. The event processing framework receives the lift event.
[0387] S401: The event processing framework transmits a lift event to the window management framework.
[0388] S402: The window management framework transmits a lift event to the view framework.
[0389] S403b: The view framework transmits the lift event to the drag framework.
[0390] S405a: When the drag framework determines that the finger is lifted within the sidebar (or the window of the second application), it transmits the lift event and Uri to the second application.
[0391] For example, the touch position in the lift event represents the location of the last touch on the display screen (or the location where the user's finger was lifted). The drag framework can determine whether the touch position of the lift event is within the sidebar. If so, the drag framework transmits the lift event and the URI to the second application. If not, the drag framework can control the drag frame to return to the drag start position. For details, see step S405b in the embodiment of Figure 11.
[0392] S406: The second application launches the target sub-service.
[0393] For example, the finger lift position within the sidebar (or the window of the second application) may include the finger lift position being above the sub-service icon in the sidebar. The second application may identify the sub-service icon corresponding to the touch position of the lift event. The second application determines that the sub-service corresponding to the identified sub-service icon is the target sub-service. The second application pulls up the target sub-service and passes the URI to the target sub-service.
[0394] S407: The target sub-service obtains the image content of the target control from the content storage service through the Uri.
[0395] The target sub-service obtains the bitmap from the content storage service according to the Uri. The obtained bitmap contains the image content of the target control.
[0396] The target sub-business uses bitmap for business processing.
[0397] The specific implementation of steps S405a to S407 can be found in step S220 in the embodiment of FIG4 , and will not be described in detail here.
[0398] S408: The content storage service deletes the stored image content at a scheduled time.
[0399] Exemplarily, when the content storage service passes (or returns) the Uri to the content identification and filling framework, the content storage service sets a first timer, and the timing duration of the first timer is the first timing duration.
[0400] When the first timer reaches the first timing duration, the content storage service deletes the stored bitmap corresponding to the Uri to provide sufficient storage space for the next storage of the image content.
[0401] The picture dragging method provided in this embodiment, in the scenario where the finger is lifted above the target sub-business icon after calling the interface of the dragging framework, by judging that the finger is lifted above the target sub-business icon, the Uri is passed to the target sub-business, thereby improving the accuracy of identifying the user's operation intention, so that the target sub-business can obtain the picture content of the target control according to the Uri and perform business processing in a timely manner, which can improve the user's experience of using the electronic device.
[0402] Figure 11 shows a flow chart of module interactions in a scenario where the finger is lifted above the window of the target page after calling the drag frame interface in an embodiment of the present application. As shown in Figure 11, the image dragging method provided in the embodiment of the present application also includes:
[0403] S400b: After step S216, the event processing framework receives a lift event.
[0404] S401: The event processing framework transmits a lift event to the window management framework.
[0405] S402: The window management framework transmits a lift event to the view framework.
[0406] S403b: The view framework transmits the lift event to the drag framework.
[0407] S405b: The drag frame determines that the finger lift position is within the window of the dragging application (ie, the first application), and controls the drag frame to return to the dragging starting position.
[0408] For example, Figure 14 shows a scene diagram of a finger being lifted after invoking the drag frame interface. After step S218, if the user's finger moves to the hot zone, the sidebar is pulled up, and the electronic device can display the interface shown in Figure 14a. The content of the interface shown in Figure 14a can be referred to the content of the interface shown in Figure 3d, and will not be repeated here.
[0409] In the interface shown in a of Figure 14 , if the user lifts the finger when the finger touch position is within the page window 30 of the first application, the electronic device can display the interface shown in b of Figure 14 . As shown in the interface in b of Figure 14 , the interface includes controls 301, 302, 303, 304, 305, 306, a drag box 308, 309, the text “aaa”, 310, 311, an input box 312, 313, and 314. Since the finger leaves the display screen and the hot zone 31 (the hot zone 31 is not visible), the sidebar 32 disappears. Therefore, the interface shown in b of Figure 14 does not include the sidebar 32 or the long press feedback 307. In the interface shown in b of Figure 14 , the position of the drag box 308 is consistent with that of the control 306.
[0410] As can be seen from the interfaces shown in Figures a and b of FIG14 , after step S218 , if the user lifts their finger from above page window 30 , indicating that the finger is within the dragged application window, the drag frame can control the drag frame 308 to return to the dragging start position, which is the location of control 306 . In the interface shown in Figure 14 a , if the finger is lifted, the finger leaves the hot zone, so the sidebar disappears, and the electronic device only displays page window 30 of the target page, as shown in Figure 14 b .
[0411] S409: The dragging framework notifies the content storage service that the image dragging is canceled.
[0412] S410: The content storage service deletes the stored bitmap.
[0413] The picture dragging method provided in this embodiment, in a scenario where the finger is lifted up and is within the window of the dragging application (i.e., the first application) after calling the interface of the drag frame, if it is determined that the lifted position is within the dragging application window, it can be determined that the user's drag is canceled, and the drag frame controls the drag frame to return to the dragging position. The drag frame notifies the content storage service to delete the saved bitmap to provide sufficient storage space for the next storage of the picture, which can improve the user's experience of using the electronic device.
[0414] Optionally, the whitelist in the embodiment of the present application may be built-in to the system of the electronic device, or may be obtained by the electronic device from a server.
[0415] Figure 15 shows a schematic diagram of the process of an electronic device saving a whitelist. As shown in Figure 15, the process includes:
[0416] S600. Turn on electronic equipment.
[0417] S601. Electronic device starts list loading service.
[0418] Exemplarily, the electronic device obtains a built-in whitelist of the system, and / or the electronic device obtains a cloud-tested push whitelist from the server.
[0419] Exemplarily, the built-in whitelist may include a first whitelist identifier, a first whitelist version, and first whitelist content. The first whitelist content includes multiple application package names that support system drag and drop, multiple page names that support system drag and drop, and multiple control names that support system drag and drop. The cloud test push whitelist may include a second whitelist identifier, a second whitelist version, and second whitelist content. The second whitelist content includes multiple application package names that support system drag and drop, multiple page names that support system drag and drop, and multiple control names that support system drag and drop.
[0420] S602: The electronic device parses the obtained whitelist.
[0421] For example, the format of the built-in whitelist can be XML or non-XML. If the format of the built-in whitelist is non-XML, the electronic device converts the obtained format of the built-in whitelist into XML. The electronic device can read the first whitelist identifier, the first whitelist version, and the first whitelist content from the built-in whitelist in XML format.
[0422] To reduce the amount of data transmitted when the server transmits the cloud-based push whitelist to the electronic device, the cloud-based push whitelist obtained by the electronic device may be in a non-XML format. Therefore, the electronic device converts the obtained cloud-based push whitelist into XML format. The electronic device can read the second whitelist identifier, second whitelist version, and second whitelist content from the XML-based cloud-based push whitelist.
[0423] S603: The electronic device determines whether the obtained whitelist is updated.
[0424] Exemplarily, if the electronic device obtains the built-in whitelist and the cloud-tested push whitelist in step S601, the electronic device may determine whether the cloud-tested push whitelist has been updated compared to the built-in whitelist.
[0425] For example, the electronic device determines whether the first whitelist identifier is the same as the second whitelist identifier.
[0426] If they are the same, the electronic device determines whether the first whitelist version is the same as the second whitelist version.
[0427] If they are different, the electronic device determines that the cloud-tested whitelist has been updated compared to the built-in whitelist, and the electronic device can execute S604 and S605 in sequence.
[0428] If they are the same, the electronic device determines that the cloud-tested whitelist has not been updated compared to the built-in whitelist, and the electronic device can execute S605.
[0429] Exemplarily, if the electronic device obtains a built-in whitelist in step S601 , the electronic device determines whether the whitelist exists in the memory.
[0430] If not, the electronic device executes step S604.
[0431] If so, the electronic device determines whether the built-in white list has been updated compared to the white list in the memory, and if not, executes step S605.
[0432] Exemplarily, if the electronic device obtains the cloud-tested push whitelist in step S601, the electronic device determines whether the whitelist exists in the memory.
[0433] If not, the electronic device executes step S604.
[0434] If so, the electronic device determines whether the cloud-tested whitelist has been updated compared to the whitelist in the memory. If so, step S604 is executed; if not, step S605 is executed.
[0435] It is understandable that the method by which an electronic device determines whether a built-in whitelist has been updated compared to a whitelist in memory is similar to the method by which an electronic device determines whether a cloud-tested whitelist has been updated compared to a built-in whitelist, and will not be described in detail here. The method by which an electronic device determines whether a cloud-tested whitelist has been updated compared to a whitelist in memory is similar to the method by which an electronic device determines whether a cloud-tested whitelist has been updated compared to a built-in whitelist, and will not be described in detail here.
[0436] S604: The electronic device saves the updated whitelist.
[0437] Exemplarily, the electronic device may store the whitelist content of the updated whitelist in a memory.
[0438] Optionally, the electronic device may also save the updated whitelist in XML format in a memory.
[0439] S605: The electronic device ends the whitelist saving process.
[0440] Exemplarily, the electronic device determines whether there is a whitelist in the memory.
[0441] If so, the electronic device may clear the information obtained in steps S601 - S603 and end the whitelist saving process.
[0442] If not, the electronic device stores the whitelist content or the whitelist in XML format read in step S602 in the memory, clears the information obtained in steps S601 to S603, and ends the whitelist saving process.
[0443] The server can periodically update the cloud test push whitelist stored in the server and notify the electronic devices under the server. For example, as shown in S700-S701 in Figure 12:
[0444] S700. The server periodically updates the cloud test push whitelist stored in the server.
[0445] S701: After the server completes the update of the cloud-based push whitelist, it may send a push success broadcast to the electronic devices under its jurisdiction. This push success broadcast can be used to notify the electronic devices that the cloud-based push whitelist stored in the server has been updated. Upon receiving the push success broadcast, the electronic device may sequentially execute steps S601-S605, or alternatively, the electronic device may sequentially execute steps S601, S602, S603, and S605.
[0446] The whitelist saving method in this embodiment allows electronic devices to obtain updated whitelists in a timely manner, so that electronic devices can drag and drop pictures of more third-party applications that do not support dragging according to the updated whitelist, thereby improving the application scope of the picture dragging method provided in the embodiment of the present application, and further improving the user experience of the electronic device.
[0447] It can be seen from the embodiments shown above that the picture dragging method provided in the embodiments of the present application is a system-level dragging method. Regardless of whether the application itself supports dragging, regardless of whether the format of the application's picture control inherits the ImageView format, as long as the page name of the target page and the control name of the picture control are in the whitelist, or the application package name and the control name are in the whitelist, the picture dragging method provided in the embodiments of the present application can be used to drag the picture of the picture control, so that the picture content of the picture control can be transferred conveniently and quickly between the application and the sub-business to which it belongs, thereby improving the user experience of using the electronic device.
[0448] The embodiment of the present application further provides a method for dragging an image, which includes S901-S906:
[0449] S901: The electronic device displays a first interface of a first application, where the first interface includes a first view, and the first view includes a first picture.
[0450] S902: The electronic device receives a first touch operation on a first picture.
[0451] S903: When the first touch operation is maintained and the long press is performed, if the electronic device determines that the format of the drawable object of the first image is not the first format, the electronic device obtains the drawable object of the first image, redraws the second image based on the drawable object of the first image, and creates a drag box. The content of the second image includes the content of the first image. The first format is, for example, a bitmap format.
[0452] S904: Display the second picture in the drag box.
[0453] S905: When the first touch operation moves, the drag box moves along with the first touch operation.
[0454] S906: In response to the first touch operation being moved to the first area of the display screen of the electronic device, the electronic device launches a second application and displays a window of the second application in the second area of the display screen. The window of the second application includes one or more icons, each icon corresponding to a service capable of receiving the image displayed by the drag box.
[0455] In this embodiment, the electronic device may be the electronic device in the embodiment of FIG. 4 , the first application may be the first application in the embodiment of FIG. 4 , the first interface may be the display interface of the target page in the embodiment of FIG. 4 , the first view may be the target control in the embodiment of FIG. 4 , the first image may be the image of the target control in the embodiment of FIG. 4 , the drag box may be the drag box in the embodiment of FIG. 4 , such as the drag box 308 in the embodiment of FIG. 3 , the drawable object of the first image may be the drawable object (drawable) in the view entity of the target control in the embodiment of FIG. 8 , the second image may be the bitmap obtained in S805 of the embodiment of FIG. 8 , the first area may be the hot zone in the embodiment of FIG. 4 , such as the invisible hot zone 31 in the embodiment of FIG. 3 , the second application may be the second application in the embodiment of FIG. 4 , the second area may be such as the area where the sidebar 32 in the embodiment of FIG. 3 is located, the one or more icons included in the window of the second application may be such as the icons included in the sidebar 32 in the embodiment of FIG. 3 , and the business corresponding to the icons included in the window of the second application may be such as the sub-business in the embodiment of FIG. 3 . Optionally, the first area may include the second area, and the area of the first area may be greater than or equal to the area of the second area. The first area may also be the second area. It can be understood that the touch operation of maintaining a long press can be understood as the touch operation neither moving nor lifting.
[0456] In this embodiment, when the electronic device determines that the format of the drawable object of the first image is not the first format, the electronic device obtains the drawable object of the first image and redraws the second image based on the drawable object of the first image. The specific implementation principle and technical effect are similar to the specific implementation principles and technical effects of S803, S805, and S807 in the embodiment of Figure 8. The specific implementation principles of S901-S906 can be referred to the specific implementation principles of steps S100-S220 in the embodiment of Figure 4, and will not be repeated here. In this embodiment, when the first touch operation is long pressed, if the electronic device determines that the format of the drawable object of the first picture is not the first format, the electronic device obtains the drawable object of the first picture, redraws the second picture according to the drawable object of the first picture, and creates a drag box. The content of the second picture is the same as the content of the first picture. The electronic device can display the drag box, and the second picture is displayed in the drag box to prompt the user that the content of the first picture has been copied and stored. The user can drag and drop, which can reduce the number of operations to copy the content of the first picture. The drag box can move with the first touch operation, and also realize pulling up the second application during the movement of the first touch operation. The window of the second application includes one or more icons to facilitate the user to select the target business. The target business is the business corresponding to the target icon. In this way, the user's experience of using the electronic device can be improved.
[0457] Optionally, before the electronic device obtains the drawable object of the first image, the method further includes:
[0458] The electronic device determines whether the format of the first view is the second format. The specific implementation principle of this step is similar to the specific implementation principle of S801-S802 in the embodiment of Figure 8 and is not repeated here. The second format, for example, inherits the ImageView format. The second format represents the implementation method that inherits the native Android image view.
[0459] When the electronic device determines that the format of the first view is the second format, the electronic device determines whether the format of the drawable object of the first image is the first format. The specific implementation principle of this step is similar to that of S803 in the embodiment of Figure 8 and is not repeated here.
[0460] Alternatively, when the electronic device determines that the format of the first view is not the second format, the electronic device obtains the display area resources of the first view, redraws the third picture according to the display area resources of the first view, and creates a drag box. The third picture can be displayed in the drag box. Among them, the display area resources of the first view include the drawable objects and blank areas of the first picture, and the content of the third picture includes the content of the first picture. When the electronic device determines that the format of the first view is not the second format, the electronic device obtains the display area resources of the first view, redraws the third picture according to the display area resources of the first view. The specific implementation principle is similar to the specific implementation principles of S806 and S807 in the embodiment of Figure 8, and will not be repeated here.
[0461] It is understood that the first view in this embodiment may also be the target control in the embodiment of FIG. 12 , and the first image in this embodiment may also be the image of the target control in the embodiment of FIG. 12 . The first view in this embodiment may also be the target control 130 in the embodiment of FIG. 13 , and the first image in this embodiment may also be the image content 1302 in the embodiment of FIG. 13 . The display area resources of the first view may also be the display area resources of the target control in the view entity of the target control in the embodiment of FIG. 8 . If the first view is the target control 130 in the embodiment of FIG. 13 , the display area resources of the first view include the image content 1302 and the blank area 1301 in the embodiment of FIG. 13 . If the first view is the target control in the embodiment of FIG. 12 , such as control 306 in the embodiment of FIG. 3 , the display area resources of the first view include the image content of control 306 . The third image may be the bitmap corresponding to the image of the target control in the embodiment of FIG. 12 , such as the bitmap obtained in S806 in the embodiment of FIG. 8 . The specific implementation principles and technical effects of the electronic device using the third image to create the drag box are similar to those of S217 in the embodiment of FIG. 12 , and will not be further described here.
[0462] The specific implementation principles of S901-S906 can also refer to the specific implementation principles of steps S100-S220 in the embodiment of Figure 12, which will not be repeated here.
[0463] In this way, when the format of the first view is not the second format, the electronic device obtains the display area resources of the first view. The third image redrawn by the electronic device based on the display area resources of the first view can not only contain the content of the first image, but also include a blank area. This allows the content of the first image to be copied and stored when the user long presses the image, reducing the number of operations required to copy the content of the first image. The third image can also be displayed in the created drag box. The display of the drag box can prompt the user that the copying and storage of the content of the first image has been completed and the user can continue dragging.
[0464] Optionally, the image dragging method provided in this embodiment further includes:
[0465] When the electronic device determines that the format of the drawable object of the first picture is the first format, the electronic device obtains the first picture and creates a drag box in which the first picture can be displayed.
[0466] When the electronic device determines that the format of the drawable object of the first image is the first format, the specific implementation principle of the electronic device obtaining the first image is similar to the specific implementation principles of S803, S804, and S807 in the embodiment of Figure 8, and will not be repeated here. The specific implementation principle of the electronic device using the first image to create a drag box can be referred to the specific implementation principle of S217 in the embodiment of Figure 4, and will not be repeated here.
[0467] In this way, when the format of the first view is the second format and the format of the drawable object of the first picture is the first format, the electronic device obtains the drawable object of the first picture, that is, obtains the bitmap corresponding to the first picture, and creates a drag box so that the drag box displays the first picture. When the user long presses, the content of the first picture can be copied and stored without redrawing the image resources of the first view. This not only reduces the number of operations for copying the content of the first picture, but also creates the drag box more quickly than when redrawing the drawable object of the first picture, prompting the user earlier that the copying and storage of the content of the first picture have been completed and the user can drag.
[0468] Optionally, the picture dragging method provided in this embodiment further includes: when the electronic device redraws the second picture according to the drawable object of the first picture, the electronic device starts a first timer, and the timing duration of the first timer is a first duration.
[0469] When the first timer reaches the first duration, the electronic device deletes the stored second picture.
[0470] It is understandable that if the electronic device stores a first image, then when the first timer reaches the first duration, the electronic device deletes the stored first image. If the electronic device stores a third image, then when the first timer reaches the first duration, the electronic device deletes the stored third image. For example, when the electronic device obtains the first image, the electronic device starts the first timer, and when the first timer reaches the first duration, the electronic device deletes the stored first image. When the electronic device redraws the third image based on the display area resources of the first view, the electronic device starts the first timer, and when the first timer reaches the first duration, the electronic device deletes the stored third image.
[0471] In this way, sufficient storage space can be provided for the next storage of picture content, and the probability of malicious spread of pictures stored in the electronic device can be reduced.
[0472] Optionally, the image dragging method provided in this embodiment further includes S907-S908:
[0473] S907: When the first touch operation moves to the position of the target icon in the one or more icons, in response to the first touch operation being lifted, the second application transmits the universal resource identifier (Uri) of the image displayed in the drag box to the service corresponding to the target icon.
[0474] S908: The service corresponding to the target icon obtains the image displayed in the drag box according to the Uri.
[0475] It is understood that if the drag box displays the first image, the service corresponding to the target icon obtains the first image based on the Uri. If the drag box displays the second image, the service corresponding to the target icon obtains the second image based on the Uri. If the drag box displays the third image, the service corresponding to the target icon obtains the third image based on the Uri.
[0476] For example, the specific implementation principles and technical effects of S907-S908 are similar to those of S220 in the embodiment of Figure 4. The specific implementation principles and technical effects of S907-S908 are also similar to those of the embodiment of Figure 10.
[0477] In this way, the first touch operation moves to the position of the target icon in one or more icons. In response to the first touch operation being lifted, the second application passes the Uri to the business corresponding to the target icon. The business corresponding to the target icon obtains the content of the first picture based on the Uri, thereby realizing convenient and fast transmission of the content of the first picture between the first application and the target business, reducing the user's operation steps to start the target business, and improving the user experience.
[0478] Optionally, the picture dragging method provided in this embodiment further includes S909:
[0479] S909: When the first touch operation moves to a third area of the display screen and the drag box moves to the third area along with the first touch operation, in response to the first touch operation being lifted, the electronic device controls the drag box to return to the position where the dragging started, and the electronic device deletes the stored image displayed by the drag box. The third area does not include the second area.
[0480] For example, the third area may be a display window of the target page in the embodiment of FIG4 , such as the page window 30 in the embodiment of FIG3 . In response to the first touch operation being lifted, the electronic device controls the drag box to return to the position where the dragging started, and the electronic device deletes the stored image displayed by the drag box. The specific implementation principles and technical effects are similar to those of the embodiment of FIG11 and are not described in detail here.
[0481] In this way, in a scenario where the first touch operation is lifted without moving to the second area, in response to the first touch operation being lifted, the electronic device controls the drag box to return to the position where the dragging started, thereby realizing a visual experience of drag cancellation, which can improve the user experience. The electronic device deletes the stored pictures included in the drag box to provide sufficient storage space for the next storage of the picture content, and can also reduce the probability of the pictures stored in the electronic device being maliciously spread.
[0482] Optionally, the second area is a sidebar on the right side of the display screen. The sidebar is, for example, sidebar 32 in the embodiment of FIG3 . This leaves display space for the first application window that is convenient for the user to view and find, while also facilitating the user to drag the drag box and select the target icon, thereby improving the user experience.
[0483] Optionally, before the electronic device obtains the drawable object of the first image, the image dragging method provided in this embodiment further includes:
[0484] In response to the first touch operation, the electronic device starts the second timer and the third timer, the timing duration of the second timer is the second duration, the timing duration of the third timer is the third duration, and the third duration is the sum of the second duration and the delay duration.
[0485] In the case where the first touch operation is maintained for a long time, in response to the second timer reaching a second duration, the electronic device displays a first pop-up window around the first picture, where the first pop-up window includes one or more controls.
[0486] When the first touch operation is maintained and the third timer reaches a third duration, the electronic device queries that the electronic device has displayed a first pop-up window in response to the first touch operation, and the electronic device starts a fourth timer with a timing duration of the fourth timer being greater than or equal to the delay duration.
[0487] The electronic device obtains the drawable object of the first picture, redraws the second picture according to the drawable object of the first picture, and creates a drag box, including: in response to the fourth timer reaching a fourth duration, the electronic device obtains the drawable object of the first picture, redraws the second picture according to the drawable object of the first picture, creates a drag box, and displays the drag box.
[0488] Exemplarily, the second timer may be the second timer in the embodiment of Figure 4, the third timer may be the third timer in the embodiment of Figure 4, the fourth timer may be the fourth timer in the embodiment of Figure 4, the second duration may be the second timing duration or the system long press duration in the embodiment of Figure 4, the third duration may be the third timing duration in the embodiment of Figure 4, the delay duration may be the first extended duration in the embodiment of Figure 4, the first pop-up window may be the new window in the embodiment of Figure 4, the first pop-up window may also be the new window 71 in the embodiment of Figure 7, and the controls included in the first pop-up window may be the controls in the new window 71 in the embodiment of Figure 7.
[0489] In this embodiment, the third duration can be used to preliminarily determine whether the user intention corresponding to the first touch operation is a drag intention. When the first touch operation is long pressed, if the third timer reaches the third duration, the electronic device displays a pop-up window. The user intention corresponding to the first touch operation may be an intention to operate the pop-up window, or it may be an intention to drag. The fourth timer and the fourth duration can be used to further accurately determine whether the user intention corresponding to the first touch operation is a drag intention. If the first touch operation is not moved or lifted when the fourth timer reaches the fourth duration, it can be determined that the user intention corresponding to the first touch operation is a drag intention. The electronic device can display a drag box to prompt the user that the copying of the content of the first picture has been completed and can be dragged when the first touch operation is not lifted or moved. This can reduce the number of operations for copying the content of the first picture, thereby improving the user's experience of using the electronic device. The third duration is the sum of the second duration and the delay duration, and can also achieve compatibility between the display logic of the drag box and the display logic of the pop-up window.
[0490] Optionally, the image dragging method provided in the embodiment of the present application further includes S910-S913:
[0491] S910: The electronic device displays a second interface of a third application, where the second interface includes a second view, and the second view includes a fourth picture.
[0492] S911: In response to a second touch operation on a fourth picture, the electronic device starts a second timer and a third timer.
[0493] S912. When the second touch operation is kept long, in response to the second timer reaching the second duration, the electronic device displays a second pop-up window around the fourth picture, where the second pop-up window includes one or more controls.
[0494] S913: When the third timer has not reached the third duration, in response to the second touch operation being moved or lifted, the electronic device turns off the third timer.
[0495] For example, the third application may be the first application in the embodiment of FIG. 4 , the second interface may be the display interface of the target page in the embodiment of FIG. 4 , the second view may be the target control in the embodiment of FIG. 4 , the fourth image may be an image of the target control in the embodiment of FIG. 4 , the second pop-up window may be a new window in the embodiment of FIG. 4 , or the second pop-up window may be new window 71 in the embodiment of FIG. 7 The controls included in the second pop-up window may be controls in new window 71 in the embodiment of FIG. The specific implementation principles and technical effects of S910-S913 may refer to the specific implementation principles and technical effects of S100-S208 in the embodiment of FIG. 4 The specific implementation principles and technical effects of the electronic device deactivating the third timer in response to the second touch operation being moved if the third timer has not reached the third duration in S913 may refer to the specific implementation principles and technical effects of the embodiment of FIG. 5 The specific implementation principles and technical effects of the electronic device deactivating the third timer in response to the second touch operation being lifted if the third timer has not reached the third duration in S913 may refer to the specific implementation principles and technical effects of the embodiment of FIG. 6
[0496] Thus, if the third timer does not reach the third duration and the second touch operation moves or is lifted, it can indicate that the user intention corresponding to the second touch operation is not a drag intention. After determining that the user intention is not a drag intention, the electronic device turns off the third timer, terminates the subsequent drag process, and reduces power consumption of ineffective dragging.
[0497] Optionally, the image dragging method provided in the embodiment of the present application further includes S914-S918:
[0498] S914. The electronic device displays a third interface of a fourth application, where the third interface includes a third view, and the third view includes a fifth picture.
[0499] S915: In response to the third touch operation on the fifth picture, the electronic device starts a second timer and a third timer.
[0500] S916. When the third touch operation is maintained for a long time, in response to the second timer reaching the second duration, the electronic device displays a third pop-up window around the fifth picture, where the third pop-up window includes one or more controls.
[0501] S917: When the third touch operation is maintained and the third timer reaches a third duration, the electronic device queries that the electronic device displays a third pop-up window in response to the third touch operation, and the electronic device starts a fourth timer, the fourth timer being set to a fourth duration. The fourth duration is greater than or equal to the delay duration.
[0502] S918: When the fourth timer has not reached the fourth duration, in response to the third touch operation being moved or lifted, the electronic device turns off the fourth timer.
[0503] For example, the fourth application may be the first application in the embodiment of FIG. 4 , the third interface may be the display interface of the target page in the embodiment of FIG. 4 , the third view may be the target control in the embodiment of FIG. 4 , the fifth image may be an image of the target control in the embodiment of FIG. 4 , the third pop-up window may be a new window in the embodiment of FIG. 4 , or the third pop-up window may be new window 71 in the embodiment of FIG. 7 The controls included in the third pop-up window may be controls in new window 71 in the embodiment of FIG. The specific implementation principles and technical effects of S914-S918 may refer to the specific implementation principles and technical effects of S100-S212 in the embodiment of FIG. 4 The specific implementation principles and technical effects of the electronic device deactivating the fourth timer in response to the third touch operation being moved if the fourth timer has not reached the fourth duration in S918 may refer to the specific implementation principles and technical effects of the embodiment of FIG. 5 The specific implementation principles and technical effects of the electronic device deactivating the fourth timer in response to the third touch operation being lifted if the fourth timer has not reached the fourth duration in S918 may refer to the specific implementation principles and technical effects of the embodiment of FIG. 6
[0504] Thus, if the fourth timer does not reach the fourth duration and the third touch operation is moved or the third touch operation is lifted, it can indicate that the user intention corresponding to the third touch operation is not a drag intention. After determining that the user intention is not a drag intention, the electronic device turns off the fourth timer, terminates the subsequent drag process, and reduces power consumption of ineffective dragging.
[0505] The image dragging method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices. The specific device form of the terminal device can refer to the above related descriptions and will not be repeated here.
[0506] An embodiment of the present application provides an electronic device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the above method.
[0507] The present embodiment provides a chip. The chip includes a processor configured to invoke a computer program stored in a memory to execute the technical solution of the above embodiment. The implementation principles and technical effects are similar to those of the above-mentioned related embodiments and will not be further described here.
[0508] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the above-mentioned method is implemented. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0509] In one possible implementation, computer-readable media may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium designed to carry or store the desired program code in the form of instructions or data structures and accessible by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwave are used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and optical disk as used herein include optical disk, laser disk, optical disk, digital versatile disk (DVD), floppy disk and Blu-ray disk, where disks generally reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0510] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0511] The present application embodiment is described with reference to the flow chart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application.It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processing unit of general-purpose computer, special-purpose computer, embedded processing machine or other programmable device to produce a machine, so that the instruction executed by the processing unit of computer or other programmable data processing device produces the device for realizing the function specified in one flow chart flow or multiple flows and / or one block or multiple blocks of block diagram.
[0512] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. A picture dragging method, characterized in that: The method comprises: The electronic device displays a first interface of a first application, the first interface includes a first view, and the first view includes a first picture; The electronic device receives a first touch operation on the first picture; In the case where the first touch operation is maintained for a long time, when the electronic device determines that the format of the drawable object of the first picture is not the first format, the electronic device obtains the drawable object of the first picture, redraws the second picture according to the drawable object of the first picture, and creates a drag box; wherein the content of the second picture includes the content of the first picture; Displaying the second picture in the drag frame; When the first touch operation moves, the drag frame moves along with the first touch operation; In response to the first touch operation moving to the first area of the display screen of the electronic device, the electronic device pulls up a second application and displays a window of the second application in the second area of the display screen; the window of the second application includes one or more icons, each of which corresponds to a service that can receive the picture displayed by the drag box.
2. The method according to claim 1, characterized in that Before the electronic device obtains the drawable object of the first picture, the method further includes: The electronic device determines whether a format of the first view is a second format; When the electronic device determines that the format of the first view is the second format, the electronic device determines whether the format of the drawable object of the first picture is the first format; or, When the electronic device determines that the format of the first view is not the second format, the electronic device obtains the display area resources of the first view, redraws the third picture according to the display area resources of the first view, and creates the drag box; wherein, the display area resources of the first view include the drawable objects and blank areas of the first picture, and the content of the third picture includes the content of the first picture.
3. The method according to claim 2, characterized in that The method further comprises: When the electronic device determines that the format of the drawable object of the first picture is the first format, the electronic device obtains the first picture and creates the drag box.
4. The method according to claim 2 or 3, characterized in that: The first format is a bitmap format; the second format represents an implementation method that inherits the native image view of Android.
5. The method according to any one of claims 1 to 4, characterized in that Also includes: When the electronic device redraws the second picture according to the drawable object of the first picture, the electronic device starts a first timer, and the timing duration of the first timer is a first duration; When the first timer reaches the first duration, the electronic device deletes the stored second picture.
6. The method according to any one of claims 1 to 5, characterized in that Also includes: When the first touch operation moves to a position of a target icon among the one or more icons, in response to the first touch operation being lifted, the second application transmits a universal resource identifier Uri of the image displayed in the drag box to a service corresponding to the target icon; The service corresponding to the target icon obtains the image displayed in the drag box according to the Uri.
7. The method according to any one of claims 1 to 5, characterized in that Also includes: When the first touch operation moves to the third area of the display screen, the drag frame moves along with the first touch operation. When the touch operation moves to the third area, in response to the first touch operation being lifted, the electronic device controls the drag box to return to the position where the dragging starts, and the electronic device deletes the stored picture displayed by the drag box; the third area does not include the second area.
8. The method according to any one of claims 1 to 7, characterized in that The second area is a sidebar on the right side of the display screen.
9. The method according to any one of claims 1 to 8, characterized in that Before the electronic device obtains the drawable object of the first picture, the method further includes: In response to the first touch operation, the electronic device starts a second timer and a third timer, the timing duration of the second timer is the second duration, the timing duration of the third timer is the third duration, and the third duration is the sum of the second duration and the delay duration; In a case where the first touch operation is kept long pressed, in response to the second timer reaching the second duration, the electronic device displays a first pop-up window around the first picture, where the first pop-up window includes one or more controls; In the case where the first touch operation is kept long pressed, in response to the third timer reaching the third duration, the electronic device inquires that the electronic device displays the first pop-up window in response to the first touch operation, and the electronic device starts a fourth timer, the timing duration of the fourth timer is a fourth duration; the fourth duration is greater than or equal to the delay duration; The electronic device obtains the drawable object of the first picture, redraws the second picture according to the drawable object of the first picture, and creates a drag box, including: In response to the fourth timer reaching the fourth duration, the electronic device obtains the drawable object of the first picture, redraws the second picture according to the drawable object of the first picture, creates the drag box, and displays the drag box.
10. The method according to claim 9, characterized in that Also includes: The electronic device displays a second interface of a third application, the second interface includes a second view, and the second view includes a fourth picture; In response to a second touch operation on the fourth picture, the electronic device starts the second timer and the third timer; In a case where the second touch operation is kept long pressed, in response to the second timer reaching the second duration, the electronic device displays a second pop-up window around the fourth picture, where the second pop-up window includes one or more controls; When the third timer has not reached the third duration, in response to the second touch operation being moved or lifted, the electronic device turns off the third timer.
11. The method according to claim 9 or 10, characterized in that: Also includes: The electronic device displays a third interface of a fourth application, the third interface includes a third view, and the third view includes a fifth picture; In response to a third touch operation on the fifth picture, the electronic device starts the second timer and the third timer; In a case where the third touch operation is kept long pressed, in response to the second timer reaching the second duration, the electronic device displays a third pop-up window around the fifth picture, where the third pop-up window includes one or more controls; In the case where the third touch operation is kept long pressed, in response to the third timer reaching the third duration, the electronic device queries that the electronic device displays the third pop-up window in response to the third touch operation, and the electronic device The sub-device starts a fourth timer, the timing duration of the fourth timer is a fourth duration; the fourth duration is greater than or equal to the delay duration; When the fourth timer has not reached the fourth duration, in response to the third touch operation being moved or lifted, the electronic device turns off the fourth timer.
12. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 11.
13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Picture dragging method and related device
CN119620898A
Method and device for assisting in searching for target object in cluster and electronic equipment
CN111949186A
Task creation method and device
CN112631492A
Object dragging method and device and storage medium
CN113407086A
Dragging method and electronic equipment
CN115480682A