Comments (18)
- 没理解
- 没理解
from treeview.
1、当前treenode:
open class TreeNode(
var data: T?,
var depth: Int,
var path: String = "/root",
var name: String?,
var id: Int,
var hasChild: Boolean = false,
var isChild: Boolean = false,
var expand: Boolean = true,
)
其中的path目前是 targetNode.path = parentNode.path + "/" + targetNode.name
怎么样改成 targetNode.path = parentNode.path + "/" + targetNode. depth ,这样就能获取当前子节点的位置了
2、我想点击子节点左侧的箭头,让当前节点折叠或者展开,而不是点击整个节点,这样的点击事件如何处理
3、目前支持TreeView支持点击选中吗?如何使用
from treeview.
- 不是很理解为什么要改成
targetNode.path = parentNode.path + "/" + targetNode. depth
,还有获取的这是什么子节点的位置? - 这个你可以覆盖 ViewHolder 里面的 itemView 的点击事件,这样就不会直接调用
TreeView#onClick
。然后你在TreeViewBinder
的bindView
里覆盖箭头的相关点击事件,让其调用TreeView#onClick
实现节点的折叠或展开操作。 - 支持的,你可以去项目的 actions 里 下载 demo apk 体验,具体实现代码建议翻阅 demo 的 activity。
from treeview.
1、我需要获取每个子节点所在的位置处理其他事件。比如每一层[1,2,4,1,7...]
2、已解决
3、您写的方法:长按一个节点单选之后,换一个子节点长按单选并不会有效果
from treeview.
- 你这个指的是在(原始)数据的位置吧?那你应该拿到 data 后自己去做 indexOf。
- 你可以查看一下 这里。有几种模式,包括多选,多选(选中子节点),单选,无(不设置选择模式)。你这个换一个子节点长按单选没有效果,那么你设置的是单选还是多选?
from treeview.
2:我设置了单选TreeView.SelectionMode.SINGLE,但是选择一个的时候,选择其他的没反应 ,有什么办法选择其他的,取消上一个选中的,在选择目前选择的。或者有什么方法可以获取选中的node
from treeview.
你这个逻辑确实是我没考虑到,后续可能会修改单选模式的逻辑。这几天可能没有空弄哈哈。
from treeview.
拖动子节点,应该是在当前节点下拖动,怎么样才能实现呢
from treeview.
不是很理解你的意思。
不过节点拖动的逻辑确实是有问题,主要表现在无法把一个节点拖动进去一个空的字节点上(后续可能的话我会继续改善)
from treeview.
比如拖动一个子节点,只能在当前父节点下,进行拖动,这样更符合逻辑,实现也更简单,也不需要考虑拖动进去一个空的字节点上。这样符合大多数开发设计
from treeview.
你好,有时间更新吗?目前两个问题
1、单选模式下,选中一个节点,取消其他节点的选中状态
2、只能在当前父节点中拖动,不可以拖动到其他节点
from treeview.
抱歉,目前这几周还是没有时间呢,忙着其他项目。
如果有能力的话,欢迎 PR。
from treeview.
- 已修复。
- 可以看一下
TreeViewBinder#onMoveView
, 能否满足需求?
from treeview.
更新1.3.1版本后,使用refresh()会闪退(我操作list数据,然后更新Treeview的)
FATAL EXCEPTION: main
Process: com.iimt.robotarm, PID: 27477
java.lang.NoSuchMethodError: No static method refresh$default(Lio/github/dingyi222666/view/treeview/TreeView;ZLio/github/dingyi222666/view/treeview/TreeNode;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; in class Lio/github/dingyi222666/view/treeview/TreeView; or its super classes (declaration of 'io.github.dingyi222666.view.treeview.TreeView' appears in /data/data/com.iimt.robotarm/code_cache/.overlay/base.apk/classes32.dex)
at com.iimt.robotarm.treeview.NewAddTreeNodeKt$updateNode$1.invokeSuspend(NewAddTreeNode.kt:198)
from treeview.
你好
1、更新1.3.1的版本后,使用refresh()会闪退
2、单选设置后,其他的有时还是不能取消
3、滑动能否正在同一个节点中滑动
from treeview.
当我拖动子节点为什么targetNode只会得到父节点,能不能给我返回targetposition呢,这样我可以使用Collections.swap交换起始终止节点的位置
from treeview.
抱歉,目前这几周还是没有时间呢(没有写代码的时间)。
如果有能力的话,欢迎 PR。
from treeview.
抱歉,无力继续维护此项目。
from treeview.
Related Issues (9)
- java code HOT 1
- How to build a tree from dynamic data? HOT 31
- Support Leaf of different type than Branch HOT 2
- How can I disable to collapse of root node? HOT 4
- Is it not possible to drag between child nodes? HOT 15
- 动态添加很多数据,闪退 HOT 6
- 刷新方式 HOT 5
- Maintainers Needed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from treeview.