Folder management method and terminal device
Through drag and drop operations and automatic adjustment of the folder list structure, the problem of cumbersome folder management operations in the existing technology is solved, convenient and efficient management of folders is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202211145006.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-20
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-09-20
AI Technical Summary
In the prior art, folder management has limitations on location and hierarchical order in the mobile phone list, which makes it difficult for users to easily obtain suitable folder layouts in scenarios with more folder types.
Move folders by dragging and dropping, and automatically adjust the folder list structure information according to the position and offset at the end of dragging, the folder movement and merging are realized, and the folder management process is simplified.
It improves the convenience and user experience of folder management, reduces operation steps, and realizes flexible and efficient folder management.
Smart Images

Figure CN116719454B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Android systems, and in particular to a folder management method and terminal device. Background Art
[0002] With the development of terminal technology, more and more functions are provided to users, which greatly improves the convenience of users' lives and work. Taking the memo function in the mobile phone as an example, users can create folders in the memo and edit the content in the folder to replace the traditional way of taking notes with paper and pen. For example, when the user needs to take notes on many types of matters, you can create folders with different titles in the memo, or create subfolders with different titles under a folder with a certain title, so that users can view different types of memo content according to the title level.
[0003] However, there are still many limitations on the management of folders in mobile phone lists, such as the inability to arbitrarily change the location of folders or the hierarchical order of folders. Therefore, in scenarios with many folder types, users cannot obtain a folder layout that suits their viewing habits through convenient operations. Summary of the invention
[0004] The embodiment of the present application provides a method and terminal device for managing folders, which moves the location of a folder by dragging and dropping, adaptively modifies the folder list structure information when the folder is moved to the target location, and displays the updated folder list based on the updated folder list structure information. The method can achieve the goal of based on the folder list structure information without the user having to input cumbersome operations. The system manages folders conveniently and efficiently, which can effectively improve the user experience.
[0005] In a first aspect, a folder management method is provided, which is applied to a terminal device and includes:
[0006] In response to a long press operation input by the user on a first folder icon in the first folder list, displaying a first interface, wherein the first interface includes the first folder icon in a selected state;
[0007] receiving a drag operation input by a user for the first folder icon, and displaying the second interface in response to the drag operation, wherein the second interface includes a position change of the first folder icon during the dragging process;
[0008] When the dragging ends, in response to a hand-lifting operation input by the user, a target position of the first folder is determined according to the dragging height and the offset of the first folder relative to the target folder after being dragged, wherein the target position is inside the target folder or adjacent to the target folder;
[0009] updating preset folder list structure information according to the target position of the first folder, and acquiring first folder list structure information, wherein the first folder list structure information is used to indicate the identification ID, the level, the ID of the parent folder to which the folder belongs, and the folder arrangement order of each folder in the first folder list after the dragging is completed;
[0010] A third interface is displayed according to the first folder list structure information, wherein the third interface includes a second folder list, and the second folder list is a folder list corresponding to when the first folder icon is dragged to a target location.
[0011] In a possible implementation, the arrangement order of the folders may correspond to the user_order of the folders, specifically, the arrangement order of the folders in the hierarchy they are in. For example, assuming there are three folders in the first hierarchy, since these three folders are arranged in order in the folder list, user_order is used to indicate which one is in the first position of the first hierarchy, which one is in the second position of the first hierarchy, and which one is in the third position of the first hierarchy.
[0012] It should be understood that the arrangement order here is only the arrangement order of the folders in their hierarchy, and does not represent the arrangement order in the entire folder list.
[0013] According to the folder management method provided by the embodiment of the present application, by The system terminal device presents a folder to be moved by inputting a drag operation, and dragging the selected folder to the target location to achieve the folder moving effect. In addition, when it is necessary to merge folders, by dragging the selected folder to the top of the target folder to be merged, and making the overlapping relationship between the selected folder and the target folder meet the preset conditions, the two folders can be automatically merged. This method can achieve automatic merging based on the user without the user inputting cumbersome operations. The system manages folders conveniently and efficiently, which can effectively improve the user experience.
[0014] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0015] The folder structure information is generated according to the information of each folder in the first folder list recorded in the database, wherein the information of each folder includes the folder ID, the level, the parent-child relationship of the folder, and the arrangement order.
[0016] In combination with the first aspect, in some implementations of the first aspect, generating the folder structure information according to the information of each folder in the first folder list recorded in the database specifically includes:
[0017] According to the level of the folder, obtain the folders at the first level in the first folder list;
[0018] Traverse and query each subfolder included in the first-level folder to obtain the corresponding second-level folder;
[0019] Recursively query the subfolders included in the second-level folder to obtain the corresponding third-level folder;
[0020] Repeat the above recursive subfolder query operation until a folder at a certain level no longer contains subfolders;
[0021] Generate folder list structure information based on the hierarchy of each folder, the parent-child relationship of folders, and the arrangement order.
[0022] In combination with the first aspect, in some implementations of the first aspect, in response to a long press operation input by the user on the first folder icon in the first folder list, displaying the first interface specifically includes:
[0023] In response to a long press operation input by a user on a first folder icon in the first folder list, determining a first coordinate corresponding to the long press operation;
[0024] determining a first folder according to the first coordinates, wherein the location of the first folder corresponds to the first coordinates;
[0025] The first folder icon is set to a selected state, and the first interface is displayed.
[0026] In combination with the first aspect, in some implementations of the first aspect, when the first folder includes subfolders, displaying the first interface in response to a long press operation input by the user on the first folder icon in the first folder list further includes:
[0027] In response to a long press operation input by the user on a first folder icon in the first folder list, deleting information corresponding to a subfolder of the first folder in the preset folder list structure information, and acquiring second folder list structure information;
[0028] A first interface is displayed according to the second folder structure information, wherein the first interface includes the first folder icon in a selected state, and the subfolders included in the first folder are not displayed.
[0029] In combination with the first aspect, in some implementations of the first aspect, receiving a drag operation input by a user on the first folder icon, and determining a position of the first folder icon during the moving process in response to the drag operation specifically includes:
[0030] receiving a drag operation input by a user on the first folder icon;
[0031] Determining at least one second coordinate corresponding to the drag operation;
[0032] At least one position of the first folder currently located during the moving process is determined according to the at least one second coordinate.
[0033] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0034] The position change of the first folder icon during the dragging process is displayed according to at least one position of the first folder during the moving process.
[0035] In combination with the first aspect, in some implementations of the first aspect, the target folder includes a second target folder and / or a third folder, and the method further includes:
[0036] When the dragging ends, in response to a hand-raising operation input by the user, the second folder and / or the third folder adjacent to the first folder icon is determined according to the dragging height, wherein the second folder is an adjacent folder located above the first folder icon, and the third folder is an adjacent folder located below the first folder icon;
[0037] determining whether to merge folders according to the offset of the first folder relative to the target folder after being dragged; wherein,
[0038] When it is determined according to the offset that the overlapped portion of the first folder and the second folder is greater than or equal to a first ratio, merging the first folder and the second folder;
[0039] When it is determined according to the offset that the overlapped portion of the first folder and the second folder is smaller than a first ratio, the first folder and the second folder are not merged;
[0040] When it is determined according to the offset that the overlapped portion of the first folder and the third folder is greater than or equal to a first ratio, merging the first folder and the third folder;
[0041] When it is determined according to the offset that the overlapped portion of the first folder and the third folder is smaller than a first ratio, the first folder and the third folder are not merged;
[0042] When it is determined according to the offset that the overlapping parts of the first folder, the second folder and the third folder are all smaller than a first ratio, the first folder icon is moved between the second folder icon and the third folder icon.
[0043] In combination with the first aspect, in some implementations of the first aspect, determining whether to merge folders according to an offset of the first folder relative to the target folder after being dragged specifically includes:
[0044] Whether to merge folders is determined according to the offset of the first folder relative to the target folder after being dragged and the dragging direction.
[0045] In combination with the first aspect, in some implementations of the first aspect, determining whether to merge folders according to an offset of the first folder relative to the target folder after being dragged and a dragging direction specifically includes:
[0046] When it is determined according to the offset that the overlapped portion of the first folder and the second folder is greater than or equal to a first ratio, and the direction of the drag operation is upward, merging the first folder and the second folder;
[0047] When it is determined according to the offset that the overlapped portion of the first folder and the second folder is greater than or equal to a first ratio, and the direction of the drag operation is downward, moving the first folder icon below the second folder icon;
[0048] When it is determined according to the offset that the overlapped portion of the first folder and the third folder is greater than or equal to a first ratio, and the direction of the drag operation is downward, merging the first folder and the third folder;
[0049] When it is determined according to the offset that the overlapped portion of the first folder and the third folder is greater than or equal to a first ratio, and the direction of the drag operation is upward, the first folder icon is moved above the second folder icon.
[0050] In combination with the first aspect, in some implementations of the first aspect, updating the preset folder list structure information according to the target location of the first folder specifically includes:
[0051] When the first folder is merged with the second folder, the first folder is modified as a subfolder of the second folder in the folder list structure information, and the arrangement order of the first folder is determined according to the position of the first folder in the second folder;
[0052] When the first folder is merged with the third folder, the first folder is modified as a subfolder of the third folder in the folder list structure information, and the arrangement order of the first folder is determined according to the position of the first folder in the third folder;
[0053] When the first folder icon is moved between the second folder icon and the third folder icon, the position of the first folder in the folder list structure information is modified to be between the subfolder of the second folder and the third folder.
[0054] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0055] The folder information in the database is adjusted according to the updated folder list structure information, so that the folder level and folder arrangement order corresponding to each folder in the database are consistent with those in the updated folder structure information.
[0056] In combination with the first aspect, in some implementations of the first aspect, the folder list structure information is an array value, and the array value includes the ID of the folder corresponding to each folder included in the folder list, the level at which it is located, the ID of the parent folder to which it belongs, and the arrangement order of the folders;
[0057] The updating of the preset folder list structure information according to the target location of the first folder specifically includes:
[0058] Modify the position corresponding to the first folder in the array value according to the target position after the first folder is dragged, so that the position of the first folder in the array value is consistent with the position of the first folder in the folder list after the first folder is dragged; and
[0059] modifying the arrangement order of the folders corresponding to the first folder in the array value so that the arrangement order of the folders corresponding to the first folder is consistent with the arrangement order in the folder list after the first folder is dragged; and,
[0060] modifying the level corresponding to the first folder in the array value so that the level corresponding to the first folder is consistent with the level in the folder list after the first folder is dragged; and,
[0061] The ID of the parent folder corresponding to the first folder is modified in the array value so that the ID of the parent folder corresponding to the first folder is consistent with the ID of the parent folder in the folder list after the first folder is dragged.
[0062] In a second aspect, a terminal device is provided, comprising: one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs comprising instructions, which, when executed by the one or more processors, enable the terminal device to execute a method as described in any implementation of the first aspect above.
[0063] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable program instructions, and when the computer-executable program instructions are executed on a computer, the computer executes the method as described in any implementation of the first aspect above.
[0064] In a fourth aspect, a computer program product is provided, the computer program product comprising a computer program code, and when the computer program code is run on a computer, the computer is caused to execute the method as described in any implementation manner of the above-mentioned first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 A schematic diagram of the structure of a terminal device 100 provided in an embodiment of the present application.
[0066] Figure 2 A software structure block diagram of a terminal device 100 provided in an embodiment of the present application.
[0067] FIG. 3A to FIG. 3D A schematic diagram of a GUI that may be involved in the implementation of some folder management methods provided in the embodiments of the present application.
[0068] FIG. 4A to FIG. 4D A schematic diagram of a GUI that may be involved in the implementation of other folder management methods provided in the embodiments of the present application.
[0069] FIG. 5A to FIG. 5F GUI schematic diagrams that may be involved in the implementation of some folder management methods provided in the embodiments of the present application.
[0070] Figure 6 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application.
[0071] Figure 7 A schematic diagram of obtaining folder sorting in a recursive manner provided in an embodiment of the present application.
[0072] Figure 8 A schematic flowchart of a folder management method provided in an embodiment of the present application.
[0073] Fig.9A and Fig. 9B GUI schematic diagrams that may be involved in the implementation of some folder management methods provided in the embodiments of the present application.
[0074] Fig.10 A schematic flowchart of another folder management method provided in an embodiment of the present application.
[0075] Fig.11 A schematic flowchart of another folder management method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0076] It should be noted that the terms used in the implementation method part of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated obstacles, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two, "at least one" and "one or more" mean one, two or more than two.
[0077] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, it is defined that the "first" and "second" features may explicitly or implicitly include one or more of the features.
[0078] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing at different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way.
[0079] Combined with the introduction in the background technology, currently one way to move or merge folders is to copy or cut the selected folder and then paste the folder to the target location, or open the target folder and paste the folder to be moved into the target folder. This method requires the user to perform multiple steps, and the process is relatively cumbersome. With the development of terminal technology, the use of Terminal devices with operating systems have also been widely used. In the situation where touch panels have almost become standard equipment for portable terminal devices, if we can Designing a flexible and easy way to move folders on terminal devices will provide users with a better and more convenient experience.
[0080] In view of this, the present application provides a method and terminal device for managing folders, which can be applied to a computer having a touch panel and using In a terminal device of an operating system, when a user needs to manage folders in a folder list (especially location management), the user only needs to drag the selected folder to a specific location to move and merge the folders, thereby improving the user's Flexibility and convenience of folder management in terminal devices.
[0081] For example, Figure 1 FIG. 1 is a schematic diagram of a terminal device 100 provided in an embodiment of the present application. The terminal device 100 may correspond to the above-mentioned terminal device having a touch panel and using Terminal device of the operating system.
[0082] The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0083] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0084] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0085] The controller may be the nerve center and command center of the terminal device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0086] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0087] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0088] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the terminal device 100.
[0089] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0090] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0091] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0092] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the terminal device 100.
[0093] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0094] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device 100, and can also be used to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminals, such as AR devices, etc.
[0095] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0096] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. While the charging management module 140 is charging the battery 142, it may also power the terminal through the power management module 141.
[0097] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0098] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0099] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0100] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0101] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0102] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0103] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0104] The terminal device 100 implements the display function through the GPU, the display screen 194, and the application processor, etc. The display screen 194 is used to display images, videos, etc.
[0105] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0106] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy. The video codec is used to compress or decompress digital video. The NPU is a neural network (NN) computing processor that quickly processes input information by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, and can also continuously self-learn.
[0107] 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 terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external memory card. The internal memory 121 can be used to store computer executable program codes, which include instructions.
[0108] The terminal device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0109] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. The magnetic sensor 180D includes a Hall sensor. The terminal device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the terminal posture and applied to horizontal and vertical screen switching, pedometers and other applications. The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal device 100 emits infrared light outward through the light emitting diode. The ambient light sensor 180L is used to sense the ambient light brightness. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect temperature. The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The bone conduction sensor 180M can obtain vibration signals.
[0110] In addition, the terminal device 100 further includes an air pressure sensor 180C and a distance sensor 180F. The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0111] The distance sensor 180F is used to measure the distance. The terminal device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0112] Exemplarily, the software system of the terminal device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes the Android system of the layered architecture as an example to exemplify the software structure of the terminal device 100. Figure 2 It is a software structure block diagram of the terminal device 100 according to an embodiment of the present application.
[0113] The layered architecture divides the software into several layers, each with clear roles 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: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0114] The application layer can include a series of application packages. Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, music, video, short message, RecyclerView display control, drag animation callback module (ItemTouchHelper.Callback), etc.
[0115] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, an ItemTouchHelper module, and the like.
[0116] 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.
[0117] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0118] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0119] The phone manager is used to provide communication functions of the terminal device 100, such as management of call status (including connection, disconnection, etc.).
[0120] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0121] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, 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 notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the terminal vibrates, the indicator light flashes, etc.
[0122] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0123] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0124] 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 obstacle life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0125] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0126] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0127] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0128] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0129] A 2D graphics engine is a drawing engine for 2D drawings.
[0130] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0131] In order to better understand the folder management method provided in the embodiment of the present application, the implementation process of the folder management method is introduced below in conjunction with the graphical user interface (GUI) shown in the accompanying drawings.
[0132] For example, FIG. 3A to FIG. 3D As shown, it is a GUI schematic diagram that may be involved in the implementation process of some folder management methods provided in the embodiments of the present application. For example, here, the terminal device is a mobile phone, and the moving of folders in the folder list of the memo application (application, App) in the mobile phone is introduced as an example, but the scenarios involved in actual applications are not limited to this.
[0133] like Figure 3A As shown, it is an editing interface in the mobile phone memo app, which may include a folder list, and the folder list includes multiple folders. For ease of understanding, the present application may divide the folders into different levels according to their positional relationship. For example, the first-level folder may refer to a folder in the root directory, which does not have a corresponding parent folder but may include at least one subfolder; the second-level folder may refer to the next-level subfolder included in the first-level folder in the file list; the third-level folder ( Figure 3A (not shown) may refer to the next level subfolders included in the second level folder in the folder list. Figure 3A As shown, the indent distances of folders at different levels relative to the left edge of the editing interface can be different. The third-level folder ( Figure 3AThe indent distance of the first-level folder relative to the left edge (not shown) can be greater than the indent distance of the second-level folder relative to the left edge; and the indent distance of the second-level folder relative to the left edge can be greater than the indent distance of the first-level folder relative to the left edge.
[0134] Combination Figure 3A As shown, the first-level folders include, for example, folders titled "My Notes" and "My Excerpts"; the second-level folder list includes, for example, folders titled "Personal", "Work", "Life", "Travel", "Exhibition", "Reading" and other folders with third-party APP names as titles, such as "Zhihu", "Today's Headlines", and "Weibo". Among them, the "Personal" folder, "Work" folder, "Life" folder, "Travel" folder, "Exhibition" folder, and "Reading" folder can be used as subfolders in the "My Notes" folder in the first level, and "My Notes" is the parent folder of these subfolders. The "Zhihu" folder, "Today's Headlines", and "Weibo" folder can be used as subfolders in the "My Excerpts" folder in the first level, and "My Excerpts" is the parent folder of these subfolders. In addition, the editing interface can also include a new control corresponding to each folder. When the user clicks the new control corresponding to a folder, the mobile phone can be triggered to create a new subfolder of the folder. For example, when the mobile phone detects that the user clicks such as Figure 3A When a new control is clicked in the "My Notes" folder shown in the figure, a subfolder can be created in the "My Notes" folder in response to the click operation.
[0135] In some embodiments, when a user needs to move a folder in a folder list, the user can long press the icon of the folder to be moved with a finger, and move the folder to the target location by dragging.
[0136] For example, if the user needs to move the "Reading" folder to the "Life" folder to merge the two folders, the user can enter the preset operation 301 for the "Reading" folder in the editing interface (such as long pressing the "Reading" folder icon); when the mobile phone detects that the user enters the preset operation 301 for the "Reading" folder icon, the "Reading" folder icon can be set to highlight, which means that the "Reading" folder has been successfully selected. Figure 3B As shown, the user enters a preset operation 302 for the "Read" folder icon (such as according to Figure 3BAfter the mobile phone detects that a preset operation 302 is input for the "Reading" folder icon, the process of the "Reading" folder icon being dragged in the direction indicated by the arrow can be displayed, and the process can include the position of the "Reading" folder icon following the user's finger (such as Figure 3B Real-time changes of the user's index finger) dragging.
[0137] In some embodiments, Figure 3C As shown in FIG. 3 , when the “Reading” folder icon is dragged above the “Life” folder icon and the overlap between the two is greater than the corresponding preset threshold, the user can perform a preset operation 303 (such as releasing the “Reading” folder icon); when the mobile phone detects that the user releases the “Reading” folder icon, the following information can be displayed: Figure 3D The merge completion interface shown can display the effect of dragging the "Reading" folder into the "Life" folder and merging the two folders. Specifically, the "Reading" folder can be changed to a third-level folder, that is, the "Reading" folder is changed to a subfolder of the "Life" folder.
[0138] It should be noted that the above FIG. 3A to FIG. 3D The folder moving process shown is only introduced by moving the "Reading" folder between folders at the same level and merging it with folders at the same level as an example, but the embodiments of the present application are not limited to this. In actual applications, the movement range of folders is not limited to only within the same level, that is, folders can also be moved across levels, and can also be moved to other folders at the previous level. For example, in the folder management method provided in the embodiment of the present application, the "Reading" folder can also be moved from the "My Notes" folder to the "My Excerpts" folder, and then the "Reading" folder can be merged with the "Zhihu" subfolder.
[0139] It should also be noted that the above FIG. 3A to FIG. 3D The interface content shown is only an example. In actual applications, the folder list may also include more or fewer other types of folders, which is not limited in this embodiment of the present application.
[0140] According to the folder management method provided by the embodiment of the present application, by The system terminal device presents a folder to be moved by inputting a drag operation, and dragging the selected folder to the target location to achieve the folder moving effect. In addition, when it is necessary to merge folders, by dragging the selected folder to the top of the target folder to be merged, and making the overlapping relationship between the selected folder and the target folder meet the preset conditions, the two folders can be automatically merged. This method can achieve automatic merging based on the user without the user inputting cumbersome operations. The system manages folders conveniently and efficiently, which can effectively improve the user experience.
[0141] For example, FIG. 4A to FIG. 4D As shown, it is a GUI schematic diagram that may be involved in the implementation process of other folder management methods provided in the embodiments of the present application. For example, here we continue to take the terminal device as a mobile phone and move the folders in the memo application (application, App) folder list in the mobile phone as an example, but in actual application it is not limited to this.
[0142] like Figure 4A As shown, it is an editing interface in the mobile phone memo, and the editing interface may include a folder list, and the folder list may include folders of multiple different levels. For example, the folders of the first level in the folder list may include folders with titles of "My Notes" and "My Excerpts" respectively; the folders of the second level in the folder list may include folders with titles of "Personal", "Work", "Life", "Travel", "Exhibition", "Reading" and other folders with titles of third-party APP names, such as "Zhihu" folder, "Today's Headlines" folder, and "Weibo" folder. Among them, the "Personal" folder, "Work" folder, "Life" folder, "Travel" folder, "Exhibition" folder, and "Reading" folder can be used as subfolders in the "My Notes" folder in the first level, and "My Notes" is the parent folder of these subfolders. The "Zhihu" folder, "Today's Headlines" folder, and "Weibo" folder can be used as subfolders in the "My Excerpts" folder in the first level, and "My Excerpts" is the parent folder of these subfolders. In addition, the editing interface may also include a new control corresponding to each folder. When the user clicks the new control corresponding to a folder, the mobile phone may be triggered to create a new subfolder of the folder. For example, when the mobile phone detects that the user clicks Figure 4A When a new control is clicked in the "My Notes" folder shown in the figure, a subfolder can be created in the "My Notes" folder in response to the click operation.
[0143] In some embodiments, assuming that the user needs to move the location of the "Reading" folder between the "Life" folder and the "Work" folder, the user can enter a preset operation 401 for the "Reading" folder in the editing interface (such as long pressing the "Reading" folder icon); when the mobile phone detects that the user enters the preset operation 401 for the "Reading" folder, the "Reading" folder icon can be set to highlight, which means that the "Reading" folder has been selected.
[0144] For example, Figure 4B As shown, the user enters a preset operation 402 for the "Read" folder (such as according to Figure 4B ); when the mobile phone detects that the user has input a preset operation 402 for the "Reading" folder, the position of the "Reading" folder can be displayed dynamically changing in the process of being dragged in the direction indicated by the arrow; or, the "Reading" folder can be displayed following the finger of the user inputting the long press operation (such as Figure 4B The target position of the drag operation is located between the "Life" folder and the "Work" folder (such as the boundary between the "Life" folder icon and the "Work" folder icon).
[0145] In some embodiments, Figure 4C As shown, when the "Reading" folder icon is dragged to the intersection of the "Life" folder icon and the "Work" folder icon, the user can perform a preset operation 403 (such as releasing the "Reading" folder icon); when the mobile phone detects that the user stops pressing the "Reading" folder icon, it can display the following Figure 4D The move completion interface shown can display the interface effect after dragging the "Reading" folder to the target location between the "Life" folder and the "Work" folder. Specifically, at this time, the "Reading" folder is still a second-level subfolder, that is, the "Reading" folder is still a subfolder in the "My Notes" folder, but its position has changed, and the order in which all subfolders in the "My Notes" folder are presented in the folder list has also changed accordingly.
[0146] It should be noted that the above FIG. 4A to FIG. 4DThe folder moving process shown is only introduced by moving the "Reading" folder within its corresponding parent folder (that is, the "My Notes" folder) as an example, but the embodiments of the present application are not limited to this. In actual applications, the movement range of a folder is not limited to the range limit of the same level to which it corresponds. In other words, a folder can also be moved between its parent folder and other folders of the upper level. For example, in the folder management method provided in the embodiments of the present application, the "Reading" folder can also be moved from the "My Notes" folder to the "My Excerpts" folder.
[0147] It should also be noted that the above FIG. 4A to FIG. 4D The interface content shown is only an example. In actual applications, the folder list may also include more or fewer other types of folders, which is not limited in this embodiment of the present application.
[0148] According to the folder management method provided by the embodiment of the present application, by The system terminal device presents a folder to be moved by inputting a drag operation, and dragging the selected folder to the target location to achieve the folder moving effect. In addition, when it is necessary to merge folders, by dragging the selected folder to the top of the target folder to be merged, and making the overlapping relationship between the selected folder and the target folder meet the preset conditions, the two folders can be automatically merged. This method can achieve automatic merging based on the user without the user inputting cumbersome operations. The system manages folders conveniently and efficiently, which can effectively improve the user experience.
[0149] In some scenarios, the folder to be moved (or the selected folder) may also include at least one subfolder. In this case, you can still follow the above steps. FIG. 3A to FIG. 3D The process shown in the embodiment or according to FIG. 4A to FIG. 4D The process shown in the embodiment moves and / or merges the folder to be moved. FIG. 3A to FIG. 3D Example or FIG. 4A to FIG. 4D In the process introduced in the embodiment, the main change in the situation where the folder to be moved includes subfolders is that: if the folder to be moved is in an open state, that is, the subfolders included in the folder to be moved are all in a displayed state, then when the terminal device detects that the user inputs a preset operation for the icon of the folder to be moved (such as a long press on the icon of the folder to be moved), the subfolders in the folder to be moved can be automatically deleted, that is, the interface of the terminal device still displays the folder to be moved but no longer displays the subfolders under the folder to be moved, such as the folder to be moved changes to a folded state; thereafter, according to FIG. 3A to FIG. 3DThe folder to be moved is moved to the target location by a similar dragging method; when the terminal device detects that the user inputs a preset operation (such as a hand-raising operation) for the folder to be moved at the target location, optionally, the terminal device can display the sub-folder icons included before the folder is moved under the folder to be moved; or, when the terminal device detects that the user inputs a preset operation (such as a hand-raising operation) for the folder to be moved at the target location, the terminal device displays the folder to be moved at the target location, but does not display the sub-folder icons included before the folder is moved. Instead, the sub-folder icons under the folder to be moved will be displayed only when the terminal device detects that the user inputs an expand operation for the folder to be moved again.
[0150] The following is an introduction to the implementation process of the folder management method provided in the embodiment of the present application when the mobile folder includes at least one subfolder in conjunction with the accompanying drawings. For ease of description, the following embodiment will be introduced by taking the merging of the "Reading" folder and the "Life" folder in the mobile phone memo list as an example.
[0151] For example, FIG. 5A to FIG. 5D As shown, it is a GUI schematic diagram that may be involved in the implementation process of some other folder management methods provided in the embodiments of the present application.
[0152] For example, Figure 5A As shown, the memo editing page includes multiple levels of folder icons. For example, the first-level folders include folder icons titled "My Notes" and "My Excerpts" respectively; the second-level folders include folder icons titled "Personal", "Work", "Life", and "Reading", as well as folder icons with third-party application names as titles, such as "Zhihu", "Toutiao", and "Weibo" folder icons, among which the "Personal" folder, "Work" folder, "Life" folder, and "Reading" folder are all subfolders in the "My Notes" folder in the first level; the "Zhihu" folder, "Toutiao" folder, and "Reading" folder are all subfolders in the "My Excerpts" folder in the first level.
[0153] It is worth noting that in Figure 5A The editing interface shown also includes a third-level folder, namely, a "Literature" subfolder and a "Social Science" subfolder included in the "Reading" folder, and both the "Literature" subfolder and the "Social Science" subfolder are in display status.
[0154] In some embodiments, Figure 5BAs shown, assuming that the user needs to move the "Reading" folder to the "Life" folder to merge the two folders, the user can enter a preset operation 501 for the "Reading" folder in the editing interface (such as long pressing the "Reading" folder icon). After the mobile phone detects that the user enters the preset operation 501 for the "Reading" folder, the "Reading" folder icon can be highlighted, and the highlight means that the "Reading" folder has been selected. At the same time, in response to the preset operation 501, the mobile phone can delete the subfolders ("Literature" folder, "Social Science" folder) included in the "Reading" folder. At this time, the "Reading" folder to be moved will be displayed, but the subfolders in the folder will no longer be displayed.
[0155] Afterwards, if FIG. 5C to FIG. 5D As shown, users can continue to long press the "Read" folder icon and follow Figure 5C Drag the folder icon in the direction of the arrow shown. The dragging action can be continued until the "Read" folder icon moves to the target location, such as Figure 5D As shown, the target position may be a position overlapping with the "Life" folder icon, and the overlapping portion is greater than a preset threshold.
[0156] Afterwards, continue as Figure 5D As shown, after the "Read" folder icon is dragged to the target location, the user can perform a preset operation 503 (such as releasing the "Read" folder icon). When the mobile phone detects that the user stops pressing the "Read" folder icon, it can display the following Figure 5E The merge completion interface shown in the figure can show the effect of dragging the "Reading" folder to the "Life" folder and merging the two. Specifically, at this time, the "Reading" folder can be changed to a subfolder of the third level, that is, the "Reading" folder is changed to a subfolder of the "Life" folder.
[0157] In some embodiments, when the user inputs an expansion operation for the moved "Reading" folder icon (such as clicking the "Reading" folder icon), the "Reading" folder can be expanded and the subfolders it includes can be displayed.
[0158] Alternatively, if Fig. 5F As shown, when the mobile phone detects that the user stops pressing the "Read" folder icon, it can also respond to this operation and directly display the subfolder icons included in the "Read" file before it was moved, so as to be consistent with the display status of the subfolders in the "Read" folder before it was moved.
[0159] According to the folder management method provided by the embodiment of the present application, by The system terminal device displays the folder to be moved, inputs a drag operation, and drags the folder to be moved to the top of the target folder to be merged. When the overlapping relationship between the folder to be moved and the target folder meets the preset conditions, the two folders can be automatically merged. This method can realize automatic merging based on the user without the user inputting cumbersome operations. The system manages folders conveniently and efficiently, which can effectively improve the user experience.
[0160] The following is a detailed introduction to the underlying implementation process of the folder management method provided in the embodiment of the present application in combination with the specific structure of the terminal device.
[0161] For example, Figure 6 The figure is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. The terminal device may correspond to the above Figure 1 and Figure 2 The terminal device 100 may include a display screen, a RecyclerView display control, a drag animation movement module (ItemTouchHelper.Callback), a drag animation callback module (ItemTouchHelper.Callback), and a data adapter (adapter).
[0162] Among them, the display screen is used to interact with the user, for example, to present a list of folders to be managed or an updated list of folders to be managed to the user; or, to receive preset operations input by the user, such as long press operations, drag operations, and hand raising operations.
[0163] The RecyclerView display control is used to receive events transmitted by the display screen, such as long press events, drag events, hand-raising events, etc. The RecyclerView display control can also be used to obtain the coordinates of the finger pressing on the display screen under different events, and pass the coordinates to ItemTouchHelper. In addition, the RecyclerView display control can also implement drag animation through ItemTouchHelper and present the drag animation through the display screen. The process can refer to the existing process, and the embodiments of this application will not be described in detail.
[0164] ItemTouchHelper.Callback is an abstract class that includes some abstract methods customized by user developers, including setting folders to be dragged in specific directions. ItemTouchHelper can implement different functions by calling callback methods in ItemTouchHelper.Callback. For example, when a user long presses a folder icon, ItemTouchHelper can call onSelectedChanged to pass the long-pressed or dragged view to the application layer. For another example, when a folder moves, ItemTouchHelper can call onMove to swap the order of two folders in the folder list. After the ItemTouchHelper.Callback module receives the selected or dragged view, it can obtain the viewholder corresponding to the view. Then, based on the position of the viewholder, a notification to update the array value is sent to the DataManager.
[0165] DataManager is used to manage data related to folders. It can generate folder list structure information corresponding to the folder list and manage the folder list structure information. Among them, the folder list structure information in the present application is used to characterize the structure of the folder list, and can be specifically used to characterize the parent-child folder relationship (or hierarchical relationship) between each folder, the folder position, etc. The folder list structure information can be used as a basis for how to display the folder list, that is, the parent-child folder relationship and the folder position between each folder in the displayed folder list need to meet the provisions in the folder list structure information. DataManage can pre-store the folder list structure information corresponding to the folder, and update the folder list structure information in real time when the parent-child folder relationship (or hierarchical relationship) changes. In addition, DataManager can also include a database, which includes the unique identification (identification, ID) value (uuid) corresponding to each folder, the folder name (display_name), the ID value of the parent folder (parent_uuid), the level of the folder (level), the indentation distance relative to the left side of the display screen, the arrangement order of the folder (user_order), etc. Optionally, the database can also include the content data of each folder, and the database can also include the subfolders included in the folder, etc.
[0166] It should be noted that the folder arrangement order (user_order) here specifically refers to the arrangement order of the folders in the hierarchy they are in. For example, assuming there are 3 folders in the first hierarchy, since these 3 folders are arranged in order in the folder list, user_order is used to indicate which folder is in the first position of the first hierarchy, which folder is in the second position of the first hierarchy, and which folder is in the third position of the first hierarchy.
[0167] It should be understood that the arrangement order here is only the arrangement order of the folders in their hierarchy, and does not represent the arrangement order in the entire folder list.
[0168] In some embodiments, the folder list structure information may be in the form of an array value. In which, taking the array value as an example, the way in which the DataManager obtains the folder list structure information may refer to Figure 7 As shown, it includes: (1) all first-level folders (the level is recorded as level(1)) can be obtained based on the folder ID stored in the database, and then the first-level folders are sorted according to the arrangement order of the folders (user_order value); (2) the subfolders contained in each first-level folder are queried, for example, a first-level parent folder includes subfolder ID1, subfolder ID2 and subfolder ID3, and the levels corresponding to these subfolders are determined to be: level(2) = level(1) + 1, and the user_order values of these subfolders are sorted; (3) in a similar manner, the children of each subfolder (the subfolders contained in the subfolder) are recursively queried, and the level of the children of these subfolders is level(3) = level(2) + 1, until the queried folder no longer includes subfolders; (5) a value group is generated according to the parent-child folder relationship between the subfolder and the parent folder and the arrangement order of the folders.
[0169] For example, Figure 3A Taking the folder shown in as an example, when obtaining the array value, first find the first-level folders according to the level corresponding to the folder, that is, the "My Notes" folder and the "My Excerpts" folder, and then sort the two folders according to the arrangement order (user_order) corresponding to the "My Notes" folder and the "My Excerpts" folder respectively. At this time, the array value can be recorded as:
[0170] {name: My Notes, level: 0, UUID: aaa, user_order: 0, parent UUID: bbb},
[0171] {name: My Summary, level: 0, UUID: aaa, user_order: 1, parent UUID: bbb}
[0172] After that, according to the hierarchy and folder parent-child relationship stored in the database, all subfolders included in the "My Notes" folder and the "My Excerpts" folder are obtained. For example, according to the folder parent-child relationship, the subfolders included in the "My Notes" folder can be queried in the database first, and the subfolders are titled "Personal", "Work", "Life", "Travel", "Exhibition", and "Reading". Then, according to the user_order values corresponding to these subfolders, the subfolders under the "My Notes" folder can be sorted. Then, according to the parent-child relationship between the folders, the array value can be recorded as:
[0173] {name: My Notes, level: 0, UUID: aaa, user_order: 0, parent UUID: bbb}
[0174] {name: personal, level: 1, UUID: xxx, user_order: 0, parent UUID: aaa}
[0175] {name: work, level: 1, UUID: xxx, user_order: 1, parent UUID: aaa}
[0176] {name:life,level:1,UUID:xxx,user_order:2,parent UUID:aaa}
[0177] {name: travel, level: 1, UUID: xxx, user_order: 3, parent UUID: aaa}
[0178] {name: exhibition, level: 1, UUID: xxx, user_order: 4, parent UUID: aaa}
[0179] {name: reading, level: 1, UUID: xxx, user_order: 5, parent UUID: aaa}
[0180] Similarly, for another "My Excerpts" folder at the first level, according to the parent-child relationship of the folders, we can first query in the database that the subfolders included in the "My Excerpts" folder are folders titled "Zhihu", "Toutiao", and "Weibo", and then according to the user_order values corresponding to these subfolders, we can sort the subfolders under the "My Excerpts" folder, and then according to the parent-child relationship between the folders, the array value can be recorded as:
[0181] {name: My Summary, level: 0, UUID: aaa, user_order: 1, parent UUID: bbb}
[0182] {name: Zhihu, level:1, UUID:xxx, user_order:0, parent UUID:aaa}
[0183] {name:Toutiao, level:1, UUID:xxx, user_order:1, parent UUID:aaa}
[0184] {name: Weibo, level: 1, UUID: xxx, user_order: 2, parent UUID: aaa}
[0185] It should be understood that the form of the array value given here is only an example. In actual applications, the form of the array value can also be expressed as: {My Notes [Personal, Work, Life, Travel, Exhibition, Reading], My Excerpts [Zhihu, Toutiao, Weibo]} or, {My Notes: Personal, Work, Life, Travel, Exhibition, Reading; My Excerpts: Zhihu, Toutiao, Weibo}, etc., and the embodiments of this application do not limit this. Among them, in the above example {My Notes: Personal, Work, Life, Travel, Exhibition, Reading; My Excerpts: Zhihu, Toutiao, Weibo}, the folders separated by semicolons and located before the colon are folders of the first level; in each folder separated by semicolons, the folder after the colon is a subfolder in the folder before the colon, and each folder separated by commas is a folder of the same level.
[0186] In some embodiments, the DataManager may respond to the notification of updating the array value, determine the selected folder according to the position of the viewholder, and update the parent-child folder relationship corresponding to the folder and the change of the folder position in the array value. Afterwards, the DataManager may send the updated array value and the corresponding folder data content to the adapter.
[0187] After receiving the updated data, the adapter can update the folder list based on the array value. The update may include, for example, adjusting the position of the selected folder according to the parent-child folder relationship and the position of each folder indicated by the array value, and filling the folder content. Afterwards, the adapter can instruct the RecyclerView display control to refresh the displayed content and update the displayed content of the display control. The RecyclerView display control can display the updated folder list on the display screen.
[0188] For example, Figure 8 FIG. 1 is a schematic flow chart of a method for managing folders provided in an embodiment of the present application. The flow chart includes the following steps:
[0189] S801, the display screen receives a long press operation input by the user.
[0190] In some embodiments, when a user needs to move an item in an item list to change its position, the user can input a long press operation on the item to be moved by using a finger. Specifically, the long press operation here can be an operation input by the user on the icon of the item to be moved in the item list displayed on the display screen. The long press operation corresponds to, for example, Figure 3A Operation 301 in , or corresponding to Figure 4A Operation 401 in , or corresponding to Figure 5A Operation 501 in the embodiment of the present application. It should be understood that the item in the embodiment of the present application can be a customary name, and an item can be regarded as a view. Specifically, the item in the present application can be a folder introduced above, but it can also be other types of items, and the embodiment of the present application does not limit this. For ease of understanding, the following description takes the example of item being a folder.
[0191] It should be understood that the long press operation performed by the user's finger introduced above in this application is only an exemplary operation for selecting a folder to be moved. In actual applications, the long press operation can also be performed by other means such as a stylus, mouse, etc., and the embodiments of this application are not limited to this.
[0192] S802, the display screen transmits a long press event to the recycler view display control (RecyclerView).
[0193] In some embodiments, after the display screen receives a long press operation input by the user for the folder to be moved, the display screen can transmit a corresponding long press event to the RecyclerView in response to the long press operation.
[0194] It should be understood that RecyclerView is a container that provides a fixed view for a limited window to display a data set. RecyclerView can display data in list form (list) or grid form (grid), such as text or photos. In the folder management method provided in the embodiment of the present application, the flexible display of folder list data is mainly achieved through RecyclerView. In some embodiments, RecyclerView can be used to provide default table item animations and custom animation entrances. For example, the folder drag animation can be implemented with the help of RecyclerView's ItemTouchHelper. During the use of RecyclerView, the data adapter needs to be loaded. RecyclerView can learn about data changes through the data adapter, thereby performing the operation of refreshing the folder list.
[0195] S803, RecyclerView receives a long press event and determines the coordinates (X0, Y0) corresponding to the long press event.
[0196] The coordinate (X0, Y0) may refer to the coordinate corresponding to the position where the user's finger is pressed in the long press event, and the coordinate position may correspond to the icon position of the folder to be moved. The coordinate system where the coordinate (X0, Y0) is located may be pre-set as needed, wherein the direction of the X-axis in the coordinate system may be parallel to the top or bottom edge of the terminal device, and the direction of the Y-axis in the coordinate system may be parallel to the left or right edge of the terminal device. Exemplarily, the coordinate (X0, Y0) in this step may correspond to Figure 3A The coordinates corresponding to the position pressed in operation 301 shown in the figure may correspond to Figure 4A The coordinates corresponding to the position pressed in operation 401 shown, or may correspond to Figure 5B The coordinates corresponding to the position pressed by the operation 501 are shown.
[0197] S804, the RecyclerView display control transmits the coordinates (X0, Y0) corresponding to the long press event to the ItemTouchHelper module.
[0198] Among them, the ItemTouchHelper module mentioned in the embodiment of the present application is an abstract module divided for executing ItemTouchHelper. ItemTouchHelper is a tool class, which is mainly used to expand the long press event of the folder in the RecyclerView display control, and can also be used to provide operations such as adding drag sorting and sliding deletion to the RecyclerView display control.
[0199] S805, the ItemTouchHelper module obtains the pressed view.
[0200] In some embodiments, the ItemTouchHelper module can obtain the coordinates (X0, Y0) of the motionEvent by monitoring the touch time of the system. The coordinates of the motionEvent are also the finger pressing coordinates; then, through the motionEvent, according to the finger pressing coordinates (X0, Y0), the corresponding view is found. Different views correspond to different viewHolders, and different viewHolders correspond to different positions.
[0201] S806, the ItemTouchHelper module calls onSelectedChange to pass the viewholder corresponding to the pressed view to the drag animation callback module (ItemTouchHelper.Callback).
[0202] It should be understood that OnSelectedChange is a callback method registered in ItemTouchHelper by ItemTouchHelper.Callback of the application framework layer. In some embodiments, after the ItemTouchHelper module obtains the viewholder, it can return the viewholder corresponding to the pressed view to the ItemTouchHelper.Callback of the application layer by calling the onSelectedChange method of ItemTouchHelper.Callback.
[0203] S807, the drag animation callback module (ItemTouchHelper.Callback) passes the viewholder to the data management module (DataManager).
[0204] In some embodiments, ItemTouchHelper.Callback receives the viewholder corresponding to the selected folder through onSelectChange. After ItemTouchHelper.Callback obtains the viewholder, it can obtain the position corresponding to the viewholder by calling getposition.
[0205] In some embodiments, ItemTouchHelper.Callback can pass the position corresponding to the viewholder to the DataManager of the application layer, so that the DataManager determines the selected folder according to the position of the viewholder. In addition, ItemTouchHelper.Callback can also notify the DataManager to delete the subfolders included in the selected folder.
[0206] S808, DataManager deletes the subfolders of the selected folder in the array value representing the parent-child relationship of the folder according to the position of the viewholder.
[0207] In some embodiments, after DataManager receives the viewholder, it can determine the selected folder according to the position of the viewholder, and determine whether the selected folder includes subfolders. Specifically, the process of DataManager determining the selected folder may include: after ItemTouchHelper.Callback obtains the position of the viewholder, it calls the getAdapterPosition method through RecyclerView to query the folder corresponding to the position of the viewholder from the adapter, thereby obtaining the selected folder. Among them, the adapter includes the location information corresponding to different folders. The selected folder here is the folder to be moved or the folder to be dragged.
[0208] In some embodiments, after the DataManager obtains the selected folder, it can obtain the parent-child folder relationship of the folder according to the folder list structure information stored by the DataManager, and determine whether the selected folder includes subfolders. If the selected folder includes subfolders, the DataManager can delete the subfolders under the folder in the folder list structure information and obtain the updated array value. The updated folder list structure information still includes the selected folder, but no longer includes the subfolders it includes.
[0209] It should be noted that the folder list structure information in the present application can be used to characterize the structure of the folder list, and specifically can be used to characterize the parent-child folder relationship (or hierarchical relationship) between each folder, the folder level, the folder location and the folder arrangement order, etc. DataManage can pre-store the folder list structure information corresponding to the folder, and update the folder list structure information in real time when the parent-child folder relationship (or hierarchical relationship) changes. In some implementations, the folder list structure information can be specifically embodied in the form of an array value, but can also be expressed in any other form that can characterize the folder list structure, such as a tree form, etc., which is not limited in the embodiments of the present application.
[0210] It should also be understood that the folder structure information may only include information for characterizing the folder list structure, but does not need to include specific content data in each folder. When specific content data in a folder is needed, it can be obtained from the database of the DataManager.
[0211] In some embodiments, taking the folder structure information as an array value as an example, the way DataManager obtains the array value may include: first obtaining all folders of the first level, and sorting them according to the user order (user_order) of the folders; then recursively obtaining the subfolders under each first-level folder, and sorting the subfolders included in each first-level parent folder according to user_order. Exemplarily, the array value may include multiple pieces of information of each folder, such as: file name, level, UUID, folder arrangement order (user_order) and parent folder ID (parent UUID), etc. For example, taking the first-level "My Notes" folder as an example, its corresponding array value data can be expressed as {name: My Notes, level: 0, UUID: aaa, user_order: 0, parent UUID: bbb}, where name represents the folder name; level is 0, indicating that the "My Notes Folder" is at the first level; UUID is the Key unique ID of the "My Notes" folder; user_order is 0, indicating that the "My Notes" folder is ranked first in the first level; parent UUID represents the parent folder ID corresponding to the "My Notes" folder. Since "My Notes" is at the first level and has no corresponding parent folder, the bbb here can indicate that there is no parent folder ID.
[0212] It should be noted that the display order of each folder in the folder list can be determined according to the folder name, the user_order of the folder, and the parent folder ID to which the folder belongs included in the array value. The indentation value corresponding to the folder can be determined according to the folder level included in the array value. Among them, different levels correspond to different indentation values, and the indentation value here can be the distance between the left edge of the folder icon and the left edge of the display screen. Exemplarily, as the level increases, the indentation value can increase accordingly.
[0213] It is worth noting that, taking the folder list structure information as an array value as an example, in the folder management method provided in the embodiment of the present application, the array value of the folder can be used as a basis for how to display the folder list. Specifically, when displaying the contents of the folder list, the adapter determines the order of each folder in the folder list according to the folder name, level, UUID, order of folder arrangement, parent folder ID, etc. included in the array value. In addition, the adapter can determine the indentation value corresponding to the folder by recursively calling the level value of the algorithm. For example, when displaying the folder list, the adapter can first traverse the first-level folders in the array value, that is, traverse the folders with level 0. Since the level is 0, it can be identified as the parent folder under the root directory, and the parent folder is displayed according to the indentation value corresponding to level 0; afterwards, the adapter can traverse the second-level folders in the array value, that is, traverse the folders with level 1. Since the level is 1, it can be identified as a subfolder, and these subfolders can be indented and displayed according to the indentation distance corresponding to level 1.
[0214] When the user drags the selected folder to move its position, DataManager will update the array value, so that the information related to the selected folder in the array value stored by DataManager will also change accordingly. Specifically, the position of the numerical value corresponding to the selected folder in the array value will also change accordingly; after that, the updated array value will serve as a new basis for guiding how to display the folder list, so that the folder list presented to the user will also be updated accordingly.
[0215] by Fig.9A Take the folder list shown as an example. Before dragging the folder, the array value may be as follows:
[0216] {name: My Notes, level: 0, UUID: aaa1, user_order: 0, parent UUID: bbb},
[0217] {name:life,level:1,UUID:xxx1,user_order:0,parent UUID:aaa1}
[0218] {name: travel, level: 1, UUID: xxx2, user_order: 1, parent UUID: aaa1}
[0219] Afterwards, suppose the user drags the "Travel" folder above the "Life" folder, that is, the "Travel" folder and the "Life" folder exchange positions, then the array value is also updated accordingly, and the updated array value can be as follows:
[0220] {name: My Notes, level: 0, UUID: aaa1, user_order: 0, parent UUID: bbb},
[0221] {name: travel, level: 1, UUID: xxx2, user_order: 0, parent UUID: aaa1}
[0222] {name:life,level:1,UUID:xxx1,user_order:1,parent UUID:aaa1}
[0223] When the dragged folder list is displayed, each folder can be displayed according to the updated array value.
[0224] by Fig. 9B Take the folder list shown as an example. Before dragging the folder, the array value may be as follows:
[0225] {name: My Notes, level: 0, UUID: aaa1, user_order: 0, parent UUID: bbb},
[0226] {name: travel, level: 1, UUID: xxx2, user_order: 0, parent UUID: aaa1}
[0227] {name:life,level:1,UUID:xxx1,user_order:1,parent UUID:aaa1}
[0228] {name: My Excerpt, level: 0, UUID: aaa2, user_order: 1, parent UUID: bbb}
[0229] Afterwards, assuming that the user drags the "Travel" folder above the "My Excerpts" folder, that is, drags the "Travel" folder to the same level as the "My Notes" folder, then the array value is also updated accordingly, and the updated array value can be as follows:
[0230] {name: My Notes, level: 0, UUID: aaa1, user_order: 0, parent UUID: bbb},
[0231] {name:life,level:1,UUID:xxx1,user_order:0,parent UUID:aaa1}
[0232] {name: travel, level: 0, UUID: xxx2, user_order: 1, parent UUID: bbb}
[0233] {name: My Excerpt, level: 0, UUID: aaa2, user_order: 2, parent UUID: bbb}
[0234] At this time, the level of the "Travel" folder changes to 0, indicating that it is changed to the first level; the user_order changes to 1, indicating that it is ranked second in the first level; the parent UUID changes to bbb, indicating that it does not have a parent folder. Correspondingly, the user_order of the "My Excerpts" folder, which was originally ranked second in the first level, changes to 2, indicating that it is ranked third in the first level.
[0235] When the dragged folder list is displayed, each folder can be displayed according to the updated array value.
[0236] It should be understood that by introducing array values as the basis for displaying the folder list, when the folder changes (such as the relationship between parent-child folders changes or the folder location changes), the folder list displayed on the interface can be adjusted accordingly in real time based only on the array values updated in real time, without having to search for relevant information of the selected folder from a large amount of data in the database and then update the displayed folder list, thereby improving the timeliness and flexibility of folder management.
[0237] In some embodiments, the DataManager may further include a database storing folder data, which may include a universally unique identifier (UUID) of the folder, a folder name (display_name), an ID value of a parent folder corresponding to the folder (parent_name), a folder level (level), an arrangement order of the folder (user_order), etc. Exemplarily, an exemplary folder data stored in the database may be as shown in Table 1 below:
[0238] Table 1
[0239]
[0240] Each folder data may include the above information, so after determining the selected folder, especially after obtaining the name of the selected folder, the ID value of the parent folder of the folder can be found according to the data recorded in the database, and then the name of the parent folder can be found to find the corresponding relationship.
[0241] In some embodiments, the DataManager may obtain an array value representing the parent-child relationship of each folder based on information in the database.
[0242] S809, the data management module (DataManger) transmits the updated array value to the data adapter module (adapter).
[0243] In some embodiments, the DataManager may send the array value corresponding to the subfolder after deletion to a data adapter module (adapter).
[0244] In some embodiments, after the adapter obtains the updated array value, it can obtain the updated folder parent-child relationship, folder location, etc. based on the updated array value, and make corresponding adjustments to the folders in the list, and fill the folder data content that meets the updated array value into the corresponding position in the folder list.
[0245] S810, the data adapter module (adapter) notifies the RecyclerView display control to update the list display.
[0246] It should be understood that when the folder data changes, the adapter can notify the RecyclerView display control of the data change, so that the RecyclerView display control refreshes the folder list according to the changed data, thereby displaying the updated folder list on the display screen.
[0247] S811, the display screen receives a drag operation input by a user.
[0248] The drag operation may be a drag operation input by the user through a finger on the icon of the folder to be moved. Figure 3C Operation 303 shown may correspond to Figure 4B Operation 403 shown, or may correspond to Figure 5D Operation 503 is shown.
[0249] S812: The display screen transmits the drag event to the RecyclerView display control.
[0250] In some embodiments, after receiving a drag operation input by a user for a folder to be moved, the display screen may transmit a corresponding drag event to the RecyclerView display control in response to the drag operation.
[0251] S813, the RecyclerView display control receives the drag event and determines the coordinates (x, y) corresponding to the drag event.
[0252] In some embodiments, the coordinate (x, y) may refer to the coordinate corresponding to the position where the user's finger is pressed during the dragging process. Since the dragging event is generally a continuous process, there may be multiple coordinates (x, y).
[0253] S814, the RecyclerView display control transmits the coordinates (x, y) corresponding to the drag event to the ItemTouchHelper module.
[0254] S815, the ItemTouchHelper module moves the position of the dragged view according to the coordinates (x, y).
[0255] In some embodiments, the ItemTouchHelper module can determine the position of the dragged view in the current display screen according to the coordinates (x, y).
[0256] In some embodiments, the ItemTouchHelper module can also determine the target view to be exchanged during the dragging process according to the coordinates (x, y).
[0257] S816, the ItemTouchHelper module calls onMove to pass the viewholder corresponding to the moved view and the viewholder corresponding to the swapped view.
[0258] It should be understood that different views displayed in the display screen may correspond to different viewholders. In some embodiments, after the ItemTouchHelper module receives the position of the dragged view, it may call onMove to pass the viewholder corresponding to the dragged view to the ItemTouchHelper.Callback of the application layer.
[0259] In some embodiments, the ItemTouchHelper module may also determine the target viewholder to be exchanged according to the target view to be exchanged, and may transfer the target viewholder to be exchanged to the ItemTouchHelper.Callback of the application layer by calling onMove.
[0260] It should be noted that the view being exchanged here can correspond to the folder being exchanged. Specifically, when the folder to be moved is dragged, the folder to be moved needs to pass through at least one intermediate folder from its initial position to reach the target position. Whenever the position of the moving folder is dragged above a certain intermediate folder and the overlap with the intermediate folder is greater than a preset value, the position of the folder to be moved can be exchanged with the position of the intermediate folder, so that the position of the folder to be moved is closer to the target position. At this time, the intermediate folder is the exchanged folder.
[0261] S817, the ItemTouchHelper.Callback module obtains the positions of the dragged viewholder and the swapped viewholder in the folder list.
[0262] In some embodiments, the ItemTouchHelper.Callback module can call getposition to obtain the position of the dragged viewholder and the position of the swapped viewholder.
[0263] S818, the ItemTouchHelper.Callback module sends the position of the dragged viewholderder and the position of the swapped viewholder to the DataManger module.
[0264] S819, the DataManger module exchanges the dragged folder and the exchanged folder in the array value according to the position of the dragged viewholder and the position of the exchanged viewholder.
[0265] In some embodiments, after the DataManager receives the dragged viewholder, it can determine the dragged folder according to the position of the dragged viewholder, and after the DataManager receives the swapped viewholder, it can determine the swapped folder according to the position of the swapped viewholder. Specifically, the process of DataManager determining the corresponding folder according to the position of the viewholder may include: after ItemTouchHelper.Callback obtains the position of the dragged viewholder, RecyclerView calls the getAdapterPosition method to query the folder corresponding to the position from the adapter. If the position of the viewholder overlaps with a certain intermediate folder position, and the overlapping part is greater than a preset value, then the intermediate folder is determined to be the swapped folder.
[0266] Afterwards, the DataManager module can swap the position of the dragged folder with the position of the swapped folder in the array value.
[0267] S820, the DataManager module transmits the updated array value to the data adapter module (adapter).
[0268] The updated array value refers to the array value after the dragged folder and the swapped folder are swapped.
[0269] In some embodiments, after receiving the updated array value, the adapter can generate updated folder list content according to the parent-child folder relationship indicated by the array value, in which the position of the dragged folder is exchanged with the position of the swapped folder.
[0270] S821, Aadapter notifies the RecyclerView display control to update the list display.
[0271] In some embodiments, after the adapter generates updated folder list content, it instructs the RecyclerView display control to refresh and display a new folder list after the dragged folder and the swapped folder are swapped.
[0272] S822, the display screen receives a hand-raising operation input by the user.
[0273] In some embodiments, after the user moves the dragged folder to the target location, the user can stop the long press operation on the folder icon, and the user can then perform a hand-raising operation.
[0274] S823, the display screen transmits the hand raising event to the RecyclerView display control.
[0275] In some embodiments, after the display screen receives a hand-raising operation input by the user for a folder to be moved, the display screen can transmit a corresponding hand-raising event to the RecyclerView display control in response to the hand-raising operation.
[0276] In some embodiments, the hand-raising event can trigger the RecyclerView display control to call the onChildDraw system method to determine whether to merge folders based on the position of the dragged folder relative to the target folder. Exemplarily, the RecyclerView display control can call the onChildDraw system method to obtain the height of the currently dragged folder and the offset relative to the previous or next folder adjacent to it. It should be understood that the offset can be used to indicate the position of the folder after it is dragged, and can be used to obtain the overlapping part of the folder with the previous or next folder after it is dragged, wherein, if the overlapping part is greater than the first ratio, then the currently dragged folder and the corresponding folder can be merged, and if the overlapping part is less than the first ratio, then the currently dragged folder and the folder at the target location can be swapped.
[0277] S824, the RecyclerView display control receives the hand-raising event and determines the coordinates (X', Y') corresponding to the hand-raising event.
[0278] The coordinates (X', Y') may refer to the coordinates corresponding to when the user performs a hand-raising operation, and the coordinate position may correspond to the target position, that is, the destination position to which the folder needs to be moved.
[0279] S825, the RecyclerView display control transmits the coordinates (X', Y') corresponding to the hand raising event to the ItemTouchHelper module.
[0280] S826, the ItemTouchHelper module determines the target view according to the coordinates (X', Y').
[0281] The target view here refers to the view corresponding to the location of the dragged folder when the user raises his hand, that is, the view corresponding to the folder to be moved when the dragging process ends.
[0282] S827, the ItemTouchHelper module passes the target viewholder to the ItemTouchHelper.Callback module.
[0283] In some embodiments, the ItemTouchHelper module can call the clearView callback method in ItemTouchHelper.callback in response to the hand-raising event to determine into which parent folder the dragged folder is moved, that is, to determine the target position of the dragged folder. Exemplary methods for determining the position of the dragged folder may include: determining into which parent folder the dragged folder is moved according to the moving position of the current dragged folder, and the levels of the previous folder (recorded as folder A) and the next folder (recorded as folder B) adjacent to the dragged folder in the folder list. Specifically, it can be divided into the following situations:
[0284] 1. If the next folder B adjacent to the dragged folder is a subfolder of the previous folder A, then the dragged folder is moved into folder A, that is, folder A is set to be the parent folder of the dragged folder.
[0285] 2. If the level of the previous folder A adjacent to the dragged folder is larger than the level of the next folder B, then:
[0286] (1) If the dragged folder is at a higher level than the previous folder A, the dragged folder will be placed at the same level as the previous folder A, that is, the moved folder and folder A are at the same level;
[0287] (2) If the level of the dragged folder is the same as or lower than the level of the next folder B, the dragged folder will be placed in the same directory level as the next folder B, that is, the moved folder and folder B belong to the same level.
[0288] 3. If the previous folder A and the next folder B are at the same level, the dragged folder will be placed in the same directory level as the previous folder, that is, the moved folder will be at the same level as folder A and folder B.
[0289] 4. If there is a blank area below the dragged folder after it is moved to the target location (that is, there are no other folders), then the dragged folder will be placed in the root directory, that is, the dragged folder belongs to the first level.
[0290] In some embodiments, when the user raises his hand, ItemTouchHelper can also call the onChildDraw callback method in ItemTouchHelper.Callback in response to the hand raising event to determine whether to merge the folders. Exemplary, the method of determining whether to merge the folders can include: when the user raises his hand after dragging, the offset of the dragged folder in the Y-axis direction (dy value) is judged according to the callback. The offset of the folder after being dragged relative to the height of the previous or next folder adjacent to it, and the overlapping part of the dragged folder and the previous or next folder can be obtained according to the offset. When the overlapping part of the dragged folder and the previous or next folder is greater than the first ratio (such as the overlap is greater than 75%), it can be determined that the folder is merged. Optionally, it is also possible to obtain whether the target folder to be merged is the previous folder or the next folder based on the location of the current folder and the direction of the drag gesture. After determining the parent folder, the parent folder of the dragged folder can be pointed to as the target folder, so that it is convenient to place it under the target folder later.
[0291] It should be noted that the Y-axis direction here may refer to a direction parallel to the left or right edge of the mobile phone.
[0292] S828, the ItemTouchHelper.Callback module obtains the position of the target viewholder in the folder list.
[0293] S829, the ItemTouchHelper.Callback module sends the location of the target viewholder to the DataManager.
[0294] S830, DataManager calculates the parent folder to which the corresponding folder belongs according to the position of the target viewholder, and updates the array value.
[0295] In some embodiments, after the DataManager receives the position of the target viewholder, it can query the position of the folder list corresponding to the dragged folder based on the position of the viewholder, and then update the folder ID of the target position with the parent folder ID value of the currently dragged folder, and reset the user_order of the folder list according to the target position after dragging, and update the folder database.
[0296] Afterwards, DataManager can re-acquire the folder list data content from the folder database through recursive calls, and pass the folder list data content to the adapter, which generates the folder list content to be displayed.
[0297] S831, DataManger passes the updated array value to the adapter.
[0298] Among them, the updated array value in this step can refer to the array value corresponding to the folder to be moved after being dragged to the target location. The updated array value can be used to represent the new parent-child folder relationship, the location of each folder, etc. after the folder is dragged.
[0299] In this step, DataManager may also pass updated folder list data content to the adapter.
[0300] In some embodiments, after the adapter obtains the updated array value, it can obtain the updated folder list structure according to the updated array value, such as the folder parent-child relationship, folder location, folder title, etc. The adapter can also select the data content corresponding to the folder to be displayed according to the received folder list data content, and fill the content into the corresponding position of the folder list.
[0301] In some embodiments, the DataManager may also pass the data contents corresponding to the subfolders of the dragged folder to the adapter. The adapter may generate the subfolder contents corresponding to the dragged folder based on the data contents corresponding to the subfolders, so as to display the subfolders included in the dragged folder at the target location.
[0302] S832, the data adapter module (adapter) notifies the RecyclerView display control to update the list display.
[0303] In some embodiments, after the RecyclerView display control updates the list display, it can display to the user a list of folders that have arrived at the target location after the folder to be moved is dragged.
[0304] According to the folder management method provided by the embodiment of the present application, by The system terminal device presents a folder to be moved by inputting a drag operation, and dragging the selected folder to the target location to achieve the folder moving effect. In addition, when it is necessary to merge folders, by dragging the selected folder to the top of the target folder to be merged, and making the overlapping relationship between the selected folder and the target folder meet the preset conditions, the two folders can be automatically merged. This method can achieve automatic merging based on the user without the user inputting cumbersome operations. The system manages folders conveniently and efficiently, which can effectively improve the user experience.
[0305] For example, Fig.10 FIG. 1 is a schematic flow chart of another method for managing folders provided in an embodiment of the present application. The method can be executed by a terminal device as a main body, and specifically can include the following steps:
[0306] S1001, receiving a long press operation.
[0307] The long press operation is an operation inputted to the icon of the folder to be moved in the folder list, and the long pressed folder may be described as the folder to be moved or the selected folder.
[0308] S1002, determining whether the selected folder supports moving.
[0309] When the selected folder supports moving, step S1003 is executed.
[0310] When the selected folder does not support moving, a prompt message may be displayed to indicate that the currently selected folder does not support moving.
[0311] S1003, determining whether the selected folder has any subfolders.
[0312] When the selected folder has subfolders, that is, when the judgment result is "yes", step S1004 is executed; when the selected folder has no subfolders, that is, when the judgment result is "no", step S1005 is executed.
[0313] S1004, remove the subfolder.
[0314] Removing subfolders in this step refers to deleting subfolders of the selected folder in the file list structure information. Afterwards, an updated folder list can be displayed according to the updated folder list structure information, and the updated folder list does not include the deleted subfolders.
[0315] S1005, drag the selected folder.
[0316] The method of dragging folders can be found above. Figure 3B and Figure 3C as shown, or Figure 4B and Figure 4C as shown, or Figure 5C and Figure 5D shown.
[0317] S1006, swapping the positions of two folders, and recording the positions corresponding to the dragging operation.
[0318] In some embodiments, during the dragging process, the selected folders and the intermediate folders may be exchanged in pairs according to the dragging position.
[0319] S1007, a hand raising operation is detected.
[0320] Among them, when the hand-raising operation is detected, it means that the folder dragging is completed.
[0321] S1008: Determine whether to merge folders or move folders according to the drag height and the relative offset.
[0322] In some embodiments, when a hand-raising operation is detected, the drag height of the selected folder can be obtained, and the target position of the currently selected folder can be obtained according to the drag height. According to the offset of the target position relative to the adjacent folder, it is determined whether to merge the folder or move the folder, wherein, if the overlap between the selected folder and the adjacent folder is greater than or equal to a first ratio (such as 75%) according to the offset, it means that the selected folder should be merged with the folder; if the overlap between the selected folder and the adjacent folder is less than a ratio according to the offset, it means that the selected folder should be moved to a position adjacent to the adjacent folder, and the two are at the same level without merging. In addition, it can also be determined according to the drag direction whether to merge the selected folder with the previous folder, or to merge the selected folder with the next folder, or to only move the selected folder without merging. For example, when the drag direction is upward, and after being dragged, the overlap between the selected folder and the previous folder adjacent to it is greater than or equal to the first ratio, it can be determined that the selected folder is merged with the previous folder.
[0323] S1009, calculating the target folder.
[0324] In some embodiments, when the dragged folder and its adjacent folder need to be merged, the position of the target folder to be merged with the selected folder is calculated, and information such as the target folder ID can be further obtained based on the position of the target folder.
[0325] S1010, determining whether a folder with the same name already exists under the target folder.
[0326] In some embodiments, it is possible to search the folder list structure information or the database based on the target folder ID to see whether a subfolder with the same name as the selected folder is included.
[0327] When the target folder includes a folder with the same name as the selected folder, step S1014 below can be executed. When the target folder does not include a folder with the same name as the selected folder, step S1011 below can be executed.
[0328] S1011, updating the parent folder of the selected folder as the target folder.
[0329] In some embodiments, when the target folder does not include a folder with the same name as the selected folder, that is, the selected folder can be successfully merged with the target folder, at this time, the parent folder corresponding to the selected folder in the folder list structure information can be modified to the target folder. At the same time, the position corresponding to the selected folder in the folder list structure information can also be modified.
[0330] S1012, update user_order and database.
[0331] In some embodiments, after the selected folder is successfully moved to the target location or merged with the target folder, the user_order corresponding to the selected folder in the folder list structure information can be updated, and the information of the selected folder in the database can be updated to make the folder information consistent with the updated folder list. In a possible implementation, the arrangement order of the folders can correspond to the user_order of the folders, which can be the arrangement order of the folders in the level in which they are located. For example, assuming that there are 3 folders in the first level, since these 3 folders are arranged in order in the folder list, user_order is used to represent which one is in the first position of the first level, which one is in the second position of the first level, and which one is in the third position of the first level.
[0332] It should be understood that the arrangement order here is only the arrangement order of the folders in their hierarchy, and does not represent the arrangement order in the entire folder list.
[0333] S1013, refresh the folder list display.
[0334] S1014, move failed, refresh the folder list to restore to the original interface style.
[0335] According to the folder management method provided by the embodiment of the present application, by The system terminal device presents a folder to be moved by inputting a drag operation, and dragging the selected folder to the target location to achieve the folder moving effect. In addition, when it is necessary to merge folders, by dragging the selected folder to the top of the target folder to be merged, and making the overlapping relationship between the selected folder and the target folder meet the preset conditions, the two folders can be automatically merged. This method can achieve automatic merging based on the user without the user inputting cumbersome operations. The system manages folders conveniently and efficiently, which can effectively improve the user experience.
[0336] For example, Fig.11FIG. 1 is a schematic flow chart of another method for managing folders provided in an embodiment of the present application. The method can be executed by a terminal device as a main body, and specifically can include the following steps:
[0337] S1101, in response to a long press operation input by a user on a first folder icon in a first folder list, displaying a first interface, the first interface including a first folder icon in a selected state.
[0338] In some embodiments, the first interface is displayed in response to a long press operation input by the user on the first folder icon in the first folder list, specifically including: in response to a long press operation input by the user on the first folder icon in the first folder list, determining the first coordinates corresponding to the long press operation; determining the first folder according to the first coordinates, the position of the first folder corresponding to the first coordinates; setting the first folder icon to a selected state, and displaying the first interface.
[0339] In some embodiments, when the first folder includes sub-folders, the displaying of the first interface in response to a long press operation input by the user on the first folder icon in the first folder list also includes: in response to a long press operation input by the user on the first folder icon in the first folder list, deleting the information corresponding to the sub-folders of the first folder in the preset folder list structure information, and obtaining the second folder list structure information; displaying the first interface according to the second folder structure information, the first interface including the first folder icon in a selected state, and not displaying the sub-folders included in the first folder.
[0340] S1102, receiving a drag operation input by a user for a first folder icon, and displaying a second interface in response to the drag operation, where the second interface includes a position change of the first folder icon during the dragging process.
[0341] In some embodiments, receiving a drag operation input by a user for the first folder icon, and determining the position of the first folder icon during the movement in response to the drag operation, may specifically include: receiving a drag operation input by a user for the first folder icon; determining at least one second coordinate corresponding to the drag operation; and determining at least one position of the current first folder during the movement based on the at least one second coordinate.
[0342] In some embodiments, the method further includes: displaying a position change of the first folder icon during the dragging process according to at least one position of the first folder during the moving process.
[0343] S1103, when the dragging ends, in response to the hand-raising operation input by the user, the target position of the first folder is determined according to the dragging height and the offset of the first folder relative to the target folder after being dragged, and the target position is inside the target folder or adjacent to the target folder.
[0344] In some embodiments, the target folder includes a second target folder and / or a third folder, and the method further includes: when the dragging ends, in response to a hand-raising operation input by the user, determining the second folder and / or the third folder adjacent to the first folder icon according to the drag height, wherein the second folder is an adjacent folder located above the first folder icon, and the third folder is an adjacent folder located below the first folder icon; determining whether to merge folders according to an offset of the first folder relative to the target folder after the first folder is dragged; wherein, when it is determined according to the offset that the overlapping portion of the first folder and the second folder is greater than or equal to a first ratio, merging the first folder and the second folder ; When it is determined according to the offset that the overlapping portion of the first folder and the second folder is less than the first ratio, the first folder and the second folder are not merged; when it is determined according to the offset that the overlapping portion of the first folder and the third folder is greater than or equal to the first ratio, the first folder and the third folder are merged; when it is determined according to the offset that the overlapping portion of the first folder and the third folder is less than the first ratio, the first folder and the third folder are not merged; when it is determined according to the offset that the overlapping portions of the first folder, the second folder and the third folder are all less than the first ratio, the first folder icon is moved between the second folder icon and the third folder icon.
[0345] In some embodiments, determining whether to merge folders based on the offset of the first folder relative to the target folder after being dragged specifically includes: determining whether to merge folders based on the offset of the first folder relative to the target folder after being dragged and the dragging direction.
[0346] In some embodiments, determining whether to merge folders based on the offset of the first folder relative to the target folder after being dragged and the dragging direction specifically includes: when it is determined according to the offset that the overlapping portion of the first folder and the second folder is greater than or equal to a first ratio, and the direction of the drag operation is upward, merging the first folder and the second folder; when it is determined according to the offset that the overlapping portion of the first folder and the second folder is greater than or equal to the first ratio, and the direction of the drag operation is downward, moving the first folder icon to the bottom of the second folder icon; when it is determined according to the offset that the overlapping portion of the first folder and the third folder is greater than or equal to the first ratio, and the direction of the drag operation is downward, merging the first folder and the third folder; when it is determined according to the offset that the overlapping portion of the first folder and the third folder is greater than or equal to the first ratio, and the direction of the drag operation is upward, moving the first folder icon to the top of the second folder icon.
[0347] S1104, updating the preset folder list structure information according to the target position of the first folder, and obtaining the first folder list structure information, the first folder list structure information is used to indicate the ID, level, ID of the parent folder to which each folder belongs, and the folder arrangement order of each folder in the first folder list after dragging is completed.
[0348] In some embodiments, the folder list structure information is an array value, and the array value includes the ID of the folder corresponding to each folder included in the folder list, the level at which it is located, the ID of the parent folder to which it belongs, and the arrangement order of the folders. The updating of the preset folder list structure information may include: modifying the position corresponding to the first folder in the array value according to the target position after the first folder is dragged, so that the position of the first folder in the array value is consistent with the position of the first folder in the folder list after the first folder is dragged; and, modifying the arrangement order of the folders corresponding to the first folder in the array value, so that the arrangement order of the folders corresponding to the first folder is consistent with the arrangement order in the folder list after the first folder is dragged; and, modifying the level corresponding to the first folder in the array value, so that the level corresponding to the first folder is consistent with the level in the folder list after the first folder is dragged; and, modifying the ID of the parent folder corresponding to the first folder in the array value, so that the ID of the parent folder corresponding to the first folder is consistent with the ID of the parent folder in the folder list after the first folder is dragged.
[0349] It should be noted that the arrangement order of folders may correspond to the user_order of folders, which may specifically refer to the arrangement order of folders in the hierarchy in which they are located. For example, assuming there are 3 folders in the first hierarchy, since these 3 folders are arranged in order in the folder list, user_order is used to indicate which one is in the first position of the first hierarchy, which one is in the second position of the first hierarchy, and which one is in the third position of the first hierarchy.
[0350] It should be understood that the arrangement order here is only the arrangement order of the folders in their hierarchy, and does not represent the arrangement order in the entire folder list.
[0351] In some embodiments, the method of obtaining folder structure information may include: generating the folder structure information according to the information of each folder in the first folder list recorded in the database, wherein the information of each folder includes the folder ID, the level at which it is located, the parent-child relationship of the folder, and the arrangement order. Among them, generating the folder structure information according to the information of each folder in the first folder list recorded in the database may specifically include: obtaining the folders in the first level of the first folder list according to the level at which the folder is located; traversing and querying the subfolders included in each folder of the first level to obtain the corresponding folders of the second level; recursively querying the subfolders included in the folder of the second level to obtain the corresponding folders of the third level; repeating the above-mentioned recursive query of subfolders until the queried folder of a certain level no longer includes subfolders; generating the folder list structure information according to the level at which each folder is located, the parent-child relationship of the folder, and the arrangement order.
[0352] In some embodiments, the updating of the preset folder list structure information according to the target position of the first folder specifically includes: when the first folder is merged with the second folder, the first folder is modified to be a subfolder of the second folder in the folder list structure information, and the arrangement order of the first folder is determined according to the position of the first folder in the second folder; when the first folder is merged with the third folder, the first folder is modified to be a subfolder of the third folder in the folder list structure information, and the arrangement order of the first folder is determined according to the position of the first folder in the third folder; when the first folder icon is moved between the second folder icon and the third folder icon, the position of the first folder is modified to between the subfolder of the second folder and the third folder in the folder list structure information.
[0353] S1105, displaying a third interface according to the updated folder list structure information, where the third interface includes a second folder list, where the second folder list is a folder list corresponding to the first folder icon being dragged to a target location.
[0354] In some embodiments, the folder information in the database is adjusted according to the updated folder list structure information so that the folder level and folder arrangement order corresponding to each folder in the database are consistent with those in the updated folder structure information.
[0355] According to the folder management method provided by the embodiment of the present application, by The system terminal device presents a folder to be moved by inputting a drag operation, and dragging the selected folder to the target location to achieve the folder moving effect. In addition, when it is necessary to merge folders, by dragging the selected folder to the top of the target folder to be merged, and making the overlapping relationship between the selected folder and the target folder meet the preset conditions, the two folders can be automatically merged. This method can achieve automatic merging based on the user without the user inputting cumbersome operations. The system manages folders conveniently and efficiently, which can effectively improve the user experience.
[0356] Based on the same technical concept, an embodiment of the present application also provides a terminal device, including one or more processors; one or more memories; the one or more memories store one or more computer programs, and the one or more computer programs include instructions. When the instructions are executed by the one or more processors, the computer or processor executes one or more steps in any of the above methods.
[0357] Based on the same technical concept, an embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable program instructions. When the computer-executable program instructions are executed on a computer, the computer or processor executes one or more steps in any of the above methods.
[0358] Based on the same technical concept, an embodiment of the present application also provides a computer program product comprising instructions, wherein the computer program product includes computer program code. When the computer program code runs on a computer, the computer or processor executes one or more steps in any of the above methods.
[0359] 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 process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.
[0360] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0361] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.
Claims
1. A method for folder management, characterized in that: Applied to a terminal device, the operating system of the terminal device is an Android system, the terminal device includes a display screen, a RecyclerView display control, a drag animation moving module, a drag animation callback module, a DataManager, and a data adapter. The DataManager is located in the application layer of the terminal device and includes: The display screen receives a long press operation input by a user, wherein the long press operation is used to select a first folder in the first folder list; The display screen sends a long press event corresponding to the long press operation to the RecyclerView display control; The RecyclerView display control obtains a first coordinate corresponding to the long press event in the display screen; The RecyclerView display control sends the first coordinate to the drag animation movement module; The drag animation moving module acquires the pressed first folder according to the first coordinate; The display screen receives a drag operation input by a user, where the drag operation is used to drag the first folder; The display screen sends a drag event corresponding to the drag operation to the RecyclerView display control, where the drag event is used to drag the first folder from a first position of the second level to a second position of the first level; The RecyclerView display control obtains a plurality of second coordinates corresponding to the drag event in the display screen; The RecyclerView display control sends the multiple second coordinates to the drag animation movement module, and obtains a drag animation through the drag animation movement module, where the drag animation is used to indicate a position change of the first folder during the dragging process; In response to the position change of the first folder, the drag animation moving module sends an update array value notification to the DataManager through the drag animation callback module, and the DataManager stores the array value corresponding to the first folder list, and the array value includes the unique identifier uuid corresponding to each folder in the first folder list, the folder name, the ID value of the parent folder, the level of the folder, the parent-child folder relationship, and the arrangement order of the folders, and the arrangement order of the folders is used to indicate the position of each folder in the respective level; wherein the method for the DataManager to obtain the array value includes: obtaining all first-level folders in the first folder list according to the folder identification ID pre-stored in the database; sorting the first-level folders according to the arrangement order of the folders; based on the first-level folders, recursively querying the subfolders included in each folder according to the folder level, and obtaining the level of each folder and the corresponding parent-child relationship; sorting the subfolders according to the arrangement order of the folders; generating the array value corresponding to the first folder list according to the level corresponding to each folder, the parent-child relationship and the position in the folder level; In response to the notification of updating the array value, the DataManager updates the level corresponding to the first folder in the array value from 1 to 0, wherein the level 1 corresponds to the second level and the level 0 corresponds to the first level, and updates the arrangement order corresponding to the first folder from 0 to 1, wherein the arrangement order 0 corresponds to the first position and the arrangement order 1 corresponds to the second position; The DataManager sends the updated array value to the data adapter; The data adapter obtains and displays a second folder list through the display screen according to the updated array value, where the second folder list is a folder list corresponding to the first folder being dragged.
2. The method according to claim 1, characterized in that The method further comprises: The array value is generated according to the information of each folder in the first folder list recorded in the database, wherein the information of each folder also includes the level of the folder and the ID of the parent folder to which the folder belongs.
3. The method according to claim 2, characterized in that The method further comprises: According to the levels of the folders in the first folder list, obtaining the folders in the first level in the first folder list; Traverse and query each subfolder included in the first-level folder to obtain the corresponding second-level folder; Recursively query the subfolders included in the second-level folder to obtain the corresponding third-level folder; Repeat the above recursive subfolder query operation until a folder at a certain level no longer contains subfolders; The array value is generated according to the folder ID corresponding to each folder, the level at which it is located, the ID of the parent folder to which it belongs, and the folder arrangement order.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: In response to a long press operation input by a user on a first folder icon in the first folder list, determining the first coordinate corresponding to the long press operation; determining a first folder according to the first coordinates, wherein the location of the first folder corresponds to the first coordinates; The first folder icon is set to a selected state, and the first interface is displayed.
5. The method according to any one of claims 1 to 3, characterized in that: When the first folder includes subfolders, the method further includes: In response to a long press operation input by the user on a first folder icon in the first folder list, deleting information corresponding to a subfolder of the first folder in the preset folder list structure information, and acquiring second folder list structure information; A first interface is displayed according to the second folder structure information, wherein the first interface includes the first folder icon in a selected state, and the subfolders included in the first folder are not displayed.
6. The method according to any one of claims 1 to 3, characterized in that The method further comprises: receiving a drag operation input by a user on the first folder icon; Determining the plurality of second coordinates corresponding to the drag operation; A plurality of positions where the first folder is currently located during the moving process are determined according to the plurality of second coordinates.
7. The method according to claim 6, characterized in that The method further comprises: The position change of the first folder icon during the dragging process is displayed according to the multiple positions of the first folder during the moving process.
8. The method according to claim 1, characterized in that The target folder includes the second folder and / or the third folder, and the method further includes: When the dragging ends, in response to a hand-raising operation input by the user, the second folder and / or the third folder adjacent to the first folder icon is determined according to the dragging height, wherein the second folder is an adjacent folder located above the first folder icon, and the third folder is an adjacent folder located below the first folder icon; determining whether to merge folders according to the offset of the first folder relative to the target folder after being dragged; wherein, When it is determined according to the offset that the overlapped portion of the first folder and the second folder is greater than or equal to a first ratio, merging the first folder and the second folder; When it is determined according to the offset that the overlapped portion of the first folder and the second folder is smaller than a first ratio, the first folder and the second folder are not merged; When it is determined according to the offset that the overlapped portion of the first folder and the third folder is greater than or equal to a first ratio, merging the first folder and the third folder; When it is determined according to the offset that the overlapped portion of the first folder and the third folder is smaller than a first ratio, the first folder and the third folder are not merged; When it is determined according to the offset that the overlapping parts of the first folder, the second folder and the third folder are all smaller than a first ratio, the first folder icon is moved between the second folder icon and the third folder icon.
9. The method according to claim 8, characterized in that The determining whether to merge folders according to the offset of the first folder relative to the target folder after being dragged specifically includes: Whether to merge folders is determined according to the offset of the first folder relative to the target folder after being dragged and the dragging direction.
10. The method according to claim 9, characterized in that The determining whether to merge folders according to the offset of the first folder relative to the target folder after being dragged and the dragging direction specifically includes: When it is determined according to the offset that the overlapped portion of the first folder and the second folder is greater than or equal to a first ratio, and the direction of the drag operation is upward, merging the first folder and the second folder; When it is determined according to the offset that the overlapped portion of the first folder and the second folder is greater than or equal to a first ratio, and the direction of the drag operation is downward, moving the first folder icon below the second folder icon; When it is determined according to the offset that the overlapped portion of the first folder and the third folder is greater than or equal to a first ratio, and the direction of the drag operation is downward, merging the first folder and the third folder; When it is determined according to the offset that the overlapped portion of the first folder and the third folder is greater than or equal to a first ratio, and the direction of the drag operation is upward, the first folder icon is moved above the second folder icon.
11. The method according to any one of claims 8 to 10, characterized in that: The updating of the preset folder list structure information according to the target location of the first folder specifically includes: When the first folder is merged with the second folder, the first folder is modified as a subfolder of the second folder in the folder list structure information, and the arrangement order of the first folder is determined according to the position of the first folder in the second folder; When the first folder is merged with the third folder, the first folder is modified as a subfolder of the third folder in the folder list structure information, and the arrangement order of the first folder is determined according to the position of the first folder in the third folder; When the first folder icon is moved between the second folder icon and the third folder icon, the position of the first folder in the folder list structure information is modified to be between the subfolder of the second folder and the third folder.
12. The method according to any one of claims 1 to 3, characterized in that The method further comprises: The folder information in the database is adjusted according to the updated folder list structure information, so that the folder level and folder arrangement order corresponding to each folder in the database are consistent with those in the updated folder structure information.
13. The method according to any one of claims 1 to 3, characterized in that: modifying the position corresponding to the first folder in the array value according to the target position after the first folder is dragged, so that the position of the first folder in the array value is consistent with the position of the first folder in the folder list after the first folder is dragged; as well as, modifying the arrangement order of the folders corresponding to the first folder in the array value so that the arrangement order of the folders corresponding to the first folder is consistent with the arrangement order in the folder list after the first folder is dragged; as well as, modifying the level corresponding to the first folder in the array value so that the level corresponding to the first folder is consistent with the level in the folder list after the first folder is dragged; as well as, The ID of the parent folder corresponding to the first folder is modified in the array value so that the ID of the parent folder corresponding to the first folder is consistent with the ID of the parent folder in the folder list after the first folder is dragged.
14. A terminal device, characterized in that: include: one or more processors; one or more memories; The one or more memories store one or more computer programs, and the one or more computer programs include instructions. When the instructions are executed by the one or more processors, the terminal device performs the method according to any one of claims 1 to 13.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 13.
