Sliding processing method and device on electronic device, storage medium and system
By dynamically setting the sliding threshold on the electronic device according to the touch event position and distinguishing click and slide operations, the problem of user misjudgment and low response efficiency is solved, and higher recognition accuracy and response speed are achieved.
Patent Information
- Application Number
- CN202311864982.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-12-29
AI Technical Summary
When a user clicks or slides the desktop of an electronic device, the user may misjudgment due to hand shaking or improper operation, and the response efficiency is low.
According to the position of the touch event on the desktop, the sliding threshold is dynamically determined, and the click and slide operations are distinguished by setting different sliding thresholds to improve recognition accuracy and response speed.
It improves the recognition accuracy and response speed of desktop events, reduces the false recognition rate, and improves the accuracy and fluency of user operations.
Smart Images

Figure CN120276647A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and in particular, to a method, device, storage medium, and system for sliding processing on an electronic device. Background Art
[0002] Users can click on the desktop of an electronic device to operate the objects displayed on the desktop, or slide the desktop to pull out other function interfaces for operation. Currently, when a user clicks on the desktop of an electronic device, a certain slide may occur due to unsteady hands or improper operation, which may be misjudged by the electronic device as an operation of sliding the desktop. In addition, when the user slides the desktop, the electronic device responds slowly to the operation of sliding the desktop, and the response efficiency is low. Summary of the Invention
[0003] Embodiments of this application provide a method, device, storage medium, and system for sliding processing on an electronic device. The method for sliding processing on the electronic device improves the accuracy of desktop event recognition and the response speed to desktop events.
[0004] In a first aspect, embodiments of this application provide a method for sliding processing on an electronic device. In this method: in response to detecting a touch event on the desktop of the electronic device, determine the position of the touch event on the desktop; according to the position of the touch event on the desktop, determine a sliding threshold, where the sliding threshold is used to determine whether a desktop sliding event occurs. In this way, since the operations that a user tends to perform are different at different positions on the desktop when touching, according to the position of the touch event on the desktop, the sliding threshold is dynamically determined, which is conducive to accurately and quickly determining the operation applied by the user to the desktop based on the sliding threshold, and improves the accuracy of desktop event recognition and the response speed to desktop events.
[0005] In combination with the first aspect, in an optional implementation, determining the sliding threshold according to the position of the touch event on the desktop includes: in response to the touch event being located in a first area of the desktop, determining the sliding threshold as a first threshold; or, in response to the touch event being located in a second area of the desktop, determining the sliding threshold as a second threshold; where the first area and the second area are located at different positions on the desktop, and the second threshold is less than the first threshold. In this way, the sliding thresholds corresponding to different positions of the touch event on the desktop are dynamically determined, which can reduce the misrecognition rate of click events and desktop sliding events located in the first area, and improve the response speed of desktop sliding events in the second area.
[0006] In combination with the first aspect, in an optional implementation manner, determining a sliding threshold according to the position of a touch event on the desktop includes: setting a flag bit according to the position of the touch event on the desktop, where the flag bit is used to identify that 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 according to the flag bit; the above method further includes: determining whether a desktop sliding event is generated according to the sliding threshold determined for the displacement event and the moving distance value generated by the displacement event. In this way, when a displacement event is detected, the flag bit is called to determine the sliding threshold in real time, and according to the determined sliding threshold and the moving distance value generated by the displacement event, it is determined whether a desktop sliding event is generated.
[0007] In combination with the first aspect, in an optional implementation manner, determining a sliding threshold for a displacement event according to the flag bit includes: if the flag bit indicates that the touch event is located in the first area, determining the sliding threshold as a first threshold; or, if the flag bit indicates that the touch event is located in the second area, determining the sliding threshold as a second threshold; where the second threshold is less than the first threshold. In this way, according to the position where the touch event indicated by the flag bit is located, the sliding thresholds corresponding to different position areas of the touch event on the desktop are dynamically determined, which can reduce the misrecognition rate of click events and desktop sliding events located in the first area, and improve the response speed of desktop sliding events in the second area.
[0008] In combination with the first aspect, in an optional implementation manner, determining the position of a touch event on the desktop includes: obtaining the first position coordinates of the touch event on the desktop; if the first position coordinates are within any one of multiple sub-view areas on the desktop, determining that the touch event is located in the first area; or, if the first position coordinates are outside the multiple sub-view areas, determining that the touch event is located in the second area.
[0009] Optionally, the sub-view areas are arranged under a first container, and the first container is a container on the desktop for loading icons, cards, and / or files. Exemplarily, the first container can be a ShortcutAndWidgetContainer (shortcut and widget container), and the icons and cards on the desktop can be included in the layout of the ShortcutAndWidgetContainer container class.
[0010] In this way, according to the positional relationship between the first position coordinates of the touch event on the desktop and the multiple sub-view areas, it can be determined whether the touch event is located in the first area or the second area.
[0011] In combination with the first aspect, in an optional implementation, before determining the position of the touch event on the desktop, the above method includes: intercepting the touch event and determining whether the touch event is a press Down event; if it is determined that the touch event is a Down event, trigger the execution of determining the position of the touch event on the desktop.
[0012] Optionally, intercepting the touch event includes: overriding the intercept method of the View (base class) to intercept the touch event.
[0013] In this way, when it is determined that the touch event is a Down event, it can be determined that the touch event is applied to the desktop when the user starts to touch the desktop, which is beneficial to triggering the determination of the position of the touch event on the desktop according to the Down event before the subsequent displacement event occurs, and timely determining the sliding threshold according to the position of the touch event on the desktop.
[0014] In combination with the first aspect, in an optional implementation, the first threshold is equal to a preset reference threshold, and the second threshold is determined by reducing the reference threshold. In this way, the determination of the desktop sliding event is performed through the first threshold, reducing the misrecognition rate of click events and desktop sliding events in the first area, and the determination of the desktop sliding event is performed through the second threshold obtained by reducing the threshold, improving the response speed of the desktop sliding event in the second area.
[0015] In combination with the first aspect, in an optional implementation, the first area is an area where there is an operation object, and the second area is an area where there is no operation object; the operation object includes an icon object, a card object, or a file object. In this way, when the user touches the area where there is an operation object and the area where there is no operation object, different sliding thresholds can be determined respectively, adapting to the user's current tendency to operate on the operation object and slide the desktop, improving the accuracy of desktop event recognition and the response speed to desktop events.
[0016] In a second aspect, an embodiment of the present application further provides an electronic device, which includes: one or more processors and one or more memories; one or more memories are coupled to one or more processors, and one or more memories are used to store computer program code, and the computer program code includes computer instructions. When one or more processors execute the computer instructions, the electronic device executes the method of the first aspect.
[0017] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, including computer instructions, which, when running on an electronic device, cause the electronic device to execute the method of the first aspect.
[0018] Fourthly, an embodiment of the present application further provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the processors are used to call computer instructions to enable the electronic device to execute the method of the first aspect.
[0019] Fifthly, an embodiment of the present application further provides a computer program product. When the computer program product runs on an electronic device, it enables the electronic device to execute the method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be described below.
[0021] Figure 1 is a schematic hardware structure diagram of the electronic device provided by the embodiment of the present application;
[0022] Figure 2 is a schematic software structure block diagram of the electronic device provided by the embodiment of the present application;
[0023] Figure 3 is a schematic desktop diagram of the electronic device provided by the embodiment of the present application;
[0024] Figure 4 is a schematic flowchart of a sliding processing method on an electronic device provided by the embodiment of the present application;
[0025] Figure 5 is a schematic flowchart of a method for determining the position of a touch event on the desktop provided by the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] Some terms in the present application will be explained below to facilitate understanding by those skilled in the art.
[0027] The application (App) involved in the embodiments of the present application, also known as an application program, is a software program that can implement one or more specific functions. Usually, multiple applications can be installed in an electronic device. For example, instant messaging applications, audio applications, image capture applications, and so on. The applications mentioned in the following embodiments can be applications pre-installed in the electronic device when it leaves the factory, or applications downloaded from the network or obtained from other electronic devices by the user during the use of the electronic device.
[0028] It should be understood that in this application, unless otherwise specified, " / " means "or". For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. "At least one" means one or more, and "multiple" means two or more.
[0029] In addition, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of this application, unless otherwise specified, the meaning of "multiple" is two or more.
[0030] Currently, when a user clicks on the desktop of an electronic device, there may be a certain amount of sliding due to unsteady hands or improper operations, which may be misjudged by the electronic device as an operation to slide the desktop. Also, when the user slides the desktop, the electronic device responds slowly to the operation of sliding the desktop, with low response efficiency.
[0031] Based on this, the embodiments of this application provide a sliding processing method on an electronic device. In this method, according to the position of the touch event on the desktop, a sliding threshold is dynamically determined, which is conducive to accurately and quickly determining the operation applied by the user to the desktop based on this sliding threshold, improving the accuracy of desktop event recognition and the response speed to desktop events.
[0032] Exemplarily, the sliding processing method mentioned in the embodiments of this application can run in an electronic device. The electronic device can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, a vehicle-mounted device, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) / virtual reality (VR) device, etc. The embodiments of this application do not impose special restrictions on the specific form of the electronic device.
[0033] Such as Figure 1As shown, it is a schematic diagram of the hardware structure of an electronic device. Among them, the electronic device may include: a processor, an external memory interface, an 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, etc. Among them, the audio module may include a speaker, a receiver, a microphone, a headphone interface, etc., and the sensor module may include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0034] It can be understood that the structure schematically shown 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 components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0035] Among them, the processor may include one or more processing units. For example, the processor may include an Application Processor (AP), a Modem, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated in 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 may execute the sliding processing method on the electronic device in the embodiments of this application.
[0036] Among them, the wireless communication function of the electronic device may be implemented through antenna 1, antenna 2, the mobile communication module, the wireless communication module, and the Modem, etc. 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, so that the electronic device can communicate with network-side devices and other electronic devices through wireless communication technologies.
[0037] Among them, the touch sensor, also known as the "touch control device". The touch sensor can be disposed on the display screen, and the touch sensor and the display screen form a touch screen, also known as the "touch control screen". The touch sensor is used to detect a touch operation acting thereon or nearby. The touch sensor can transmit the detected touch operation to the AP to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen. In some other embodiments, the touch sensor can also be disposed on the surface of the electronic device, at a different position from the display screen. In the embodiments of the present application, whether there is a user operation acting on the display screen of the electronic device can be completed through the touch sensor. After the touch sensor detects a user operation on an icon, a card, and / or a file on the desktop, the electronic device can operate the icon, the card, and / or the file. For example, the interface of the icon, the card, and / or the file can be opened. Among them, the icon can be, for example, an icon of an application program.
[0038] In addition, an operating system runs on the above components. For example, but not limited to, the Android open-source operating system developed by Google Inc., the iOS operating system developed by Apple Inc., the Windows operating system developed by Microsoft Corporation, etc.
[0039] The operating system of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present application, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device. It should be noted that although the embodiments of the present application are described by taking the Android system as an example, the basic principle also applies to electronic devices based on operating systems such as iOS or Windows.
[0040] See Figure 2 , which is a software structure block diagram of the electronic device provided by the embodiments of the present application. The software structure adopts a layered architecture. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. Taking the Android system as an example, in some embodiments, the Android system is divided into an application layer, an application framework layer (Framework), a hardware abstraction layer (HAL), and a kernel layer (Kernel) from top to bottom. It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the electronic device. In some other embodiments, the electronic device may include more or fewer layers than those shown in the figure.
[0041] Among them, the application layer may include a series of application packages. The application packages may include APPs such as a camera, a gallery, a calendar, a call, a map, a WLAN, a Bluetooth, music, a video, a short message, etc.
[0042] Among them, the application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, a camera service, etc. The embodiments of the present application do not impose any restrictions on this. Exemplarily, the above window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The above content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, dialed and answered calls, browsing history and bookmarks, phone books, etc. The above view system can be used to build the display interface of an application. Each display interface can be composed of one or more controls. Generally speaking, controls may include interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. The above resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc. The above notification manager enables applications to display notification information in the status bar, can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify that the download is complete, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as a notification of a background-running application, and can also be a notification that appears on the screen in the form of a dialog window. For example, prompt text information in the status bar, emit a prompt tone, vibrate, the indicator light flashes, etc. The camera service is used to provide shooting services and can interact with the hardware abstraction layer.
[0043] Among them, the hardware abstraction layer is an interface layer located between the kernel layer and the hardware and can be used to abstract the hardware. In some embodiments, the hardware abstraction layer includes hardware abstraction layer interface definition language (HIDL) interfaces. Among them, the hardware abstraction layer may include: sensor HAL, display HAL, camera HAL, etc. In some embodiments, the hardware abstraction layer may include an algorithm library. Optionally, the algorithm library provides one or more algorithm models. For example, at least one of an encoding model and a decoding model. Among them, the encoding model is used to perform encoding processing, and the decoding model is used to perform decoding processing.
[0044] Among them, the kernel layer is the foundation of the Android operating system, responsible for functions such as hardware drivers, network, power supply, system security, and memory management. The kernel layer is an intermediate layer between hardware and software, and its role is to transfer application requests to the hardware. The kernel layer includes at least sensor drivers, camera drivers, display drivers, and audio drivers, etc.
[0045] Next, a desktop schematic diagram of the electronic device implementing the sliding processing method provided in the embodiments of the present application on the electronic device will be specifically introduced.
[0046] As Figure 3 shown, an operation object 310 is displayed on the desktop 31 of the electronic device. For example, an icon, a card, or a folder. This desktop can be a user interface displayed on the touch screen of the electronic device, or a Workspace (workspace, also known as the home page) on the touch screen. Among them, the Workspace is the layout corresponding to the main screen displayed on the touch screen. 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 the operation object 310 exists is divided into the first area, and the area where the operation object 310 does not exist is divided into the second area. The electronic device can detect a touch event applied to it by the user through this touch screen and operate the desktop in response to this touch event. For example, the electronic device can open the interface of an icon, a card, or a folder according to the event of clicking on an icon, a card, or a folder. Another example is that the electronic device can, according to the desktop sliding event, horizontally slide the content displayed on the desktop, slide into the negative first screen, pull down to show the search bar, pull up to show the drawer, or pull out the drawer to the right, etc.
[0047] Please refer to Figure 4 , Figure 4 which is a schematic flowchart of a sliding processing method on an electronic device provided in the embodiments of the present application. Next, in combination with Figure 3 the desktop schematic diagram shown, Figure 1 the hardware structure of the electronic device shown, and Figure 2 the software structure of the electronic device shown, the process of the sliding processing method provided in the embodiments of the present application on the electronic device will be introduced.
[0048] S101, the electronic device detects a touch event generated on the desktop of the electronic device.
[0049] Among them, touch events include press (Down) events, move (Move) events, and / or lift (Up) events. When a user touches the touch screen of an electronic device, the event generated by the finger pressing the touch screen is a Down event; the event generated by the finger sliding on the touch screen is a Move event; the event generated by the finger lifting off the touch screen is an Up event. It should be noted that the Down event is the event generated at the moment when the finger just touches the screen and presses the touch screen, and the Up event is the event generated at the moment when the finger releases from the screen. For example, the event of clicking an icon, a card, or a folder is a Down event or an event composed of a Down event and an Up event that occur in sequence. The Move event is generated after the Down event and before the Up event, and is an event that is continuously generated within a period of time. In the following description, the Move event is referred to as a desktop sliding event. Touch events can be detected by Figure 1 the touch sensor shown.
[0050] S102. In response to detecting a touch event on the desktop of the electronic device, the electronic device determines the position of the touch event on the desktop.
[0051] In some embodiments, before the electronic device executes determining the position of the touch event on the desktop, the method further includes: the electronic device intercepts the touch event and determines whether the touch event is a Down event; if it is determined that the touch event is a Down event, the electronic device triggers the execution of determining the position of the touch event on the desktop.
[0052] Optionally, the electronic device intercepts the touch event, including: the electronic device overrides the intercept method of the View (base class) to intercept the touch event through this intercept method.
[0053] Among them, View is the base class of all controls in the Android operating system, and this intercept method can be, for example, an event intercept judgment function such as onInterceptTouchEvent.
[0054] In an alternative implementation, as Figure 5 shown, determining the position of the touch event on the desktop may 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] Optionally, it can Figure 3Any vertex of the middle desktop 31 or any point selected within the desktop 31 is used as the origin. An axis parallel to the length direction of the desktop is used as the vertical axis, and an axis parallel to the width direction of the desktop is used as the horizontal axis to establish a rectangular coordinate system, and the first position coordinates (x, y) where the touch event falls on this rectangular coordinate system are obtained. Other types of coordinate systems corresponding to the desktop 31 can also be established. For example, a plane polar coordinate system can be used to obtain the first position coordinates of the touch event on other types of coordinate systems. This application does not make any limitations in this regard.
[0057] s22, the electronic device determines whether the first position coordinates are located within any one of multiple sub-view regions on the desktop.
[0058] Optionally, each sub-view region in the multiple sub-view regions (SubView) is arranged under the first container, and the first container is a container on the desktop for loading icons, cards, and / or files. For example, the first container can be a ShortcutAndWidgetContainer (shortcut and widget container), and the icons and cards on the desktop can be included in the layout of the ShortcutAndWidgetContainer container class. Another example is that the first container can be a folder container for loading files.
[0059] Optionally, s22 can include but is not limited to: the electronic device traverses the sub-view regions under the first container, calculates the position coordinates of the sub-view regions, and determines whether the position coordinates of each sub-view region contain the first position coordinates (x, y).
[0060] s23a, if the first position coordinates are located within any one of the multiple sub-view regions on the desktop, the electronic device determines that the touch event is in the first region; or,
[0061] s23b, if the first position coordinates are located outside the multiple sub-view regions, the electronic device determines that the touch event is in the second region.
[0062] It should be noted that step s23a and step s23b are two parallel steps. If step s23a is executed, step s23b will not be executed. If step s23b is executed, step s23a will not be executed.
[0063] In an alternative embodiment, the first region and the second region are located at different positions on the desktop. Optionally, the first region is a region where there are operation objects, and the second region is a region where there are no operation objects; the operation objects include icon objects, card objects, or file objects. Optionally, the first region is an icon region, and the second region is a non-icon region, i.e., a blank region; or the first region is a card region, and the second region is a non-card region, i.e., a blank region; or the first region is a folder region, and the second region is a non-folder region, i.e., a blank region. When a touch event is in the region where there are operation objects, the user is more inclined to manipulate the operation objects; for example, when the user touches the icon region, they tend to click on the icons in the icon region to open the application interface corresponding to the icon; another example is that when the user touches the card region, they tend to click on the cards in the card region to open the interface corresponding to the card; yet another example is that when the user touches the folder region, they tend to click on the files in the folder region to open the interface corresponding to the file. When a touch event is in the region where there are no operation objects, the user is more inclined to manipulate the desktop as a whole to switch the displayed interface, slide out or slide in other function interfaces. For example, when the user touches a blank region such as a non-icon region, a non-card region, or a non-folder region, they tend to slide the desktop to pull out or slide in other function interfaces.
[0064] Optionally, the sub-view region can be regarded as the first region. It should be noted that the first graphic region does not include the padding values on its top, bottom, left, and right and the region of the title height; for example, the icon region does not include the padding values on its top, bottom, left, and right and the region of the icon title height, and the icon title height can be, for example, the height of the title name of the application; another example is that the card region does not include the padding values on its top, bottom, left, and right and the region of the card title height; yet another example is that the folder region does not include the padding values on its top, bottom, left, and right and the region of the folder title height, or the folder region does not include the padding values on its top, bottom, left, and right and the region of the file title height.
[0065] S103. The electronic device determines a sliding threshold according to the position of the touch event on the desktop.
[0066] Among them, the sliding threshold is used to determine whether a desktop sliding event occurs. The sliding threshold is a threshold for measuring whether the moving distance value generated by the displacement event detected on the desktop reaches the standard of the desktop sliding event. The desktop sliding event determined according to the sliding threshold occurs after the touch event detected in step S101. Optionally, the desktop sliding event determined according to the sliding threshold occurs after the detected Down event.
[0067] In an alternative embodiment, S103 can be at least one of the following two execution modes:
[0068] In Method 1, when the touch event is located in the first area of the desktop, the electronic device determines that the sliding threshold is the first threshold; or, when the touch event is located in the second area of the desktop, the electronic device determines that the sliding threshold is the second threshold.
[0069] In Method 2, the electronic device sets a flag according to the position of the touch event on the desktop. The flag is used to identify that the touch event is located in the first area or the second area of the desktop; when the electronic device detects a displacement event on the desktop, it determines the sliding threshold for the displacement event according to the flag.
[0070] Optionally, as Figure 3 shown, the 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, when the electronic device determines the sliding threshold according to the flag, it may include: if the flag indicates that the touch event is located in the first area, the electronic device determines that the sliding threshold is the first threshold; or, if the flag indicates that the touch event is located in the second area, the electronic device determines that the sliding threshold is the second threshold.
[0072] In both Method 1 and Method 2, when the touch event is located in the first area, it means that the subsequent detected displacement event may occur in the first area, and when the touch event is located in the second area, it means that the subsequent detected displacement event may occur in the second area. The sliding threshold determined according to the different positions of the touch event on the desktop can effectively and accurately determine whether the subsequently detected displacement event is a desktop sliding event.
[0073] In both Method 1 and Method 2, the second threshold corresponding to the second area where the touch event is located is smaller than the first threshold corresponding to the first area where the touch event is located. 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, and a can be a positive number less than 1. Maintaining the sliding threshold corresponding to the preset reference threshold in the first area can reduce the misrecognition rate of click events and desktop sliding events in the first area. For example, when the touch event is located in the icon area, maintaining the reference threshold, that is, using the reference threshold as the sliding threshold, can prevent the event of the user clicking on the icon in the icon area from being misrecognized as a desktop sliding event. Adjusting the reference threshold to adjust the sliding threshold in the second area can improve the response speed, i.e., the followability, of the desktop sliding event in the second area. For example, when the touch event is located in the non-icon area, determining the sliding threshold as 0.2 × the reference threshold can quickly identify the desktop sliding event according to this sliding threshold.
[0074] In an optional implementation manner, after performing step S103, the method further includes S104(Figure 4 (not shown): The electronic device determines whether to generate a desktop sliding event according to the determined sliding threshold and the moving distance value generated by the displacement event detected on the desktop.
[0075] For method 2, S104 includes: The electronic device determines whether to generate a desktop sliding event according to the sliding threshold determined for the displacement event and the moving distance value generated by the displacement event.
[0076] Wherein, the displacement event is an event that the user's finger moves on the touch screen after a touch event and generates a displacement. Optionally, the displacement event is detected after detecting a Down event. Optionally, the displacement event is detected before detecting an Up event.
[0077] Optionally, step S104 may include but is not limited to: The electronic device determines to generate a desktop sliding event in response to the moving distance value being greater than or equal to the determined sliding threshold; or, the electronic device determines that no desktop sliding event is generated in response to the moving distance value being less than the determined sliding threshold.
[0078] Optionally, the desktop sliding event includes at least one of the following events: a horizontal sliding event, a swiping into the negative first screen event, a pulling-down search event, a pulling-up drawer event, or a swiping-right to pull out the drawer event. Optionally, the preset reference thresholds for different desktop sliding events may be the same or different. Optionally, the ways of adjusting the reference threshold to determine the second threshold corresponding to different desktop sliding events may be the same or different. For example, the second threshold corresponding to the pulling-down search event is determined by 0.2× the reference threshold corresponding to the pulling-down search event, and the second threshold corresponding to the pulling-up drawer event is determined by 0.2× the reference threshold corresponding to the pulling-up drawer event. Another example, the second threshold corresponding to the pulling-down search event is determined by 0.2× the reference threshold corresponding to the pulling-down search event, and the second threshold corresponding to the swiping into the negative first screen event is determined by 0.3× the reference threshold corresponding to the swiping into the negative first screen event.
[0079] In the embodiments of the present application, the sliding threshold is dynamically determined according to the position of the touch event on the desktop, which is beneficial to accurately and quickly determining the operation applied by the user to the desktop based on the sliding threshold, improving the recognition accuracy of desktop events and the response speed to desktop events. Among them, maintaining the sliding threshold corresponding to the reference threshold in the first region can reduce the misrecognition rate of click events and desktop sliding events located in the first region; reducing the reference threshold in the second region to adjust the sliding threshold can improve the response speed, i.e., the followability, of desktop sliding events in the second region.
[0080] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. 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 by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive), etc.
[0081] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware with a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage medium includes: various media that can store program codes such as ROM or random access memory RAM, magnetic disks, or optical discs.
Claims
1. A sliding processing method on an electronic device, characterized in that The method includes: In response to detecting a touch event on the desktop of an electronic device, determining the position of the touch event on the desktop; Based on the position of the touch event on the desktop, determining a sliding threshold, where the sliding threshold is used to determine whether a desktop sliding event is generated.
2. The method according to claim 1, wherein The determining the sliding threshold based on the position of the touch event on the desktop includes: In response to the touch event being located in a first area of the desktop, determining the sliding threshold as a first threshold; or, In response to the touch event being located in a second area of the desktop, determining the sliding threshold as a second threshold; Wherein, the first area and the second area are located at different positions on the desktop, and the second threshold is less than the first threshold.
3. The method according to claim 1, wherein The determining the sliding threshold based on the position of the touch event on the desktop includes: Based on the position of the touch event on the desktop, setting a flag bit, where the flag bit is used to identify that the touch event is located in the first area or the second area of the desktop; the first area and the second area are located at different positions on the desktop; In response to detecting a displacement event on the desktop, determining a sliding threshold for the displacement event according to the flag bit; The method further includes: Based on the sliding threshold determined for the displacement event and the moving distance value generated by the displacement event, determining whether a desktop sliding event is generated.
4. The method according to claim 3, wherein The determining the sliding threshold for the displacement event according to the flag bit includes: If the flag bit indicates that the touch event is located in the first area, determining the sliding threshold as the first threshold; or, If the flag bit indicates that the touch event is located in the second area, determining the sliding threshold as the second threshold; Wherein, the second threshold is less than the first threshold.
5. The method according to any one of claims 2-4, characterized in that, The determining the position of the touch event on the desktop includes: Obtaining a first position coordinate of the touch event on the desktop; If the first position coordinate is within any one of multiple sub-view areas on the desktop, determining that the touch event is located in the first area; Or, if the first position coordinate is outside the multiple sub-view areas, determining that the touch event is located in the second area.
6. The method according to any one of claims 1 to 4, characterized in that, Before the determining the position of the touch event on the desktop, the method includes: Intercepting the touch event and determining whether the touch event is a press Down event; If it is determined that the touch event is the Down event, triggering the execution of determining the position of the touch event on the desktop.
7. The method according to claim 2 or 4, characterized in that The first threshold is equal to a preset reference threshold, and the second threshold is determined by reducing the reference threshold.
8. The method according to any one of claims 2-4, characterized in that, The first area is an area where there are operation objects, and the second area is an area where there are no operation objects; the operation objects include icon objects, card objects or file objects.
9. An electronic device, characterized in that, including: One or more processors and one or more memories; the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the electronic device is caused to execute the method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, Including computer instructions, when the computer instructions run on an electronic device, the electronic device is caused to execute the method according to any one of claims 1-8.
11. A chip system, characterized in that, The chip system is applied to an electronic device. The chip system includes one or more processors, and the processors are used to call computer instructions to cause the electronic device to execute the method according to any one of claims 1-8.
Citation Information
Patent Citations
Touch screen sensitivity adjustment method and device
CN105807997A
Touch control method and apparatus
CN107562260A
User interface display method, terminal equipment and storage medium
CN110809753A
Signal processing method and device
CN112764562A
Intelligent mirror desktop jump control method and device, intelligent mirror and medium
CN115202556A