Note content moving method, electronic device, storage medium, and program product
By generating and synchronously refreshing views including elements of different layer, the jitter problem during the dragging process of circle selection targets in the note application is solved, improving the user experience.
Patent Information
- Application Number
- CN202510169112.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-02-17
AI Technical Summary
In the note application, jitter problems are prone to occur during the circle selection target and dragging, especially content jitter caused by the refresh time difference between elements of different layer.
By generating a first view including different layer elements and synchronously refreshing the content during the drag to avoid jitter, the specific steps include generating a view in the circle selection area, dragging the view position, and destroying the view at the end of the drag.
It effectively improves the jitter problem during the dragging process of circle selection targets, ensures smooth user experience, and avoids the content jitter of different layer elements during the dragging process.
Smart Images

Figure CN119645282B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software technology, and in particular, to a method for moving note content, an electronic device, a storage medium, and a program product. Background Art
[0002] With the development of intelligent electronic devices, users can more conveniently record and manage notes through note applications. In a note application, a user can use a lasso function to conveniently select a target, so as to perform operations such as dragging, cutting, and copying on the selected target. However, currently, during the process of dragging a selected target, a jitter problem may occur. Summary of the Invention
[0003] In view of this, embodiments of this application provide a method for moving note content, an electronic device, a storage medium, and a program product, which can improve the jitter problem during the dragging process of a selected target.
[0004] In a first aspect, an embodiment of this application provides a method for moving note content, including: at a first moment, displaying a first interface of a first application, where the first interface includes a lasso button, a first element, and a second element, and the first element and the second element correspond to different layers; at a second moment, based on a selection operation, displaying a second interface, where the second interface includes an outline of a first selection area, the outline of the first selection area is a closed line, and the first element and the second element are located within the first selection area; at a third moment, based on a first dragging operation corresponding to the first selection area, generating a first view, and during the dragging process of the first dragging operation, moving the position of the first view, where the first view includes the content of the first element and the second element; at a fourth moment, based on a lift operation when the first dragging operation ends, destroying the first view.
[0005] In the case where the selection area includes a first element and a second element on different layers, the dragging operation is to generate a first view including the content of the first element and the second element, and move the first view during the dragging process, and the content of the first element and the content of the second element are refreshed synchronously. Therefore, the user will not feel the jitter of the content on the first view, thereby improving the jitter problem during the dragging process of the selected target.
[0006] In some possible embodiments, the note content moving method further includes: at a fifth moment, in a third interface of a first application, the third interface includes a lasso button, a first element, and a second element; at a sixth moment, based on a lasso selection operation, a fourth interface is displayed, the fourth interface includes an outline of a second lasso selection area, the outline of the second lasso selection area is a closed line, the first element is located within the second lasso selection area, and the second element is located outside the second lasso selection area; at a seventh moment, based on a second dragging operation corresponding to the second lasso selection area, the position of the first element is moved, and during the dragging process of the second dragging operation, no first view is generated. During the dragging process of an element in a single-layer without a jitter problem, the position of the element is directly moved to improve efficiency.
[0007] In some possible embodiments, at a third moment, in response to a first dragging operation, based on the content of two corresponding layers in a first lasso selection area, a first view is generated.
[0008] In some possible embodiments, the note content moving method further includes: at a third moment, in response to a first dragging operation, the first element and the second element are hidden; at a fourth moment, based on the hand-lifting operation at the end of the first dragging operation, before destroying the first view, the first element and the second element are moved to the position corresponding to the first view and the hiding of the first element and the second element is cancelled. The first element and the second element are hidden during the dragging process to reduce the impact on the moving effect of the first view.
[0009] In some possible embodiments, the note content moving method further includes: when a touch event MotionEvent is obtained, it is determined whether a first condition is satisfied, and based on the determination result of satisfying the first condition, generating a first view and moving the position of the first view are performed; the determination result of satisfying the first condition includes that the type of the touch event is a move event and the lasso selection does not select a single-layer element.
[0010] In some possible embodiments, the determination result of satisfying the first condition further includes: being in the lasso state, being in the lasso selection state, and there being no first view.
[0011] In some possible embodiments, the note content moving method further includes: when a touch event MotionEvent is obtained, it is determined whether a second condition is satisfied, and based on the determination result of satisfying the second condition, moving the position of the first view is performed; the determination result of satisfying the second condition includes being in the lasso state, being in the lasso selection state, the type of the touch event being a move event, the lasso selection not selecting a single-layer element, and there being a first view.
[0012] In some possible embodiments, the note content moving method further includes: when a touch event MotionEvent is obtained, determining whether a third condition is satisfied, and based on the determination result that the third condition is satisfied, moving the elements of a single layer selected by the lasso. During the process of moving the elements of the single layer selected by the lasso, a first view is not generated; the determination result that the third condition is satisfied includes: the type of the touch event is a Move event, and the elements selected by the lasso are of a single layer.
[0013] In some possible embodiments, the determination result that the third condition is satisfied further includes: being in the lasso state and being in the lasso selection state.
[0014] In some possible embodiments, the note content moving method further includes: when a touch event MotionEvent is obtained, determining whether a fourth condition is satisfied, and based on the determination result that the fourth condition is satisfied, moving a first element and a second element to positions corresponding to a first view, and destroying the first view; the determination result that the fourth condition is satisfied includes: the type of the touch event is an Up event, and there is a first view.
[0015] In some possible embodiments, the determination result that the fourth condition is satisfied further includes: being in the lasso state and being in the lasso selection state.
[0016] In some possible embodiments, the note content moving method further includes: when a touch event MotionEvent is obtained, determining whether a fifth condition is satisfied, and based on the determination result that the fifth condition is satisfied, generating an outline of a lasso selection area according to the coordinates of the touch event; the determination result that the fifth condition is satisfied includes: being in the lasso state and not being in the lasso selection state.
[0017] In some possible embodiments, the note content moving method further includes: when a touch event MotionEvent is obtained, determining whether a sixth condition is satisfied, and based on the determination result that the sixth condition is satisfied, entering the lasso selection state; the determination result that the sixth condition is satisfied includes: being in the lasso state, being in a non-lasso selection state, the type of the touch event being an Up event, and having an outline of a closed lasso selection area.
[0018] In some possible embodiments, the note content moving method further includes: when a touch event MotionEvent is obtained, determining whether it is in a non-lasso state, and based on the determination result of being in a non-lasso state, performing non-lasso touch logic, and the non-lasso touch logic includes writing logic.
[0019] In some possible embodiments, the non-lasso touch logic includes: if the touch event is a click on the lasso button, then entering the lasso state.
[0020] In a second aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory. The memory is used to store at least one instruction. When the instruction is loaded and executed by the processor, the electronic device executes the above method.
[0021] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, including a program or instruction. When the program or instruction runs on a computer, the above method is executed.
[0022] In a fourth aspect, an embodiment of the present application provides a computer program product. The computer program product includes executable instructions. When the executable instructions are executed on a computer, the computer executes the above method. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] To more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0024] Figure 1 It is a structural block diagram of an electronic device in an embodiment of the present application;
[0025] Figure 2 It is a software architecture diagram of an electronic device in an embodiment of the present application;
[0026] Figure 3 It is a schematic diagram of the content hierarchy of a note application page in an embodiment of the present application;
[0027] Figure 4 It is a schematic diagram of the interface of an electronic device at a first moment t1 in an embodiment of the present application;
[0028] Figure 5 It is a schematic flowchart of a method for moving note content in an embodiment of the present application;
[0029] Figure 6 It is a schematic timing diagram of a method for moving note content in an embodiment of the present application;
[0030] Figure 7 It is a schematic diagram of the interface of an electronic device at a second moment t2 in an embodiment of the present application;
[0031] Figure 8 It is a schematic flowchart of another method for moving note content in an embodiment of the present application;
[0032] Figure 9 It is a schematic diagram of the interface of an electronic device at a third moment t3 in an embodiment of the present application;
[0033] Figure 10 It is a schematic diagram of the interface of an electronic device at time t31 in an embodiment of the present application;
[0034] Figure 11 It is a schematic diagram of the interface of an electronic device at time t32 in an embodiment of the present application;
[0035] Figure 12 It is a schematic diagram of the interface of an electronic device at time t33 in an embodiment of the present application;
[0036] Figure 13 It is a schematic diagram of the interface of an electronic device at the fourth moment t4 in an embodiment of the present application;
[0037] Figure 14 It is a schematic diagram of the interface of an electronic device at the fifth moment t5 in an embodiment of the present application;
[0038] Figure 15 It is a schematic diagram of the interface of an electronic device at the sixth moment t6 in an embodiment of the present application;
[0039] Figure 16 It is a schematic diagram of the interface of an electronic device at the seventh moment t7 in an embodiment of the present application;
[0040] Figure 17 It is a schematic diagram of the logical flow of an electronic device when a touch event is obtained in an embodiment of the present application. Detailed implementation manners
[0041] To better understand the technical solution of the present application, the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0042] It should be clear that the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0043] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "the" and "said" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0044] It should be understood that the term " / and" used herein is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0045] Before describing the embodiments of the present application, the related technologies and their technical problems will be described first. In the related technologies, in a note application, the page display content includes multiple layers, including a handwriting layer and an insertion layer. The handwriting layer is used to present handwriting elements, and the handwriting elements include handwritten characters and handwritten graphics. The insertion layer is used to present the user's inserted elements, and the inserted elements include text box elements, picture elements, and inserted formulas. The elements of different layers are superimposed and displayed. If the lasso function is used to select the target elements of two layers and then dragged to move the target elements, during the movement of the target elements, there is a difference in the refresh order of the elements in different layers. If the refresh time difference between the elements in different layers exceeds the screen refresh time, the user may perceive that the elements in different layers jitter during the movement.
[0046] The embodiments of the present application can improve this jitter problem, and the embodiments of the present application will be described below.
[0047] Figure 1 FIG. shows a schematic structural diagram of an electronic device 100 in an embodiment of the present application.
[0048] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a sensor module 180, a button 190, a display screen 194, etc. Among them, the sensor module 180 may include a touch sensor 180K, etc.
[0049] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0050] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0051] The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
[0052] A memory can also be set in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0053] The electronic device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to execute mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0054] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0055] The digital signal processor is used to process digital signals. In addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0056] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0057] The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission pattern between human brain neurons, it can quickly process input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, voice recognition, text understanding, etc.
[0058] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0059] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121, and / or the instructions stored in the memory provided in the processor.
[0060] The touch sensor 180K, also known as the "touch control device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 together form a touch screen, also known as the "touch control screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. Taking the electronic device 100 as a tablet computer as an example, the electronic device 100 can obtain not only the touch operations implemented by the user's fingers, but also the touch operations implemented by the user's stylus. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from that of the display screen 194.
[0061] The keys 190 include a power-on key, volume keys, etc. The keys 190 can be mechanical keys or touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to the user settings and function controls of the electronic device 100.
[0062] The software system of the electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservices architecture, or cloud architecture. In the embodiments of the present application, taking the Android system with a layered architecture as an example, the software structure of the electronic device 100 is exemplarily described.
[0063] Figure 2 It is a software structure block diagram of the electronic device 100 in the embodiments of the present application.
[0064] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, application framework layer, Android runtime and system libraries, and kernel layer.
[0065] The application layer can include a series of application packages.
[0066] Such as Figure 2 shown, the application packages can include applications such as a camera, gallery, calendar, notes, Bluetooth, music, video, etc.
[0067] 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.
[0068] Such as Figure 2As shown, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, etc.
[0069] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0070] The content provider is used to store and obtain data, and make this data accessible to application programs. The data may include videos, images, audio, browsing history, bookmarks, etc.
[0071] The view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build application programs. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.
[0072] The resource manager provides various resources for application programs, such as localized strings, icons, pictures, layout files, video files, etc.
[0073] The notification manager enables application programs to display notification information in the status bar. It can be used to convey notification-type messages, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform 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 a scroll bar text, such as a notification of a background-running application program, and can also be a notification that appears on the screen in the form of a dialogue window. For example, it can prompt text information in the status bar, emit a prompt sound, vibrate the electronic device, blink the indicator light, etc.
[0074] Android Runtime includes a core library and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.
[0075] The core library contains two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.
[0076] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0077] The system library may include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.
[0078] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0079] The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0080] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.
[0081] The 2D graphics engine is a drawing engine for 2D drawing.
[0082] The kernel layer is the layer between hardware and software. The kernel layer may include a display driver, an audio driver, and a sensor driver.
[0083] Next, in combination with the note application scenario, the working processes of the software and hardware of the electronic device 100 will be exemplarily described.
[0084] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including information such as touch coordinates and the timestamp of the touch operation). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the functional logic corresponding to the input event.
[0085] The note application in the embodiments of the present application may be an application for implementing the function of handwritten notes, such as Figure 3 and Figure 4 As shown, the interface of the note application includes a toolbar area and a page content area. The page content area of the note application may include a handwriting layer, an insertion layer, and a background layer. The handwriting layer is used to present handwriting elements, and the handwriting elements include handwritten characters and handwritten graphics. The insertion layer is used to present the user's inserted elements, and the inserted elements include text box elements, picture elements, and inserted formulas. It should be noted that the formulas handwritten by the user can be automatically recognized and converted into inserted formulas in the note application. The background layer is used to present the page background content, such as background gridlines, background pictures, Portable Document Format (PDF) background content, etc. The elements of different layers are superimposed and displayed. For example, the handwriting layer is located on the upper layer of the three layers, the insertion layer is located in the middle, and the background layer is located on the lower layer.
[0086] An embodiment of the present application provides a method for moving note content. The execution subject of this method can be the above-mentioned electronic device, specifically the above-mentioned note application. This method can realize the movement of content in the note application. Method for moving note content:
[0087] As Figure 4 and Figure 5 shown, perform step 101. At the first moment t1, display the first interface of the first application. The first interface includes a lasso button, a first element, and a second element. The first element and the second element correspond to different layers.
[0088] For example, the first element is an element in the handwriting layer, including the handwritten text "Zhu Ziqing's prose", and the second element is an element in the inserted layer, including the inserted text box "Zhu Ziqing's prose", the inserted picture, and the inserted formula "x + y = z".
[0089] The first application can be a note application. The note application has a lasso function, and the toolbar area of the note application includes a lasso button. As Figure 6 shown, when the user clicks the lasso button, the corresponding touch event MotionEvent will be reported. The note application responds to the touch event MotionEvent corresponding to clicking the lasso button, and sets the variable in the lasso state to true, that is, enters the lasso state. When the variable in the lasso state is true, it means that it is in the lasso state. When in the lasso state, the user can perform a selection operation in the page content area to select content. After the lasso is cancelled, the variable in the lasso selection state is set to false, and the single-layer selection flag is set to false. In the lasso selection state, click on an area not related to the lasso, for example, click on a position outside the selected area, to cancel the lasso.
[0090] As Figure 5 and Figure 7 shown, the above method for moving note content further includes:
[0091] Perform step 102. At the second moment t2, based on the selection operation, display the second interface. The second interface includes the outline of the first selected area. The outline of the first selected area is a closed line, and the first element and the second element are located within the first selected area.
[0092] During the process of selecting a region in the page content area, the sensor continuously reports touch events MotionEvent, including the down event and multiple consecutive move events. The note application generates the contour line of the selected path in response to the coordinates corresponding to the touch event MotionEvent during the selection process. The contour line can be generated on the lasso layer, and the lasso layer can be located above the handwriting layer. The up event of the user lifting the hand at the end of the selection also reports the corresponding touch event MotionEvent. The note application, in response to the up event of the user lifting the hand at the end of the selection, determines that if the contour line of the selected path is closed, that is, there is a contour line of a closed selected area, it sets the variable of the lasso selected state to true, that is, enters the lasso selected state. At this time, it is judged whether the lasso selects an element of a single layer, that is, it is judged whether there is only one layer of elements in the selected area corresponding to the selection operation. If so, it sets the flag bit (isSingleLayerSelected) of the single layer selection to true, and if not, it sets the flag bit to false. In Figure 7 In the scenario shown, the lasso does not select an element of a single layer, but includes a first element and a second element located on different layers respectively. It should be noted that the content in the background layer will not be selected.
[0093] Such as Figure 5 And Figures 8 to 12 As shown, the above-mentioned note content moving method further includes:
[0094] Execute step 103. At the third moment t3, based on the first dragging operation corresponding to the first selected area, generate the first view m1, and during the dragging process of the first dragging operation, move the position of the first view m1, and the first view includes the content of the first element and the second element.
[0095] Specifically, when in the lasso selected state, the user can perform a dragging operation on the selected area, and the sensor continuously reports touch events MotionEvent, including the down event and multiple consecutive move events. At the beginning of the dragging operation, such as when obtaining the first move event after the down event, it is judged whether the lasso selects an element of a single layer. For example, in Figure 7At the schematic second moment t2, the lasso selects not an element of a single layer, but a first element including a handwriting layer and a second element of an insertion layer. Therefore, when a first dragging operation is performed at the third moment t3, a first view m1 is generated. For example, the first view m1 may be located above the handwriting layer and the insertion layer. The first view m1 has the same position as the first enclosed area. The shape and size of the first view m1 may be the circumscribed rectangle of the first enclosed area. The first view m1 includes the content of the first element and the second element. The first view m1 can be understood as a mask layer view view, and the first view m1 carries the content of the first element and the second element. In this way, for the user, during the first dragging operation, what is actually seen is not the content of the first element and the second element in the original handwriting layer and insertion layer, but the content of the first element and the second element on the newly generated first view m1. During the dragging process, the position of the first view m1 is moved based on the dragging. For example, if the first dragging operation is a rightward dragging operation, from Figure 9 at the third moment t3 to Figure 10 the t31 moment, the first view m1 moves to the first target position to the right. From Figure 10 the t31 moment to Figure 11 the t32 moment, the first view m1 continues to move to the second target position to the right. From Figure 11 the t32 moment to Figure 12At time t33, the first view m1 continues to move to the right to the third target position. During the first drag operation, the position of the first view m1 can be moved according to the touch coordinate position reported by the sensor. For example, taking the coordinate position of the upper left corner of the first view m1 as the reference position of the first view m1, at the third moment t3, the coordinates of the first view m1 are (x11, y11), and the touch coordinate position of the user is (x21, y21). At time t31, based on the user's drag operation, the touch coordinate position becomes (x22, y22) = (x21 + △x1, y21 + △y1). According to the relative change of the touch coordinate position, it can be determined that the coordinates of the first target position of the first view m1 at time t31 are (x12, y12) = (x11 + △x1, y11 + △y1); at time t32, the touch coordinate position becomes (x23, y23) = (x22 + △x2, y22 + △y2). According to the relative change of the touch coordinate position, it can be determined that the coordinates of the second target position of the first view m1 at time t32 are (x13, y13) = (x12 + △x2, y12 + △y2); and so on. At time t33, the touch coordinate position becomes (x24, y24) = (x23 + △x3, y23 + △y3). According to the relative change of the touch coordinate position, it can be determined that the coordinates of the third target position of the first view m1 at time t33 are (x14, y14) = (x13 + △x3, y13 + △y3). During the first drag operation, since the user sees the content of the first element and the second element on the first view m1 in the same layer, and the content of the first element and the content of the second element are refreshed synchronously, the user will not feel the jitter of the content on the first view m1.
[0096] It should be noted that only three moving positions during the first drag operation are taken as examples above for illustration. In fact, the dragging process can be implemented based on the frequency of the touch signal collected by the sensor, and the corresponding process is executed every time a reported touch event MotionEvent is received.
[0097] Such as Figure 5 、 Figure 12 and Figure 13 As shown, the above note content moving method further includes:
[0098] Execute step 104. At the fourth moment t4, based on the lift operation at the end of the first drag operation, destroy the first view m1.
[0099] At the fourth moment t4, the user stops dragging, and the touch coordinate position is the same as that at the moment t33. At this time, the touch event MotionEvent reported by the sensor is the lift-up Up event, that is, the first drag operation ends. Therefore, the first view m1 can be destroyed to avoid the influence of the first view m1 on the normal layer. After destroying the first view m1, the first element and the second element of the original handwriting layer and the inserted layer at the dragged target position are displayed based on the touch coordinate position at this time.
[0100] In the note content moving method in the embodiments of the present application, the drag operation in the case where the selected area includes the first element and the second element of different layers is as follows: a first view including the content of the first element and the second element will be generated, and the first view will be moved during the dragging process, and the content of the first element and the content of the second element will be refreshed synchronously. Therefore, the user will not feel the jitter of the content on the first view, thereby improving the jitter problem during the dragging of the selected target.
[0101] In some embodiments, as Figure 8 shown, at the third moment t3, in response to the first drag operation, a first view m1 is generated based on the content of the corresponding two layers in the first selected area.
[0102] Specifically, in response to the first Move event during the first drag operation, the layer where the first element is located draws the content of the first element, the layer where the second element is located draws the content of the second element, and according to the layer hierarchy relationship, the content of the first element and the content of the second element are drawn onto a bitmap. Then, a first view m1 carrying the bitmap is added to the topmost layer corresponding to the first selected area, so that the first layer m1 has the content of the first element and the second element, and the content presented on the first layer m1 is exactly the same as the content presented by the original first element and the second element in different layers. That is, at the third moment t3, in response to the first drag operation, a first view m1 is generated based on the content of the corresponding two layers in the first selected area.
[0103] In some embodiments, as Figure 8 shown, the above-mentioned note content moving further includes: at the third moment t3, in response to the first drag operation, hiding the first element and the second element; at the fourth moment t4, based on the lift-up operation at the end of the first drag operation, before destroying the first view m1, moving the first element and the second element to the position corresponding to the first view m1 and canceling the hiding of the first element and the second element.
[0104] Specifically, after generating the first view m1, the first element in the handwriting layer is set to be transparent, and the brush color information of the element is recorded to hide the first element. The second element in the insertion layer is set to be invisible to hide the second element. During the first dragging operation, the first element in the handwriting layer and the second element in the insertion layer do not move. However, since the first element and the second element are in a hidden state and invisible to the user, what the user sees is the movement of the content of the first element and the second element on the first view m1. At the moment t33, after the first view m1 moves to the third target position (x14, y14), the touch position (x24, y24) of the user and the first view m1 no longer move. At the fourth moment t4, when the first dragging operation ends, in response to the user's hand-lifting operation, that is, in response to the hand-lifting Up event reported by the sensor, the second element in the insertion layer is moved to the target position corresponding to the touch position (x24, y24), and the second element is displayed. The first element in the handwriting layer is moved to the target position corresponding to the touch position (x24, y24), and the brush color is restored to the color before setting it to be transparent. Then, the first view m1 is destroyed. In this way, at the fourth moment t4, the first element and the second element in different layers after moving can be displayed, and other note content operations can be continued. Since the first view m1 has been destroyed, other note content operations will not be affected by the first view m1. The first view m1 only presents the dynamic effect of the dragged target content during the first dragging operation to improve the jitter problem of the content in different layers during the dragging process.
[0105] In some embodiments, the above-mentioned note content moving method further includes:
[0106] As Figure 14 shown, at the fifth moment t5, within the third interface of the first application, the third interface includes a lasso button, a first element, and a second element. The lasso button has been clicked, that is, it is in the lasso state;
[0107] As Figure 15 shown, at the sixth moment t6, based on the lasso selection operation, the fourth interface is displayed. The fourth interface includes the outline of the second lasso selection area. The outline of the second lasso selection area is a closed line. The first element is located within the second lasso selection area, and the second element is located outside the second lasso selection area, that is, only the handwritten text "Zhu Ziqing's Prose" is lassoed, and the text box, picture, and formula therein are not lassoed;
[0108] As Figure 16 shown, at the seventh moment t7, based on the second dragging operation corresponding to the second lasso selection area, the position of the first element is moved. During the dragging process of the second dragging operation, the first view is not generated.
[0109] Specifically, referring to Figure 6 and Figure 8As shown, at the start of the drag operation, for example, when the first Move event is obtained after getting the Down event, it is determined whether the lasso selects an element of a single layer. For example, at the sixth moment t6 shown in Figure 15 only the first element of the handwriting layer is selected by the lasso, and the second element of the insertion layer is not selected by the lasso. Therefore, when performing the second drag operation at the seventh moment t7, it is not necessary to generate the first view, but directly move the first element selected by the lasso. Assume that during the drag, when the received touch coordinate position is the fourth position, move the first element to the corresponding fourth target position. After that, when the received touch coordinate position is the fifth position, move the first element to the corresponding fifth target position. After that, when the received touch coordinate position is the sixth position, move the first element to the corresponding sixth target position. At the end of the drag, the movement of the first element is completed. It should be noted that during the process of t5, t6, and t7, only the case where the first element is selected by the second lasso area is taken as an example for illustration. The embodiments of the present application do not limit which layer's element is selected in the second lasso area. It can also be that the second element is selected by the second lasso area and the first element is outside the second lasso area.
[0110] In some embodiments, as shown in Figure 6 、 Figure 8 and Figure 17 the above-mentioned movement of the note content further includes: when obtaining the touch event MotionEvent, determining whether the first condition is satisfied, and based on the judgment result of satisfying the first condition, performing the above-mentioned generation of the first view m1 and moving the position of the first view m1; the judgment result of satisfying the first condition includes that the type of the touch event is the Move event and the lasso does not select an element of a single layer.
[0111] Specifically, in the underlying logic, when the note application obtains the touch event MotionEvent, it indicates that the user is performing a touch operation. The touch operation can be a touch operation implemented by a finger or a touch operation based on a stylus. Therefore, each time the touch event MotionEvent is obtained, the corresponding function will be executed according to the logic. For example, if the type of the touch event is the Move event and the lasso selects elements of at least two layers, it means that the user is dragging elements in at least two layers. At this time, the first view m1 can be generated and the position of the first view m1 can be moved to reduce the possible jitter problem of elements in different layers. The specific process of generating the first view m1 and moving the position of the first view m1 can refer to the relevant content of the third moment t3 above and will not be elaborated here. For example, during the process of moving the first view m1, the first element and the second element can be hidden.
[0112] In some embodiments, the judgment result that satisfies the first condition further includes: being in the lasso state, being in the lasso selection state, and there is no first view m1.
[0113] Specifically, determining whether the first condition is satisfied may include:
[0114] When a touch event MotionEvent is obtained, step 201 is executed to determine whether it is in the lasso state. If so, it means that the user has clicked the lasso button and the touch operation is performing functions related to the lasso. Therefore, next, step 202 is executed to determine whether it is in the lasso selection state. If so, it means that the user has selected a target through the lasso and the touch operation is performing functions related to the selected target. Next, the type of the touch event is judged. If the type of the touch event is the down event, it may be triggered by the user's pressing at the beginning of dragging the lasso to select the target. At this time, since the target has not really started to be dragged, the function may not be executed. If the type of the touch event is the move event, it means that the user has started to drag the target. Next, step 203 is executed to determine whether the element selected by the lasso is a single-layer element. If not, it means that the user is dragging an element in at least two layers. Next, step 204 is executed to determine whether there is a first view. If so, that is, the first condition is satisfied, indicating that it is the beginning of the drag operation. Next, a first view is generated and the position of the first view is moved to improve the jitter problem that may occur to elements in different layers during the dragging process.
[0115] In some embodiments, the above-mentioned movement of the note content further includes: when a touch event MotionEvent is obtained, determining whether the second condition is satisfied, and based on the judgment result that satisfies the second condition, moving the position of the first view; the judgment result that satisfies the second condition includes being in the lasso state, being in the lasso selection state, the type of the touch event being the move event, the element selected by the lasso not being a single-layer element, and there being a first view.
[0116] Specifically, determining whether the second condition is satisfied includes the above steps 201, 202, 203, and 204. The difference between satisfying the second condition and satisfying the first condition is that in step 204, if it is determined that there is a first view, it means that it is a continuous drag operation after the first view is generated. Since the first view has already been generated, there is no need to generate the first view, and only the position of the first view needs to be moved.
[0117] In some embodiments, the above-mentioned movement of note content further includes: when a touch event MotionEvent is obtained, determining whether a third condition is satisfied, and based on the determination result that the third condition is satisfied, moving the elements of a single layer selected by the lasso. During the process of moving the elements of the single layer selected by the lasso, a first view is not generated; the determination result that the third condition is satisfied includes: the type of the touch event is a Move event, and the element selected by the lasso is an element of a single layer.
[0118] Specifically, in the case of a Move event when the element selected by the lasso is an element of a single layer, it means that the element of the single layer is being dragged. In this scenario, there is no jitter problem during the dragging process. Therefore, it is only necessary to directly move the element of the single layer selected by the lasso, and there is no need to generate a first view.
[0119] In some embodiments, the determination result that the third condition is satisfied further includes: being in the lasso state and being in the lasso selection state.
[0120] Specifically, determining whether the third condition is satisfied includes the above-mentioned steps 201, 202, and 203. In step 203, if it is determined that the element selected by the lasso is an element of a single layer, it means that there is no jitter problem during the dragging process, and it is only necessary to directly move the element of the single layer selected by the lasso.
[0121] In some embodiments, the above-mentioned movement of note content further includes: when a touch event MotionEvent is obtained, determining whether a fourth condition is satisfied, and based on the determination result that the fourth condition is satisfied, moving the first element and the second element to the positions corresponding to the first view, and destroying the first view; the determination result that the fourth condition is satisfied includes: the type of the touch event is a Lift-up Up event and there is a first view.
[0122] Specifically, after moving the first view, when the user finishes the first drag operation and lifts the hand, a Lift-up Up event will be reported. At this time, if it is determined that there is a first view, it means that during the dragging process, the position of the first view has been moved, but the first element and the second element have not been moved. Therefore, first, move the first element and the second element to the positions corresponding to the first view, and cancel the hiding of the first element and the second element, and then destroy the first view to achieve the dragging effect of the first element and the second element.
[0123] In some embodiments, the determination result that the fourth condition is satisfied further includes: being in the lasso state and being in the lasso selection state.
[0124] Specifically, determining whether the fourth condition is satisfied may include the above steps 201 and 202. Based on the determination in step 202 that it is in the lasso selection state, it is determined that the type of the touch event is the lift-up Up event, indicating that the user has ended the dragging operation. At this time, step 205 is executed. It is determined whether there is a first view. If so, it means that the dragging operation is based on elements in at least two layers. Therefore, after the dragging operation is completed, the first element and the second element are moved to the position corresponding to the first view, and the first view is destroyed. In step 205, if it is determined that there is no first view, it means that the dragging has ended and no additional processing is required.
[0125] In some embodiments, the above movement of the note content further includes: when a touch event MotionEvent is obtained, determining whether the fifth condition is satisfied, and based on the determination result of satisfying the fifth condition, generating an outline of the lasso selection area according to the coordinates of the touch event; the determination result of satisfying the fifth condition includes: being in the lasso state and not being in the lasso selection state.
[0126] Specifically, determining whether the fifth condition is satisfied may include steps 201 and 202. If it is determined in step 202 that it is not in the lasso selection state, it means that the user has not completed the lasso selection. At this time, the reported touch event MotionEvent is the process of the user's lasso selection. Therefore, an outline of the lasso selection area is generated according to the coordinates of the touch event to prompt the user of the lasso selection range.
[0127] In some embodiments, the above movement of the note content further includes: when a touch event MotionEvent is obtained, determining whether the sixth condition is satisfied, and based on the determination result of satisfying the sixth condition, entering the lasso selection state; the determination result of satisfying the sixth condition includes: being in the lasso state, being in the non-lasso selection state, the type of the touch event being the lift-up Up event, and having an outline of a closed lasso selection area.
[0128] Specifically, when the lift-up Up event at the end of the user's lasso selection is obtained, if the user has lassoed a closed area, it means that the lasso selection has been completed, that is, entering the lasso selection state. After that, the user can perform corresponding operations based on the lasso-selected target, including dragging.
[0129] In some embodiments, the above movement of the note content further includes: when a touch event MotionEvent is obtained, determining whether it is in the non-lasso state, and based on the determination result of being in the non-lasso state, executing non-lasso touch logic, and the non-lasso touch logic includes writing logic.
[0130] Specifically, in the above step 201, if it is determined that it is not in the lasso state, it means that the user's current touch operation does not involve the lasso function. Therefore, the corresponding non-lasso touch logic can be executed, for example, it may be that the user is writing content.
[0131] In some embodiments, the non-lasso touch logic includes: if the touch event is a click on the lasso button, enter the lasso state.
[0132] Specifically, when in the non-lasso state, if the user wishes to perform the lasso function, the user can click the lasso button to enter the lasso state.
[0133] An embodiment of the present application also provides an electronic device, including: a processor and a memory. The memory is used to store at least one instruction. When the instruction is loaded and executed by the processor, the electronic device executes the method in any of the above embodiments. The electronic device may be the above-mentioned electronic device 100.
[0134] The electronic device involved in the present application may be any product such as a smart TV, mobile phone, tablet computer, personal computer (PC), personal digital assistant (PDA), smart watch, wearable electronic device, augmented reality (AR) device, virtual reality (VR) device, vehicle-mounted device, drone device, smart car, smart speaker, robot, smart glasses, etc.
[0135] An embodiment of the present application also provides a computer-readable storage medium, including a program or instruction. When the program or instruction runs on a computer, the method in any of the above embodiments is executed.
[0136] An embodiment of the present application also provides a computer program product. The computer program product includes executable instructions. When the executable instructions are executed on a computer, the computer executes the method in any of the above embodiments.
[0137] 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 this 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 (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state disk).
[0138] In the embodiments of this application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent the situations where A exists alone, A and B exist simultaneously, and B exists alone. Wherein A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one of the following" and its similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.
[0139] The above are only the preferred embodiments of this application and are not used to limit this application. For those skilled in the art, various changes and modifications can be made to this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.
Claims
1. A method for moving note content, characterized in that, Including: At a first moment, display a first interface of a first application, where the first interface includes a lasso button, a first element, and a second element, and the first element and the second element correspond to different layers; At a second moment, based on a lasso selection operation, display a second interface, where the second interface includes a contour line of a first lasso selection area, and the contour line of the first lasso selection area is a closed line, and the first element and the second element are located within the first lasso selection area; At a third moment, based on a first drag operation corresponding to the first lasso selection area, generate a first view. During the dragging process of the first drag operation, move the position of the first view, and the first view includes the content of the first element and the second element; At a fourth moment, based on the lift operation when the first drag operation ends, destroy the first view; At a fifth moment, display within a third interface of the first application, where the third interface includes the lasso button, the first element, and the second element; At a sixth moment, based on a lasso selection operation, display a fourth interface, where the fourth interface includes a contour line of a second lasso selection area, and the contour line of the second lasso selection area is a closed line, the first element is located within the second lasso selection area, and the second element is located outside the second lasso selection area; At a seventh moment, based on a second drag operation corresponding to the second lasso selection area, move the position of the first element. During the dragging process of the second drag operation, no first view is generated.
2. The method according to claim 1, wherein: At the third moment, in response to the first drag operation, based on the content corresponding to two layers in the first lasso selection area, generate the first view.
3. The method according to claim 2, wherein Further including: At the third moment, in response to the first drag operation, hide the first element and the second element; At the fourth moment, based on the lift operation when the first drag operation ends, before destroying the first view, move the first element and the second element to the position corresponding to the first view and cancel hiding the first element and the second element.
4. The method according to claim 1, wherein Further including: When a touch event MotionEvent is obtained, determine whether a first condition is satisfied. Based on the determination result of satisfying the first condition, perform generating the first view and moving the position of the first view; The determination result of satisfying the first condition includes that the type of the touch event is a Move event and the lasso selection does not select a single-layer element.
5. The method according to claim 4, wherein: The determination result of satisfying the first condition further includes: being in the lasso state, being in the lasso selection state, and there is no first view.
6. The method according to claim 4, wherein Further including: When a touch event MotionEvent is obtained, determine whether a second condition is satisfied. Based on the determination result of satisfying the second condition, perform moving the position of the first view; The judgment result that meets the second condition includes being in the lasso state, being in the lasso selection state, the type of the touch event being the Move event, the element selected by the lasso not being a single-layer element, and the existence of the first view.
7. The method according to claim 4, characterized in that, It further includes: When a MotionEvent touch event is obtained, it is judged whether the third condition is met. Based on the judgment result that meets the third condition, the element of the single-layer selected by the lasso is moved, and during the process of moving the element of the single-layer selected by the lasso, the first view is not generated; The judgment result that meets the third condition includes: the type of the touch event being the Move event, and the element selected by the lasso being a single-layer element.
8. The method according to claim 7, wherein The judgment result that meets the third condition further includes: being in the lasso state and being in the lasso selection state.
9. The method according to claim 4, wherein It further includes: When a MotionEvent touch event is obtained, it is judged whether the fourth condition is met. Based on the judgment result that meets the fourth condition, the first element and the second element are moved to the position corresponding to the first view, and the first view is destroyed; The judgment result that meets the fourth condition includes: the type of the touch event being the Up event and the existence of the first view.
10. The method according to claim 9, wherein The judgment result that meets the fourth condition further includes: being in the lasso state and being in the lasso selection state.
11. The method according to claim 4, wherein It further includes: When a MotionEvent touch event is obtained, it is judged whether the fifth condition is met. Based on the judgment result that meets the fifth condition, the contour line of the lassoed area is generated according to the coordinates of the touch event; The judgment result that meets the fifth condition includes: being in the lasso state and not being in the lasso selection state.
12. The method according to claim 11, wherein, It further includes: When a MotionEvent touch event is obtained, it is judged whether the sixth condition is met. Based on the judgment result that meets the sixth condition, the lasso selection state is entered; The judgment result that meets the sixth condition includes: being in the lasso state, being in the non-lasso selection state, the type of the touch event being the Up event, and having a closed contour line of the lassoed area.
13. The method according to claim 4, characterized in that, It further includes: When a MotionEvent touch event is obtained, it is judged whether it is in the non-lasso state. Based on the judgment result of being in the non-lasso state, the non-lasso touch logic is executed, and the non-lasso touch logic includes the writing logic.
14. The method according to claim 13, wherein The non-lasso touch logic includes: if the touch event is to click the lasso button, then enter the lasso state.
15. An electronic device, characterized in that, It includes: A processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the electronic device executes the method according to any one of claims 1 to 14.
16. A computer-readable storage medium, characterized in that, It includes a program or instruction, and when the program or instruction runs on a computer, the method according to any one of claims 1 to 14 is executed.
17. A computer program product, characterized in that, The computer program product includes executable instructions that, when executed on a computer, cause the computer to perform the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Element control method, device and equipment and storage medium
CN108710460A