Drag and Drop in Kivymd List - kivy

I am building a simple shopping list app using KivyMD. I want be able to reorder items on the list using intuitive drag and drop. How can this be achieved? I am using OneLineIconListItem inside of MDList inside of ScrollView.
I do not care if draging does work with a specific handle added to the items or by long pressing.

Related

Vaadin14 Custom Grid Drag and Drop

I have a TreeGrid with a hierarchy and I want to add a Drag and Drop functionality to it.
My problem is, I only want two types of elements to be draggable, and they can only be dropped on into these two types and the root element.
So far I could manage to only allow these elements to be dragged, by returning the dragStartEvent when the element is a different type of element.
But how can I customize the allowed dropTargets when it is a Grid?
Right now the user can drop the element at any other grid element, and the only thing I can do is show an errormessage if the dropTarget is not the desired type, but this is not a good solution, they should see while dragging the item that its not droppable there.
The grid has a Drag and a Drop Filter that you can use to decide if drag or drop.
void setDragFilter(SerializablePredicate<T> dragFilter)
Sets the drag filter for this drag source.
void setDropFilter(SerializablePredicate<T> dropFilter)
Sets the drop filter for this drag target.
Please checkout the documentation https://vaadin.com/components/vaadin-grid/java-examples/drag-and-drop

Storyboard element locations are off

I am currently building a project using storyboards and am having an issue when trying to select elements. When I try and click on an element, it selects the element a bit under it, and to select a certain element I have to aim above it. I have disabled the adjustment of scroll view insets, so I am not sure as to why this is happening. I've attached some demonstration photos. Any help is appreciated, Thanks!
Here I am selecting the "Like" Button:
And here I am selecting the image of a palm tree:

How to create stacked pagination in iOS?

How to achieve the UI as shown in the image below?
I wanted to create a form with steps, by clicking next button it will swipe and open next form and will update the number of stacked pages as shown.
For making this type of UI you need to use Background image and UIPageControl. And you have to make other UI elements like text fields and button with code. You should be careful about frames.
Finally I got the answer, and created the same UI using Koloda library in objective-c
https://github.com/wang9262/Koloda-ObjC

How to create a Hierarchical menu in iOS?

In my application, I have a menu that is defined as follows. Each item on the menu is a node that has the following data attributes:
MenuText : (the text that would appear for that item)
isView : Whether this item is a leaf level item or not
subMenus : if isView is false, then there are multiple menu items under this attribute.
Thus, it is a tree structure that can go till any depth. The items in the menu can change periodically and hence the implementation has to be kept flexible. This data is stored in a plist file and read into an NSArray in the code (already implemented).
I now need to create a slide out menu on the left that will be populated by this data hierarchy. I have created the menu pane and added swipe gestures to it, all of which work fine. The menu has to be a collapsible one where clicking on one menu item expands the subViews below it. If the item clicked on is a view, then a new view is loaded on the rest of the screen with appropriate data.
The problem I am facing is the logic to populate the menu (which is a UITableView) from the NSArray data. The following are the two approaches I came up with.
Create a UITableView with as many sections as there are items at the top level of the menu. Then iterate through the menu items recursively. For each menu item that is not a view (i.e. it has subMenus), create a new section with number of rows equal to the number of subMenus under it. When I come across a menu item that is a view and has no further subMenus, add it as a row to the subsection created for the menu one level above it.
Create a menu with one section and as many rows as the number of menu items at the top level. When a menu item is clicked, insert rows under it to represent its sub-menus. When another menu item on the same level is clicked, collapse the previously expanded menu by deleting the inserted rows. When a menu item with no sub menus is clicked, the rest of the screen is populated with data.
I have tried both the approaches and not been able to go beyond the initial steps. For the first method, I understand that I need to add a UITableView as a part of UITableViewCells, which is good, but I need to do that recursively. For the second approach, I need to know the indexPath of each item clicked which can go to many levels.
I would like some suggestions here about which approach I should take and some guidance over how to go about it. Also, if there is any better way to do this, kindly advice. Thanks.
In my opinion, using UINavigationController is the easiest way. You can push as many UITableViews as you want.
If it doesn't fit your design requirement, you can try expandable UITableViews. There are few open sources:
JKExpandTableView
SDNestedTable
iOS-Tree-Component
Thanks for the responses. I ended up doing this using the following control:
Accordion for iOS
It has served my purpose beautifully and I posted it here so that someone with the same requirement may find it.
Take a look at TLIndexPathTools. It has a "Tree" extension that can do this. Try running the Outline sample project. The main task in adapting the sample project would be to write a recursive function to convert your array of nodes into an array of TLIndexPathTreeItem objects. All of the code in the controller:willChangeNode: method is examples of lazy loading and it doesn't sound like you'd need any of that.

how to do drag and drop of record from one list view to another kendoUI

I have different list views,
I want to drag and drop of record from one list view to another.
I have seen a link in regarding this,
"http://jsfiddle.net/MZxQu/36/"
I have implemented this in list view,with this I am able to drag the list view content,but I am not able to drop it on another list view.
can u help me
Thanks..
Use this instead of grid it will be better i guess:
http://demos.kendoui.com/web/treeview/dragdrop.html

Resources