Drag Analysis of custom sliding folder like Hola desktop Launcher,

Source: Internet
Author: User

Drag Analysis of custom sliding folder like Hola desktop Launcher,

I haven't written a blog for a long time. I am still used to writing ideas. The idea is the most important.

Launcher's drag is nothing more than a DragController, which is simple and sometimes complicated. The following is a simple example of your understanding. You can point out what is wrong.

DragSource: drag the source, as the name implies, where it is dragged in. For example, from workspace ---> folder, from foler ---> workspace, from folder --> deleteTagter, etc. That is, from where to where, and from where to where, is DragSource.

DropTarget is the same as drag.

DragController. DragListener: Listener for dragging. Where can I use it. For example, drag and drop. He wants to implement this listener. When he is long-pressed, the deleted XX will appear at the top of the screen. Or obtain the focus.


For example, we want to implement a folder in Viewpage, which can be dragged, sorted and deleted, or dragged from the folder to a ButtonDropTarget.

Let's analyze:

1. the icon is in the folder and can be dragged to the folder. Therefore, this folder must implement two interfaces. DragSource, DropTarget

2. Do you also need to enable long-pressed listeners and click to listen to View. OnClickListenerView. OnLongClickListener?

3. Sliding VIewpage between left and right is required in the folder

4. Do each folder also need to be nested in VIewPage (note that various conflicts need to be resolved. Otherwise, it cannot slide. Event distribution interception consumption)

5. Each Foler should preferably be ScrollView nested CellLayout. Of course, it can also be another layout, which should be rewritten. Scroll Help slide tool to achieve this slide. Damping.

6. Add it to the next layer of the DragLayout drag layer.

Of course, you can drag the entire process to the folder and slide smoothly. You still need to explore it yourself. The implementation of the entire folder process is indeed complicated. We need to complete the implementation without having any conflict with the nested layout, and have some knowledge about Launcher, so it is difficult to stick to it. It took me 2-3 weeks to implement the entire folder.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.