Open glend1 opened 7 years ago
Fix TreeNode.java
public View getView() {
if (mView != null) {
return mView;
}
final View nodeView = getNodeView();
nodeView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));//JR - fix for MATCH_PARENT
final TreeNodeWrapperView nodeWrapperView = new TreeNodeWrapperView(nodeView.getContext(), getContainerStyle());
nodeWrapperView.insertNodeView(nodeView);
mView = nodeWrapperView;
return mView;
}
t.y. use gradle can not edit treenode class. So i import project manual and now it work as expect!
BTW, you can override this method in your ViewHolder for items but not in library's source code.
When you apply a custom
ViewHolder
the Height and Width is not respected. for example;XML layout;
Java class;
Using this example the width from the
RelativeLayout
isn't applied and instead usesWRAP_CONTENT
, however if i set thelayout_width
ofTextView
toMATCH_PARENT
it fills the display as expected using Android Studio as a reference. Why is this? Can this be fixed?The same happens when you attempt to set the
layout_height
forRelativeLayout
nothing happens, insteadTreeView
uses theminHeight
exclusively.layout_width
is a required XML tag. It should work. Why isminHeight
used instead? Can it be altered to uselayout_height
?