Sliding processing method, device, storage medium and system on electronic device
By dynamically setting a sliding threshold based on the location of touch events on electronic devices, the operation area can be distinguished, solving the problems of user misjudgment of sliding and low response efficiency, and improving the recognition accuracy and response speed of desktop events.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2023-12-29
- Publication Date
- 2026-06-26
Smart Images

Figure CN120276647B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a sliding processing method, device, storage medium and system for electronic devices. Background Technology
[0002] Users can tap the desktop of an electronic device to interact with displayed objects, or swipe the desktop to access other functional interfaces. Currently, tapping the desktop may result in slight swiping due to shaky hands or improper operation, which the electronic device may mistakenly interpret as a desktop swipe. Furthermore, when users swipe the desktop, the electronic device's response is slow and inefficient. Summary of the Invention
[0003] This application provides a sliding processing method, device, storage medium, and system for electronic devices. This sliding processing method for electronic devices improves the accuracy of desktop event recognition and the response speed to desktop events.
[0004] Firstly, embodiments of this application provide a sliding processing method on an electronic device. In this method: in response to detecting a touch event on the desktop of the electronic device, the position of the touch event on the desktop is determined; based on the position of the touch event on the desktop, a sliding threshold is determined, the sliding threshold being used to determine whether a desktop sliding event occurs. Thus, since different user touches different positions on the desktop, the sliding threshold is dynamically determined based on the position of the touch event on the desktop. This facilitates accurate and rapid determination of the user's operation on the desktop based on the sliding threshold, improving the accuracy of desktop event recognition and the response speed to desktop events.
[0005] In conjunction with the first aspect, in one optional implementation, determining a sliding threshold based on the location of the touch event on the desktop includes: determining a sliding threshold as a first threshold in response to the touch event being located in a first area of the desktop; or, determining a sliding threshold as a second threshold in response to the touch event being located in a second area of the desktop; wherein the first area and the second area are located in different positions on the desktop, and the second threshold is less than the first threshold. Thus, dynamically determining the sliding threshold corresponding to different locations of the touch event on the desktop can reduce the false recognition rate of click events and desktop sliding events located in the first area, and improve the response speed of desktop sliding events located in the second area.
[0006] In conjunction with the first aspect, in one optional implementation, determining a sliding threshold based on the position of a touch event on the desktop includes: setting a flag bit based on the position of the touch event on the desktop, the flag bit being used to identify whether the touch event is located in a first area or a second area of the desktop; the first area and the second area are located at different positions on the desktop; in response to a displacement event detected on the desktop, determining a sliding threshold for the displacement event based on the flag bit; the method further includes: determining whether a desktop sliding event has occurred based on the sliding threshold determined for the displacement event and the movement distance value generated by the displacement event. Thus, when a displacement event is detected, the flag bit is invoked to determine the sliding threshold in real time, and whether a desktop sliding event has occurred is determined based on the determined sliding threshold and the movement distance value generated by the displacement event.
[0007] In conjunction with the first aspect, in one optional implementation, determining the sliding threshold based on a flag indicating a displacement event includes: if the flag indicates a touch event is located in a first region, determining the sliding threshold as a first threshold; or, if the flag indicates a touch event is located in a second region, determining the sliding threshold as a second threshold; wherein the second threshold is less than the first threshold. Thus, by dynamically determining the sliding threshold corresponding to different locations on the desktop based on the position of the touch event indicated by the flag, the false recognition rate of click events and desktop sliding events located in the first region can be reduced, and the response speed of desktop sliding events in the second region can be improved.
[0008] In conjunction with the first aspect, in one optional implementation, determining the position of a touch event on the desktop includes: obtaining first position coordinates of the touch event on the desktop; if the first position coordinates are located within any one of a plurality of sub-view areas on the desktop, determining that the touch event is located in a first area; or, if the first position coordinates are located outside the plurality of sub-view areas, determining that the touch event is located in a second area.
[0009] Optionally, the subview area layout is under a first container, which is a container on the desktop used to hold icons, cards, and / or files. For example, the first container can be a ShortcutAndWidgetContainer, and icons and cards on the desktop can be contained under the ShortcutAndWidgetContainer container class layout.
[0010] In this way, based on the positional relationship between the first position coordinates of the touch event on the desktop and the multiple subview areas, it can be determined whether the touch event is located in the first area or the second area.
[0011] In conjunction with the first aspect, in one alternative implementation, before determining the location of a touch event on the desktop, the method includes: intercepting the touch event and determining whether the touch event is a press (Down) event; if the touch event is determined to be a Down event, triggering the determination of the location of the touch event on the desktop.
[0012] Optionally, intercepting touch events includes: overriding the interception method of View (base class) to intercept touch events.
[0013] In this way, if the touch event is determined to be a Down event, it can be determined that the touch event was applied to the desktop when the user first touched the desktop. This is beneficial for determining the position of the touch event on the desktop based on the Down event trigger before the subsequent displacement event occurs, and for determining the sliding threshold in a timely manner based on the position of the touch event on the desktop.
[0014] In conjunction with the first aspect, in one optional implementation, the first threshold is equal to a preset reference threshold, and the second threshold is determined by reducing the reference threshold. Thus, using the first threshold to determine desktop swipe events reduces the false recognition rate of click events and desktop swipe events located in the first area, while using the reduced second threshold to determine desktop swipe events improves the response speed of desktop swipe events in the second area.
[0015] In conjunction with the first aspect, in one optional implementation, the first area is the area where an operation object exists, and the second area is the area where no operation object exists; the operation object includes an icon object, a card object, or a file object. In this way, different sliding thresholds can be determined when the user touches the area where an operation object exists and when the user touches the area where no operation object exists, adapting to the user's current tendency to operate on operation objects and to slide on the desktop, thereby improving the accuracy of desktop event recognition and the response speed to desktop events.
[0016] Secondly, embodiments of this application also provide an electronic device, which includes: one or more processors and one or more memories; the one or more memories are coupled to one or more processors, and the one or more memories are used to store computer program code, the computer program code including computer instructions, which, when the one or more processors execute the computer instructions, cause the electronic device to perform the method of the first aspect.
[0017] Thirdly, embodiments of this application further provide a computer-readable storage medium, including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method of the first aspect.
[0018] Fourthly, embodiments of this application further provide a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to perform the method of the first aspect.
[0019] Fifthly, embodiments of this application further provide a computer program product that, when run on an electronic device, causes the electronic device to execute the method of the first aspect. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments of this application will be described below.
[0021] Figure 1 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application;
[0022] Figure 2 This is a software structure block diagram of the electronic device provided in the embodiments of this application;
[0023] Figure 3 This is a desktop illustration of the electronic device provided in the embodiments of this application;
[0024] Figure 4 This is a schematic flowchart of a sliding processing method on an electronic device provided in an embodiment of this application;
[0025] Figure 5 This is a flowchart illustrating how to determine the location of a touch event on a desktop, as provided in an embodiment of this application. Detailed Implementation
[0026] The following explanations of some terms used in this application are provided to facilitate understanding by those skilled in the art.
[0027] The applications (Apps) involved in the embodiments of this application, also known as application programs, are software programs capable of performing one or more specific functions. Typically, multiple applications can be installed on an electronic device, such as instant messaging applications, audio applications, image capture applications, etc. The applications mentioned in the following embodiments may be applications pre-installed at the factory or applications downloaded by the user from the network or obtained from other electronic devices during the use of the electronic device.
[0028] It should be understood that, unless otherwise stated, " / " in this application means "or," for example, A / B can mean A or B; "and / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone. "At least one" means one or more, and "more" means two or more.
[0029] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0030] Currently, when users click on the desktop of an electronic device, they may accidentally slide due to shaky hands or improper operation. This may be misinterpreted by the electronic device as a desktop swipe. In addition, when users swipe the desktop, the electronic device responds slowly and has low efficiency.
[0031] Based on this, embodiments of this application provide a sliding processing method on an electronic device. In this method, a sliding threshold is dynamically determined according to the position of the touch event on the desktop, which facilitates accurate and rapid determination of the user's operation on the desktop based on the sliding threshold, thereby improving the accuracy of desktop event recognition and the response speed to desktop events.
[0032] For example, the sliding processing method on an electronic device mentioned in the embodiments of this application can run in an electronic device, which can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, in-vehicle device, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, etc. The embodiments of this application do not impose special limitations on the specific form of the electronic device.
[0033] like Figure 1The diagram illustrates a hardware structure of an electronic device. This device may include: a processor, an external memory interface, internal memory, a Universal Serial Bus (USB) interface, a charging management module, a power management module, a battery, antenna 1, antenna 2, a mobile communication module, a wireless communication module, a sensor module, buttons, a motor, an indicator, a camera, a display screen, and a SIM card slot. The audio module may include a speaker, a receiver, a microphone, and a headphone jack. The sensor module may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, proximity sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and bone conduction sensors.
[0034] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0035] The processor may include one or more processing units, such as an application processor (AP), modem, central processing unit (CPU), graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors. The processor is the nerve center and command center of the electronic device. For example, the CPU, GPU, and ISP in the electronic device can execute the sliding processing method of the embodiments of this application on the electronic device.
[0036] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, a mobile communication module, a wireless communication module, and a modem. In some embodiments, antenna 1 of the electronic device is coupled to the mobile communication module, and antenna 2 is coupled to the wireless communication module, enabling the electronic device to communicate with network-side devices and other electronic devices through wireless communication technology.
[0037] A touch sensor, also known as a "touch device," can be located on a display screen. The touch sensor and the display screen together form a touchscreen, also called a "touchscreen." The touch sensor detects touch operations applied to or near it. It transmits the detected touch operation to the application (AP) to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen. In other embodiments, the touch sensor may also be located on the surface of the electronic device, in a different position than the display screen. In this embodiment, the electronic device can detect whether a user operation is applied to its display screen using a touch sensor. After the touch sensor detects a user operation applied to icons, cards, and / or files on the desktop, the electronic device can manipulate the icons, cards, and / or files, for example, by opening the interface of the icons, cards, and / or files. The icon may be, for example, an application icon.
[0038] In addition, an operating system runs on top of the aforementioned components. Examples include, but are not limited to, the Android open-source operating system developed by Google, the iOS operating system developed by Apple, and the Windows operating system developed by Microsoft.
[0039] The operating system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the layered architecture Android system as an example to exemplify the software structure of an electronic device. It should be noted that although this application uses the Android system as an example, its basic principles are equally applicable to electronic devices based on operating systems such as iOS or Windows.
[0040] See Figure 2 This is a software structure block diagram of an electronic device provided in an embodiment of this application. The software structure adopts a layered architecture, which divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. Taking the Android system as an example, in some embodiments, the Android system is divided from top to bottom into the application layer, the application framework layer (Framework), the hardware abstraction layer (HAL), and the kernel layer (Kernel). It is understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer layers than illustrated.
[0041] The application layer can include a series of application packages. These application packages can include apps such as camera, gallery, calendar, call, map, WLAN, Bluetooth, music, video, and SMS.
[0042] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications within the application layer. The application framework layer includes predefined functions. For example, it may include a window manager, content provider, view system, resource manager, notification manager, camera service, etc. This application embodiment does not impose any limitations on this. For example, the window manager is used to manage window programs. The window manager can obtain the screen size, determine if a status bar exists, lock the screen, capture the screen, etc. The content provider is used to store and retrieve data, making this data accessible to applications. The data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc. The view system can be used to construct the application's display interface. Each display interface can consist of one or more controls. Generally, controls may include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and other interface elements. The resource manager provides various resources to the application, such as localized strings, icons, images, layout files, video files, etc. The notification manager described above allows applications to display notification information in the status bar. It can be used to convey informational messages and disappears automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also appear as an icon or scrolling text bar in the system's top status bar, such as notifications from background applications, or as a dialog box on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating, or flashing indicator lights. The camera service provides shooting services and can interact with the hardware abstraction layer.
[0043] The Hardware Abstraction Layer (HAL) is an interface layer located between the kernel layer and the hardware, used to abstract the hardware. In some embodiments, the HAL includes a Hardware Abstraction Layer Interface Definition Language (HIDL) interface. The HAL may include sensor HALs, display HALs, camera HALs, etc. In some embodiments, the HAL may include an algorithm library. Optionally, the algorithm library provides one or more algorithm models, such as at least one of an encoding model and a decoding model. The encoding model is used to perform encoding processing, and the decoding model is used to perform decoding processing.
[0044] The kernel layer is the foundation of the Android operating system, responsible for hardware drivers, networking, power, system security, and memory management. It acts as an intermediary between hardware and software, relaying application requests to the hardware. The kernel layer includes at least sensor drivers, camera drivers, display drivers, and audio drivers.
[0045] The following is a desktop illustration of an electronic device implementing the sliding processing method provided in the embodiments of this application.
[0046] like Figure 3 As shown, the desktop 31 of the electronic device displays operation objects 310, such as icons, cards, or folders. This desktop can be the user interface displayed on the electronic device's touchscreen, or it can be the Workspace (also known as the home screen) on the touchscreen, where the Workspace is the layout corresponding to the main screen displayed on the touchscreen. The electronic device can divide the desktop into multiple different areas, such as a first area and a second area. For example, the area where operation objects 310 exist can be designated as the first area, and the area where operation objects 310 do not exist can be designated as the second area. The electronic device can detect touch events performed by the user on the touchscreen and operate the desktop in response to these touch events. For example, the electronic device can open the interface of an icon, card, or folder based on an event of clicking an icon, card, or folder. Furthermore, the electronic device can swipe horizontally across the desktop content, slide into the negative one screen, pull down the search bar, pull up a drawer, or pull down a drawer to the right, etc., based on desktop swipe events.
[0047] Please see Figure 4 , Figure 4 This is a schematic flowchart illustrating a sliding processing method on an electronic device according to an embodiment of this application. The following is in conjunction with... Figure 3 The desktop diagram shown is as follows: Figure 1 The hardware structure of the electronic device shown Figure 2 The software structure of the electronic device shown is illustrated, and the flow of the sliding processing method on the electronic device provided in the embodiments of this application is introduced.
[0048] S101, The electronic device detects a touch event generated on the desktop of the electronic device.
[0049] Touch events include Down events, Move events, and / or Up events. When a user touches the touchscreen of an electronic device, the event generated by pressing the touchscreen with a finger is a Down event; the event generated by sliding the finger across the touchscreen is a Move event; and the event generated by lifting the finger off the touchscreen is an Up event. It should be noted that a Down event occurs the instant the finger touches the screen, and an Up event occurs the instant the finger is released from the screen. For example, clicking an icon, card, or folder is a Down event, or an event consisting of sequential Down and Up events. Move events occur after Down events and before Up events, and are continuous events that occur over a period of time. In the following description, Move events will be referred to as desktop swipe events. Touch events can be... Figure 1 The touch sensor shown is used for detection.
[0050] S102, the electronic device responds to the detection of a touch event on the desktop of the electronic device and determines the location of the touch event on the desktop.
[0051] In some embodiments, before the electronic device performs the determination of the location of the touch event on the desktop, the method further includes: the electronic device intercepting the touch event and determining whether the touch event is a Down event; if the touch event is determined to be a Down event, the electronic device triggers the performance of determining the location of the touch event on the desktop.
[0052] Optionally, the electronic device intercepts touch events by: the electronic device overriding the interception method of the View (base class) to intercept touch events through the interception method.
[0053] View is the base class for all controls in the Android operating system. The interception method can be an event interception and judgment function such as onInterceptTouchEvent.
[0054] In one alternative implementation, such as Figure 5 As shown, determining the location of a touch event on the desktop can include, but is not limited to, s21 to s23 (including s23a and s23b):
[0055] s21, The electronic device obtains the first position coordinates of the touch event on the desktop.
[0056] Alternatively, it is possible Figure 3A rectangular coordinate system is established using any vertex of the desktop 31 or any point within the desktop 31 as the origin, with an axis parallel to the length direction of the desktop as the vertical axis and an axis parallel to the width direction of the desktop as the horizontal axis. The first position coordinates (x, y) of the touch event falling on this rectangular coordinate system are then obtained. Alternatively, other types of coordinate systems corresponding to the desktop 31 can be established, such as a planar polar coordinate system, to obtain the first position coordinates of the touch event. This application does not limit the scope of this application.
[0057] s22, the electronic device determines whether the first position coordinates are located within any one of the multiple sub-view areas on the desktop.
[0058] Optionally, each of the multiple subview areas is laid out under a first container, which is a container on the desktop used to hold icons, cards, and / or files. For example, the first container could be a ShortcutAndWidgetContainer, under which desktop icons and cards can be contained. Alternatively, the first container could be a folder container used to hold files.
[0059] Optionally, s22 may include, but is not limited to: the electronic device traversing the subview areas under the first container, calculating the position coordinates of the subview areas, and determining whether the position coordinates of each subview area contain the first position coordinates (x, y).
[0060] s23a, if the first position coordinates are located within any one of the multiple sub-view areas on the desktop, the electronic device determines that the touch event is located in the first area; or,
[0061] s23b, if the first position coordinates are outside the multiple sub-view areas, the electronic device determines that the touch event is in the second area.
[0062] It should be noted that steps s23a and s23b are two parallel steps. If step s23a is executed, then step s23b will not be executed, and if step s23b is executed, then step s23a will not be executed.
[0063] In one optional implementation, the first area and the second area are located in different positions on the desktop. Optionally, the first area is the area where an operation object exists, and the second area is the area where no operation object exists; the operation object includes an icon object, a card object, or a file object. Optionally, the first area is an icon area, and the second area is a non-icon area, i.e., a blank area; or the first area is a card area, and the second area is a non-card area, i.e., a blank area; or the first area is a folder area, and the second area is a non-folder area, i.e., a blank area. When the touch event is located in the area where an operation object exists, the user is more likely to manipulate the operation object; for example, when the user touches the icon area, they are more likely to click on the icon in the icon area to open the application interface corresponding to the icon; similarly, when the user touches the card area, they are more likely to click on the card in the card area to open the interface corresponding to the card; and similarly, when the user touches the folder area, they are more likely to click on the file in the folder area to open the interface corresponding to the file. When the touch event is located in the area where no operation object exists, the user is more likely to manipulate the desktop as a whole to switch the displayed interface, slide out or slide into other functional interfaces. For example, when users touch blank areas that are not icon areas, card areas, or folder areas, they tend to swipe the desktop to pull out or slide into other functional interfaces.
[0064] Optionally, the subview area can be considered as the first area. It should be noted that the first view area does not include its top, bottom, left, and right padding values and title height; for example, the icon area does not include its top, bottom, left, and right padding values and icon title height, where the icon title height could be, for example, the application's title name height; similarly, the card area does not include its top, bottom, left, and right padding values and card title height; furthermore, the folder area does not include its top, bottom, left, and right padding values and folder title height, or vice versa.
[0065] S103, the electronic device determines the sliding threshold based on the position of the touch event on the desktop.
[0066] The sliding threshold is used to determine whether a desktop sliding event has occurred. The sliding threshold is a threshold that measures whether the distance traveled by a displacement event detected on the desktop meets the criteria for a desktop sliding event. The desktop sliding event determined by the sliding threshold occurs after the touch event detected in step S101. Optionally, the desktop sliding event determined by the sliding threshold occurs after a detected Down event.
[0067] In one alternative implementation, S103 can be at least one of the following two execution methods:
[0068] Method 1: The electronic device determines the sliding threshold as a first threshold in response to a touch event located in a first area of the desktop; or, the electronic device determines the sliding threshold as a second threshold in response to a touch event located in a second area of the desktop.
[0069] Method 2: The electronic device sets a flag based on the location of the touch event on the desktop. The flag is used to identify whether the touch event is located in the first or second area of the desktop. The electronic device responds to the displacement event detected on the desktop and determines the sliding threshold for the displacement event based on the flag.
[0070] Optionally, such as Figure 3 As shown, a flag can be set in the Workspace, and when a displacement event is detected, the flag is called from the Workspace to determine the sliding threshold.
[0071] Optionally, in method 2, the electronic device determines the sliding threshold based on the flag, which may include: if the flag indicates that the touch event is located in the first area, the electronic device determines the sliding threshold as the first threshold; or, if the flag indicates that the touch event is located in the second area, the electronic device determines the sliding threshold as the second threshold.
[0072] In methods 1 and 2, a touch event located in the first area indicates that a subsequent detected displacement event may occur in the first area, while a touch event located in the second area indicates that a subsequent detected displacement event may occur in the second area. By determining the sliding threshold based on the different positions of the touch event on the desktop, it is possible to effectively and accurately determine whether a subsequent detected displacement event is a desktop sliding event.
[0073] In methods 1 and 2, the second threshold corresponding to a touch event located in the second region is less than the first threshold corresponding to a touch event located in the first region. Optionally, the first threshold is equal to a preset reference threshold (slop), and the second threshold is determined by reducing the reference threshold. For example, the second threshold can be equal to a × the first threshold, where a can be a positive number less than 1. Maintaining the sliding threshold corresponding to the preset reference threshold in the first region can reduce the misidentification rate of click events and desktop sliding events located in the first region. For example, if the touch event is located in the icon area, maintaining the reference threshold, i.e., using the reference threshold as the sliding threshold, avoids misidentifying user clicks on icons within the icon area as desktop sliding events. Reducing the reference threshold in the second region to adjust the sliding threshold can improve the response speed, i.e., responsiveness, of desktop sliding events in the second region. For example, if the touch event is located in a non-icon area, determining the sliding threshold to be 0.2 × the reference threshold allows for rapid identification of desktop sliding events based on this sliding threshold.
[0074] In an alternative implementation, after performing step S103, the method further includes S104. Figure 4 (Not shown): The electronic device determines whether to generate a desktop sliding event based on a determined sliding threshold and the movement distance value generated by the displacement event detected on the desktop.
[0075] For method 2, S104 includes: the electronic device determining whether a desktop sliding event is generated based on a sliding threshold determined for the displacement event and the movement distance value generated by the displacement event.
[0076] The displacement event is an event detected after a touch event, indicating that the user's finger has moved on the touchscreen and caused displacement. Optionally, the displacement event is detected after a Down event is detected. Optionally, the displacement event is detected before an Up event is detected.
[0077] Optionally, step S104 may include, but is not limited to: the electronic device determining that a desktop swipe event has been generated in response to a movement distance value being greater than or equal to a determined swipe threshold; or, the electronic device determining that no desktop swipe event has been generated in response to a movement distance value being less than a determined swipe threshold.
[0078] Optionally, the desktop swipe event includes at least one of the following events: horizontal swipe event, slide into the negative one screen event, pull-down search event, pull-up drawer event, or right swipe to pull out the drawer event. Optionally, the preset reference thresholds for different desktop swipe events can be the same or different. Optionally, the method of adjusting the reference thresholds corresponding to different desktop swipe events to determine the second threshold can be the same or different. For example, the second threshold corresponding to the pull-down search event can be determined by 0.2 × the reference threshold corresponding to the pull-down search event, and the second threshold corresponding to the pull-up drawer event can be determined by 0.2 × the reference threshold corresponding to the pull-up drawer event. Another example is that the second threshold corresponding to the pull-down search event can be determined by 0.2 × the reference threshold corresponding to the pull-down search event, and the second threshold corresponding to the slide into the negative one screen event can be determined by 0.3 × the reference threshold corresponding to the slide into the negative one screen event.
[0079] In this embodiment, the sliding threshold is dynamically determined based on the position of the touch event on the desktop. This facilitates accurate and rapid identification of user actions on the desktop based on the sliding threshold, improving the accuracy of desktop event recognition and the response speed to desktop events. Specifically, maintaining the sliding threshold corresponding to the reference threshold in the first region reduces the false recognition rate of click events and desktop sliding events located in the first region. Decreasing the reference threshold in the second region to adjust the sliding threshold improves the response speed, i.e., the responsiveness, of desktop sliding events in the second region.
[0080] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0081] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A sliding processing method on an electronic device, characterized in that, The method includes: In response to detecting a Down event on the desktop of an electronic device, the location of the Down event on the desktop is determined; Based on the positional relationship between the location and the subview area of the first container on the desktop, a flag is set, wherein the first container is used to load the operation object on the desktop, and the flag is used to identify whether the Down event is located in the first area or the second area of the desktop, and the first area and the second area are located in different positions on the desktop. In response to detecting a displacement event on the desktop, a sliding threshold is determined for the displacement event based on the flag bit; Whether a desktop sliding event is generated is determined based on the sliding threshold determined for the displacement event and the movement distance value generated by the displacement event.
2. The method as described in claim 1, characterized in that, Determining the sliding threshold for the displacement event based on the flag bit includes: If the flag indicates that the touch event is located in the first region, the sliding threshold is determined to be the first threshold; or... If the flag indicates that the touch event is located in the second region, the sliding threshold is determined to be the second threshold. Wherein, the second threshold is less than the first threshold.
3. The method as described in claim 2, characterized in that, The first threshold is equal to a preset reference threshold, and the second threshold is determined by reducing the reference threshold.
4. The method as described in claim 1, characterized in that, Determining the location of the Down event on the desktop includes: Obtain the coordinates of the first position of the Down event on the desktop; If the first position coordinates are located within any one of the multiple sub-view areas on the desktop, then the Down event is determined to be located in the first area; Alternatively, if the first position coordinates are outside the plurality of subview areas, the Down event is determined to be located in the second area.
5. The method according to any one of claims 1-4, characterized in that, Before determining the location of the Down event on the desktop of the electronic device in response to detecting a Down event on the desktop, the method includes: Intercept touch events and determine whether the touch event is a Down event.
6. The method according to any one of claims 1-4, characterized in that, The first area is the area where the operation object exists, and the second area is the area where the operation object does not exist; the operation object includes icon object, card object or file object.
7. An electronic device, characterized in that, include: One or more processors and one or more memories; the one or more memories are coupled to the one or more processors, the one or more memories being used to store computer program code, the computer program code including computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-6.
9. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-6.