CN113778270A - Method and device for dragging icon - Google Patents

Method and device for dragging icon Download PDF

Info

Publication number
CN113778270A
CN113778270A CN202010778551.6A CN202010778551A CN113778270A CN 113778270 A CN113778270 A CN 113778270A CN 202010778551 A CN202010778551 A CN 202010778551A CN 113778270 A CN113778270 A CN 113778270A
Authority
CN
China
Prior art keywords
icon
shadow
folder
source
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010778551.6A
Other languages
Chinese (zh)
Other versions
CN113778270B (en
Inventor
王斌
郑运广
赵然
孙路伟
朱光
王小明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010778551.6A priority Critical patent/CN113778270B/en
Publication of CN113778270A publication Critical patent/CN113778270A/en
Application granted granted Critical
Publication of CN113778270B publication Critical patent/CN113778270B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method and a device for dragging an icon, and relates to the technical field of computers. One embodiment of the method comprises: responding to a clicking event of a folder, expanding the folder in a child view, and creating an adhesive layer; creating a shadow icon which is the same as the source icon in the bonder layer, and transmitting a dragging event of the source icon to a target icon which is the same as the source icon in a parent view through the shadow icon; removing the adhesive layer and the shadow icon. The implementation method can solve the technical problems of poor portability and deep service intrusion.

Description

Method and device for dragging icon
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for dragging an icon.
Background
At present, the dragging of the application icon is mostly realized based on the desktop system application Launcher3, and many implementations on the market are improved on the basis of the function of the Launcher3 to realize the dragging of the application icon.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1) the project is large in overall submission, and the transportability is poor for the requirement of a simple folder;
2) the implementation of the dragging scheme is complicated, and the dragging process packages the touch events layer by layer and needs to be converted into service data for transmission, so that the dragging process is difficult to understand and the service invasion is deep.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for dragging an icon, so as to solve the technical problems of poor portability and deep service intrusion.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of dragging an icon, including:
responding to a clicking event of a folder, expanding the folder in a child view, and creating an adhesive layer;
creating a shadow icon which is the same as the source icon in the bonder layer, and transmitting a dragging event of the source icon to a target icon which is the same as the source icon in a parent view through the shadow icon;
removing the adhesive layer and the shadow icon.
Optionally, creating a shadow icon in the bonder layer, the shadow icon being identical to the source icon, and transferring the drag event of the source icon to a target icon in the parent view, the target icon being identical to the source icon, through the shadow icon, including:
responding to a long-press event of any source icon in the folder, and creating a shadow icon which is the same as the source icon in the bonder layer;
transferring a drag event of the source icon to the shadow icon in real time;
if the position of the source icon exceeds the area range of the folder, the folder is folded, the source icon is removed from the folder, and a target icon which is the same as the source icon is created in a parent view;
and transmitting the dragging event of the shadow icon to the target icon in real time.
Optionally, removing the adhesive layer and the shadow icon comprises:
removing the adhesive layer and the shadow icon in response to a release event of the shadow icon.
Optionally, in response to a click event of a folder, expanding the folder in the child view and creating a binder layer, comprising:
creating a bonder layer in the DecorView in response to a click event of a folder, and creating a textView and a child RecyclerView in the bonder layer; wherein the child RecyclerVi ew comprises a background of the folder and each icon within the folder;
associating the bonder layer with a parent RecycleView created in the DecorView.
Optionally, collapsing the folder, removing the source icon from the folder, and creating a target icon in a parent view that is the same as the source icon, including:
the folder is folded, and the source icon is removed from the folder;
removing the child RecycleView and the TextView from the bonder layer;
creating a target icon in the parent RecycleView that is the same as the source icon.
Optionally, removing the adhesive layer and the shadow icon comprises:
removing the bonder layer and the shadow icon from the DecorView.
Optionally, the transferring the drag event of the shadow icon to the target icon in real time includes:
in the process of dragging the shadow icon, transmitting the position of the shadow icon to the target icon in real time so that the target icon moves along with the shadow icon;
if the target icon moves to an application list area, the target icon is visible to a user;
and if the target icon is moved to a non-application list area, the target icon is invisible to the user.
Optionally, the bonder layer is not visible to a user and the bonder layer is located between the child view and the parent view; the shadow icon is visible to a user.
In addition, according to another aspect of the embodiments of the present invention, there is provided an apparatus for dragging an icon, including:
the creation module is used for responding to the clicking event of the folder, expanding the folder in the sub-view and creating a bonder layer;
the transfer module is used for creating a shadow icon which is the same as the source icon in the bonder layer and transferring the dragging event of the source icon to a target icon which is the same as the source icon in the parent view through the shadow icon;
a removal module to remove the bonder layer and the shadow icon.
Optionally, the transfer module is further configured to:
responding to a long-press event of any source icon in the folder, and creating a shadow icon which is the same as the source icon in the bonder layer;
transferring a drag event of the source icon to the shadow icon in real time;
if the position of the source icon exceeds the area range of the folder, the folder is folded, the source icon is removed from the folder, and a target icon which is the same as the source icon is created in a parent view;
and transmitting the dragging event of the shadow icon to the target icon in real time.
Optionally, the removing module is further configured to:
removing the adhesive layer and the shadow icon in response to a release event of the shadow icon.
Optionally, the creating module is further configured to:
creating a bonder layer in the DecorView in response to a click event of a folder, and creating a textView and a child RecyclerView in the bonder layer; wherein the child RecyclerVi ew comprises a background of the folder and each icon within the folder;
associating the bonder layer with a parent RecycleView created in the DecorView.
Optionally, the transfer module is further configured to:
the folder is folded, and the source icon is removed from the folder;
removing the child RecycleView and the TextView from the bonder layer;
creating a target icon in the parent RecycleView that is the same as the source icon.
Optionally, the removing module is further configured to:
removing the bonder layer and the shadow icon from the DecorView.
Optionally, the transfer module is further configured to:
in the process of dragging the shadow icon, transmitting the position of the shadow icon to the target icon in real time so that the target icon moves along with the shadow icon;
if the target icon moves to an application list area, the target icon is visible to a user;
and if the target icon is moved to a non-application list area, the target icon is invisible to the user.
Optionally, the bonder layer is not visible to a user and the bonder layer is located between the child view and the parent view; the shadow icon is visible to a user.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the embodiments described above.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the method of any of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: because the technical means of creating the bonder layer, creating the shadow icon which is the same as the source icon in the bonder layer and transmitting the dragging event of the source icon to the target icon which is the same as the source icon in the parent view through the shadow icon is adopted, the technical problems of poor portability and deep service intrusion in the prior art are solved. In the embodiment of the invention, the dragging event of the source icon in the child view is transmitted to the target icon in the parent view through the shadow icon in the bonder layer; aiming at the realization of the dragging logic, the embodiment of the invention adopts the realization idea of the bonder layer, generates a mirror image file in the process of dragging the source icon, transmits a dragging event between the sub-view and the bonder layer, ingeniously packages the dragging process into the bonder layer, and then transmits the dragging process to the main view through the bonder layer; and the implementation of the invention does not need any intervention on the management service of the folder.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic view of a main flow of a method of dragging an icon according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of creating an adhesive layer according to an embodiment of the invention;
FIG. 3 is a diagram illustrating a drag event of a source icon being passed to a shadow icon according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a drag event of a shadow icon being delivered to a target icon according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an application list area according to an embodiment of the present invention;
fig. 6 is a diagram illustrating a main flow of a method of dragging an icon according to a reference embodiment of the present invention;
FIG. 7 is a flowchart illustrating a process of forming folders according to an embodiment of the invention;
FIG. 8 is a schematic diagram of movement of a mobile icon according to an embodiment of the invention;
FIG. 9 is a schematic diagram of an application list interface and an expanded folder interface, according to an embodiment of the invention;
fig. 10 is a schematic diagram of main blocks of an apparatus for dragging an icon according to an embodiment of the present invention;
FIG. 11 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 12 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a method of dragging an icon according to an embodiment of the present invention. As an embodiment of the present invention, as shown in fig. 1, the method of dragging an icon may include:
step 101, responding to the click event of the folder, expanding the folder in the child view, and creating a bonder layer.
When a folder exists in the parent view, the user can click on the icon for that folder. When the user clicks on the icon for that folder, the DecorView (System Container) responds to the folder click event, expands the folder in the child view, and creates a binder layer, as shown in FIG. 2. Optionally, the bonder layer is not visible to the user and the bonder layer is located between the child view and the parent view, which prevents the bonder layer from affecting the view of the parent view by the user and thus the presence of the bonder layer is not perceived by the user.
Optionally, step 101 may comprise: creating a bonder layer in DecorrVi (TM) ew in response to a click event of a folder, and creating textView and a child RecyclerVi ew in the bonder layer; wherein the child RecycleView comprises a background of the folder and each icon within the folder; associating the bonder layer with a parent Recycler View created in the DecorView. When a user clicks on a folder, the De corView is obtained at the current window (Activity), and then a glue layer (GlueLayout) is created in the DecoView, wherein the glue layer displays the layout inside the folder, such as the folder name (TextView), the background after the folder is expanded and the layout of each icon in the folder.
And 102, creating a shadow icon which is the same as the source icon in the bonder layer, and transmitting the dragging event of the source icon to a target icon which is the same as the source icon in a parent view through the shadow icon.
Since the icons cannot be directly transferred between the child view and the parent view, in the embodiment of the present invention, a shadow icon identical to the source icon is first created in the bonder layer, and then the dragging event of the source icon is transferred to the target icon identical to the source icon in the parent view in real time through the shadow icon. According to the embodiment of the invention, the bonder layer is created, so that the dragging event of the shadow icon can be extended to each position of the screen, and the bonder layer can transmit the dragging event of the shadow icon to the target icon in the parent view.
Optionally, step 102 may comprise: responding to a long-press event of any source icon in the folder, and creating a shadow icon which is the same as the source icon in the bonder layer; transferring a drag event of the source icon to the shadow icon in real time; if the position of the source icon exceeds the area range of the folder, the folder is folded, the source icon is removed from the folder, and a target icon which is the same as the source icon is created in a parent view; and transmitting the dragging event of the shadow icon to the target icon in real time.
In the embodiment of the invention, when a user presses any source icon in a folder for a long time, a shadow icon which is the same as the source icon is created in the bonder layer, as shown in fig. 3, if the user drags the source icon, the sub-RecycleView reads the coordinates of the source icon, the coordinates are transmitted to the bonder layer in real time, and the bonder layer updates the coordinates of the shadow icon, so that the position of the source icon is set to the shadow icon in real time, and the transmission of the dragging event is realized. Optionally, the shadow icon is visible to the user, and the source icon and the shadow icon are completely overlapped since the drag event of the source icon is delivered to the shadow icon in real time.
In the process that a user drags a source icon, if the position of the source icon exceeds the area range of the folder, the folder is folded, the source icon is removed from the folder, and a target icon which is the same as the source icon is created in a parent view; and then the dragging event of the shadow icon is transferred to the target icon in real time, as shown in fig. 4.
Optionally, collapsing the folder, removing the source icon from the folder, and creating a target icon in a parent view that is the same as the source icon, including: the folder is folded, and the source icon is removed from the folder; removing the child RecycleView and the TextView from the bonder layer; creating a target icon in the parent RecycleView that is the same as the source icon. When the source icon moved by the user exceeds the area range of the folder, the layout of the folder is folded, the source icon is removed from the folder, and the child RecycleView and the TextView are removed from the bonder layer. But the bonder layer in the DecorView w exists all the time, the shadow icons also exist on the bonder layer all the time, only the child RecycleView is removed at this time, and the source icon in the SubRecycleView selected by the user is also removed.
The dispatchtouchvent method in the parent RecycleView transfers the drag event to the target icon in the parent R _ RecycleView, simulates the drag event of a user in the parent view, and sets the position of the shadow icon to the target icon in the parent RecycleView through position transfer, so that the target icon in the parent RecycleView is superposed with the shadow icon in the bonder layer. Since the drag event of the shadow icon is delivered to the target icon in real time, the target icon and the shadow icon are completely overlapped.
The method and the device for controlling the drag event of the RecyclerView are used for controlling the drag event of the RecyclerView, and the method and the device for controlling the drag event of the RecyclerView are used for controlling the drag event of the RecyclerView. The embodiment of the invention is improved on the basis of the RecycleView, and the dragging of the application icon is quickly realized on the basis of not replacing the existing list display control.
Optionally, the transferring the drag event of the shadow icon to the target icon in real time includes: in the process of dragging the shadow icon, transmitting the position of the shadow icon to the target icon in real time so that the target icon moves along with the shadow icon; if the target icon moves to an application list area, the target icon is visible to a user; and if the target icon is moved to a non-application list area, the target icon is invisible to the user. As shown in fig. 5, the application list area may occupy a partial area of the screen or the entire screen area, and if the target icon moves to the application list area, the target icon is visible to the user, and the user can see the overlapped shadow icon and the target icon; if the target icon moves to the non-application list area, the target icon is invisible to the user, and the user can only see the shadow icon.
Step 103, removing the bonder layer and the shadow icon.
Optionally, step 103 may comprise: removing the adhesive layer and the shadow icon in response to a release event of the shadow icon. When the target icon moves into position with the shadow icon, the user releases the shadow icon, the DecorView removes the adhesive layer, and the shadow icon disappears. Specifically, the bonder layer and the shadow icon are removed from the DecorView, and the relationship between the bonder layer and the parent RecycleView is released. Thus, the target icon added in the parent view is the source icon dragged from the folder.
According to the various embodiments described above, it can be seen that the technical means of creating the bonder layer, creating the shadow icon identical to the source icon in the bonder layer, and transferring the dragging event of the source icon to the target icon identical to the source icon in the parent view through the shadow icon in the embodiments of the present invention solves the technical problems of poor portability and deep intrusion on services in the prior art. In the embodiment of the invention, the dragging event of the source icon in the child view is transmitted to the target icon in the parent view through the shadow icon in the bonder layer; aiming at the realization of the dragging logic, the embodiment of the invention adopts the realization idea of the bonder layer, generates a mirror image file in the process of dragging the source icon, transmits a dragging event between the sub-view and the bonder layer, ingeniously packages the dragging process into the bonder layer, and then transmits the dragging process to the main view through the bonder layer; and the implementation of the invention does not need any intervention on the management service of the folder.
Fig. 6 is a schematic diagram illustrating a main flow of a method of dragging an icon according to a reference embodiment of the present invention. As still another embodiment of the present invention, as shown in fig. 6, the method of dragging an icon may include:
step 601, responding to a click event of a folder, creating a bonder layer in the DecorView, creating a TextView and a child RecyclerView in the bonder layer, and associating the bonder layer with a parent RecyclerView created in the DecorView.
When a user clicks on a folder icon in a parent view, the DecorView responds to the folder click event, expands the folder in a child view, and creates a binder layer. Optionally, the bonder layer is not visible to a user and is created between the child view and the parent view. After creation of the bonder layer is completed, then Tex tView and child RecycleView are created in the bonder layer so that the bonder layer displays the layout inside the folder. Wherein the child RecycleView includes a background of the folder and icons within the folder.
Step 602, responding to a long-press event of any source icon in the folder, and creating a shadow icon identical to the source icon in the bonder layer.
When a user presses any one of the source icons in the folder for a long time, a shadow icon identical to the source icon is created in the bonder layer.
Step 603, the dragging event of the source icon is transmitted to the shadow icon in real time.
And if the user drags the source icon, the child RecyclerView reads the coordinates of the source icon, transmits the coordinates to the bonder layer in real time, and the bonder layer updates the coordinates of the shadow icon, so that the position of the source icon is set to the shadow icon in real time to realize the transmission of a dragging event.
Step 604, judging that the position of the source icon exceeds the area range of the folder; if yes, go to step 605; if not, go to step 603.
Step 605, collecting the folder, and removing the source icon from the folder; removing the child RecycleView and the TextView from the bonder layer; and creating a target icon in the parent RecycleView, wherein the target icon is the same as the source icon.
In the process of dragging a source icon by a user, if the position of the source icon exceeds the area range of the folder, the layout of the folder is folded, the source icon is removed from the folder, and the child RecycleView and the TextView are removed from the bonder layer. But the bonder layer in the DecorView still exists all the time, shadow icons also exist on the bonder layer all the time, only the child RecycleView is removed at this time, and the source icon in the SubRecycleView selected by the user is also removed. At the same time, a target icon identical to the source icon is also created in the parent RecycleView.
Step 606, the drag event of the shadow icon is transferred to the target icon in real time.
Similarly, the bonder layer reads the coordinates of the shadow icon, transmits the coordinates to the parent Recyc lerView in real time, and the parent Recyc View updates the coordinates of the target icon, so that the position of the shadow icon is set to the target icon in real time to realize the transmission of the dragging event.
It is noted that, during the process of dragging the shadow icon, the position of the shadow icon is transferred to the target icon in real time, so that the target icon moves along with the shadow icon; if the target icon moves to an application list area, the target icon is visible to a user; and if the target icon is moved to a non-application list area, the target icon is invisible to the user.
Step 607, in response to the release event of the shadow icon, removing the bonder layer and the shadow icon from the DecorView.
When the target icon moves to a proper position along with the shadow icon, the user releases the shadow icon, the DecorView removes the bonder layer, the shadow icon disappears, and the relationship between the bonder layer and the parent RecycleView is released.
In addition, in a reference embodiment of the present invention, the detailed implementation of the method for dragging the icon is described in detail in the above-mentioned method for dragging the icon, and therefore the repeated content is not described again.
Fig. 7 is a flowchart illustrating a process of forming a folder according to an embodiment of the present invention. As still another embodiment of the present invention, as shown in fig. 7, the forming process of the folder may include:
step 701, in the dragging process of the mobile icon, finding an icon to be merged from an icon set which has a common intersection with the dragged icon, wherein the distance between the icon to be merged and the center of the mobile icon is the nearest.
When a user presses an application icon for a long time and drags the icon, in the moving process of the moving icon, the set of all icons which have a common intersection with the moving icon is determined through the zooDropTarget callback of RecycleView. As shown in fig. 8, assuming that the mobile icon is application a, the icon with common intersection with application a is application B, and if application a continues to move, the icon with common intersection with application a also includes application C and application D. And then calculating the center distance between each icon in the icon set and the moving icon, and finding out the icon with the minimum center distance from the moving icon as the icon to be merged.
Step 702, judging whether the distance between the center of the icon to be merged and the center of the moving icon is smaller than a preset distance threshold value; if yes, go to step 703; if not, go to step 706.
Step 703, displaying the animation effects that can be categorized together.
If the distance between the center of the icon to be merged and the center of the moving icon is smaller than a preset distance threshold value, the background area of the icon to be merged is enlarged through animation, and the user is informed in such an interactive mode that the moving icon and the icon to be merged can generate a folder.
Step 704, judging whether to release the mobile icon; if yes, go to step 705; if not, go to step 706.
Step 705, classifying the icon to be merged and the mobile icon to form a folder, and displaying the icon to be merged and the mobile icon in the folder.
If the user releases the move icon, a folder is created and the icon to be merged and the move icon are merged into the folder, as shown in FIG. 9. The generation of the folder is realized by drawing the user-defined ImageView and comprises a folder style and an application icon inside the folder. The application icons need to respectively calculate the positions of the icons in the folder according to several rows, columns and intervals in the folder, and finally the application icons are overlapped with the background style of the folder to generate a new icon.
At step 706, the position is vacated for the move icon.
When the distance between the center of the icon to be merged and the center of the moving icon reaches the set distance threshold, but the user continues to drag the icon to be merged without releasing the icon, the distance between the center of the icon to be merged and the center of the moving icon gradually increases with the continuous movement of the moving icon and is larger than the set distance threshold, the animation for expanding the background area of the icon to be merged disappears, and then the next icon to be merged is searched.
Fig. 10 is a schematic diagram of main modules of an apparatus for dragging an icon according to an embodiment of the present invention, and as shown in fig. 10, the apparatus 1000 for dragging an icon includes a creation module 1001, a delivery module 1002, and a removal module 1003; the creating module 1001 is configured to respond to a click event of a folder, expand the folder in a child view, and create an bonder layer; the transferring module 1002 is configured to create a shadow icon identical to the source icon in the bonder layer, and transfer a drag event of the source icon to a target icon identical to the source icon in the parent view through the shadow icon; a removal module 1003 is used to remove the bonder layer and the shadow icon.
Optionally, the transfer module 1002 is further configured to:
responding to a long-press event of any source icon in the folder, and creating a shadow icon which is the same as the source icon in the bonder layer;
transferring a drag event of the source icon to the shadow icon in real time;
if the position of the source icon exceeds the area range of the folder, the folder is folded, the source icon is removed from the folder, and a target icon which is the same as the source icon is created in a parent view;
and transmitting the dragging event of the shadow icon to the target icon in real time.
Optionally, the removing module 1003 is further configured to:
removing the adhesive layer and the shadow icon in response to a release event of the shadow icon.
Optionally, the creating module 1001 is further configured to:
creating a bonder layer in the DecorView in response to a click event of a folder, and creating a textView and a child RecyclerView in the bonder layer; wherein the child RecyclerVi ew comprises a background of the folder and each icon within the folder;
associating the bonder layer with a parent RecycleView created in the DecorView.
Optionally, the transfer module 1002 is further configured to:
the folder is folded, and the source icon is removed from the folder;
removing the child RecycleView and the TextView from the bonder layer;
creating a target icon in the parent RecycleView that is the same as the source icon.
Optionally, the removing module 1003 is further configured to:
removing the bonder layer and the shadow icon from the DecorView.
Optionally, the transfer module 1002 is further configured to:
in the process of dragging the shadow icon, transmitting the position of the shadow icon to the target icon in real time so that the target icon moves along with the shadow icon;
if the target icon moves to an application list area, the target icon is visible to a user;
and if the target icon is moved to a non-application list area, the target icon is invisible to the user.
Optionally, the bonder layer is not visible to a user and the bonder layer is located between the child view and the parent view; the shadow icon is visible to a user.
According to the various embodiments described above, it can be seen that the technical means of creating the bonder layer, creating the shadow icon identical to the source icon in the bonder layer, and transferring the dragging event of the source icon to the target icon identical to the source icon in the parent view through the shadow icon in the embodiments of the present invention solves the technical problems of poor portability and deep intrusion on services in the prior art. In the embodiment of the invention, the dragging event of the source icon in the child view is transmitted to the target icon in the parent view through the shadow icon in the bonder layer; aiming at the realization of the dragging logic, the embodiment of the invention adopts the realization idea of the bonder layer, generates a mirror image file in the process of dragging the source icon, transmits a dragging event between the sub-view and the bonder layer, ingeniously packages the dragging process into the bonder layer, and then transmits the dragging process to the main view through the bonder layer; and the implementation of the invention does not need any intervention on the management service of the folder.
It should be noted that, in the implementation of the apparatus for dragging an icon according to the present invention, the above method for dragging an icon has been described in detail, and therefore, the repeated content is not described again.
Fig. 11 illustrates an exemplary system architecture 1100 of a method of dragging an icon or an apparatus of dragging an icon to which an embodiment of the present invention may be applied.
As shown in fig. 11, the system architecture 1100 may include terminal devices 1101, 1102, 1103, a network 1104, and a server 1105. The network 1104 is a medium to provide communication links between the terminal devices 1101, 1102, 1103 and the server 1105. Network 1104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 1101, 1102, 1103 to interact with a server 1105 over a network 1104 to receive or send messages or the like. Various messaging client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (examples only) may be installed on the terminal devices 1101, 1102, 1103.
The terminal devices 1101, 1102, 1103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 1105 may be a server that provides various services, such as a backend management server (for example only) that provides support for shopping-like websites browsed by users using the terminal devices 1101, 1102, 1103. The background management server may analyze and otherwise process the received data such as the item information query request, and feed back a processing result (for example, target push information, item information — just an example) to the terminal device.
It should be noted that the method for dragging the icon provided by the embodiment of the present invention is executed by the terminal devices 1101, 1102, 1103, and accordingly, the apparatus for dragging the icon may be disposed in the terminal devices 1101, 1102, 1103.
It should be understood that the number of terminal devices, networks, and servers in fig. 11 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 12, shown is a block diagram of a computer system 1200 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 12 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 12, the computer system 1200 includes a Central Processing Unit (CPU)1201, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1202 or a program loaded from a storage section 1208 into a Random Access Memory (RAM) 1203. In the RAM1203, various programs and data necessary for the operation of the system 1200 are also stored. The CPU 1201, ROM 1202, and RAM1203 are connected to each other by a bus 1204. An input/output (I/O) interface 1205 is also connected to bus 1204.
The following components are connected to the I/O interface 1205: an input section 1206 including a keyboard, a mouse, and the like; an output portion 1207 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 1208 including a hard disk and the like; and a communication section 1209 including a network interface card such as a LAN card, a modem, or the like. The communication section 1209 performs communication processing via a network such as the internet. A driver 1210 is also connected to the I/O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is mounted on the drive 1210 as necessary, so that a computer program read out therefrom is mounted into the storage section 1208 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 1209, and/or installed from the removable medium 1211. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 1201.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a create module, a pass module, and a remove module, where the names of the modules do not in some cases constitute a definition of the modules themselves.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, implement the method of: responding to a clicking event of a folder, expanding the folder in a child view, and creating an adhesive layer; creating a shadow icon which is the same as the source icon in the bonder layer, and transmitting a dragging event of the source icon to a target icon which is the same as the source icon in a parent view through the shadow icon; removing the adhesive layer and the shadow icon.
According to the technical scheme of the embodiment of the invention, because the technical means that the bonder layer is created, the shadow icon which is the same as the source icon is created in the bonder layer, and the dragging event of the source icon is transmitted to the target icon which is the same as the source icon in the parent view through the shadow icon is adopted, the technical problems of poor portability and deep service intrusion in the prior art are solved. In the embodiment of the invention, the dragging event of the source icon in the child view is transmitted to the target icon in the parent view through the shadow icon in the bonder layer; aiming at the realization of the dragging logic, the embodiment of the invention adopts the realization idea of the bonder layer, generates a mirror image file in the process of dragging the source icon, transmits a dragging event between the sub-view and the bonder layer, ingeniously packages the dragging process into the bonder layer, and then transmits the dragging process to the main view through the bonder layer; and the implementation of the invention does not need any intervention on the management service of the folder.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A method of dragging an icon, comprising:
responding to a clicking event of a folder, expanding the folder in a child view, and creating an adhesive layer;
creating a shadow icon which is the same as the source icon in the bonder layer, and transmitting a dragging event of the source icon to a target icon which is the same as the source icon in a parent view through the shadow icon;
removing the adhesive layer and the shadow icon.
2. The method of claim 1, wherein creating a shadow icon in the bonder layer identical to the source icon, and wherein transferring the drag event of the source icon through the shadow icon to a target icon in a parent view identical to the source icon comprises:
responding to a long-press event of any source icon in the folder, and creating a shadow icon which is the same as the source icon in the bonder layer;
transferring a drag event of the source icon to the shadow icon in real time;
if the position of the source icon exceeds the area range of the folder, the folder is folded, the source icon is removed from the folder, and a target icon which is the same as the source icon is created in a parent view;
and transmitting the dragging event of the shadow icon to the target icon in real time.
3. The method of claim 1 or 2, wherein removing the adhesive layer and the shadow icon comprises:
removing the adhesive layer and the shadow icon in response to a release event of the shadow icon.
4. The method of claim 2, wherein expanding the folder in the child view and creating a binder layer in response to a click event of the folder comprises:
creating a bonder layer in the DecorView in response to a click event of a folder, and creating a textView and a child RecyclerView in the bonder layer; wherein the child RecycleView comprises a background of the folder and each icon within the folder;
associating the bonder layer with a parent RecycleView created in the DecorView.
5. The method of claim 4, wherein collapsing the folder, removing the source icon from the folder, and creating a target icon in a parent view that is the same as the source icon comprises:
the folder is folded, and the source icon is removed from the folder;
removing the child RecycleView and the TextView from the bonder layer;
creating a target icon in the parent RecycleView that is the same as the source icon.
6. The method of claim 4, wherein removing the adhesive layer and the shadow icon comprises:
removing the bonder layer and the shadow icon from the DecorView.
7. The method of claim 2, wherein communicating the shadow icon's drag event to the target icon in real-time comprises:
in the process of dragging the shadow icon, transmitting the position of the shadow icon to the target icon in real time so that the target icon moves along with the shadow icon;
if the target icon moves to an application list area, the target icon is visible to a user;
and if the target icon is moved to a non-application list area, the target icon is invisible to the user.
8. The method of claim 1, wherein the bonder layer is not visible to a user and the bonder layer is located between the child view and the parent view; the shadow icon is visible to a user.
9. An apparatus for dragging an icon, comprising:
the creation module is used for responding to the clicking event of the folder, expanding the folder in the sub-view and creating a bonder layer;
the transfer module is used for creating a shadow icon which is the same as the source icon in the bonder layer and transferring the dragging event of the source icon to a target icon which is the same as the source icon in the parent view through the shadow icon;
a removal module to remove the bonder layer and the shadow icon.
10. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, implement the method of any of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202010778551.6A 2020-08-05 2020-08-05 Method and device for dragging icon Active CN113778270B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010778551.6A CN113778270B (en) 2020-08-05 2020-08-05 Method and device for dragging icon

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010778551.6A CN113778270B (en) 2020-08-05 2020-08-05 Method and device for dragging icon

Publications (2)

Publication Number Publication Date
CN113778270A true CN113778270A (en) 2021-12-10
CN113778270B CN113778270B (en) 2024-10-18

Family

ID=78835103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010778551.6A Active CN113778270B (en) 2020-08-05 2020-08-05 Method and device for dragging icon

Country Status (1)

Country Link
CN (1) CN113778270B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756148A (en) * 2022-04-27 2022-07-15 北京达佳互联信息技术有限公司 Control display method and device, electronic equipment and storage medium
CN114935992A (en) * 2022-04-25 2022-08-23 苏海强 Display control method and system based on human-computer interaction

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050000133A1 (en) * 2002-11-29 2005-01-06 Russell Donald G. Markers, methods of marking, and marking systems for use in association with images
US20130174069A1 (en) * 2012-01-04 2013-07-04 Samsung Electronics Co. Ltd. Method and apparatus for managing icon in portable terminal
CN104024921A (en) * 2011-08-19 2014-09-03 光学物理有限责任公司 Optionally Transferable Optical System With A Reduced Thickness
US20150331573A1 (en) * 2014-05-15 2015-11-19 Hisense Mobile Communications Technology Co., Ltd. Handheld mobile terminal device and method for controlling windows of same
CN106020657A (en) * 2016-05-12 2016-10-12 山东大学 Dragging-moving method of files under same directory for Android system
CN107491488A (en) * 2017-07-18 2017-12-19 北京京东尚科信息技术有限公司 The method and apparatus of page data collection
CN109683764A (en) * 2018-12-27 2019-04-26 维沃移动通信有限公司 A kind of icon management method and terminal
CN110502162A (en) * 2019-07-08 2019-11-26 维沃移动通信有限公司 The creation method and terminal device of file

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050000133A1 (en) * 2002-11-29 2005-01-06 Russell Donald G. Markers, methods of marking, and marking systems for use in association with images
CN104024921A (en) * 2011-08-19 2014-09-03 光学物理有限责任公司 Optionally Transferable Optical System With A Reduced Thickness
US20130174069A1 (en) * 2012-01-04 2013-07-04 Samsung Electronics Co. Ltd. Method and apparatus for managing icon in portable terminal
US20150331573A1 (en) * 2014-05-15 2015-11-19 Hisense Mobile Communications Technology Co., Ltd. Handheld mobile terminal device and method for controlling windows of same
CN106020657A (en) * 2016-05-12 2016-10-12 山东大学 Dragging-moving method of files under same directory for Android system
CN107491488A (en) * 2017-07-18 2017-12-19 北京京东尚科信息技术有限公司 The method and apparatus of page data collection
CN109683764A (en) * 2018-12-27 2019-04-26 维沃移动通信有限公司 A kind of icon management method and terminal
CN110502162A (en) * 2019-07-08 2019-11-26 维沃移动通信有限公司 The creation method and terminal device of file

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
KIM, K等: "Lazy Dragging: Effortless Bounding-box Drawing for Touch-screen Devices", IEEE TRANSACTIONS ON CONSUMER ELECTRONICS, vol. 63, no. 2, 29 September 2017 (2017-09-29) *
太阳;: "保障快捷图标高可用性", 个人电脑, no. 07, 15 July 2017 (2017-07-15) *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114935992A (en) * 2022-04-25 2022-08-23 苏海强 Display control method and system based on human-computer interaction
CN114935992B (en) * 2022-04-25 2023-10-10 北京海百川科技有限公司 Display control method and system based on man-machine interaction
CN114756148A (en) * 2022-04-27 2022-07-15 北京达佳互联信息技术有限公司 Control display method and device, electronic equipment and storage medium
CN114756148B (en) * 2022-04-27 2023-10-31 北京达佳互联信息技术有限公司 Control display method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113778270B (en) 2024-10-18

Similar Documents

Publication Publication Date Title
US10990268B2 (en) Operation method and terminal device
EP4130968A1 (en) Optimization schemes for controlling user interfaces through gesture or touch
US9195367B2 (en) Managing active GUI elements remotely
WO2023040443A1 (en) Method and device for drawing canvas
WO2014130621A1 (en) Method and apparatus for two-dimensional document navigation
JP2020161135A (en) Method and system for displaying chat thread
CN113778270B (en) Method and device for dragging icon
CN112363790B (en) Table view display method and device and electronic equipment
JP2023027042A (en) Business data processing method, device, electronic apparatus, storage medium, and computer program
CN110647327B (en) Method and device for dynamic control of user interface based on card
CN110489158B (en) Method, device, medium and electronic equipment for optimizing code hosting platform
CN103412704A (en) Optimization schemes for controlling user interfaces through gesture or touch
CN113536755A (en) Method, device, electronic equipment, storage medium and product for generating poster
CN110362297B (en) Element ordering method and device
CN115470767A (en) Document processing method and device, electronic equipment and computer readable medium
CN112202864B (en) Context switching system, method, device, equipment and medium
CN110221746B (en) Information interaction method, device, medium and computing equipment
CN112925521A (en) Interface generation method and device
CN110851192B (en) Method and device for responding to degraded switch configuration
CN113452738A (en) Page loading method and client
CN112882775A (en) Method and device for self-adaptive adjustment of page template
WO2022161488A1 (en) Information display method and apparatus, and electronic device
CN110874302A (en) Method and device for determining buried point configuration information
CN113743061B (en) Numerical range adjustment method, device, electronic equipment and readable storage medium
WO2023236491A1 (en) Display method and apparatus for interface element, and electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant