Android: optimize code
This commit is contained in:
parent
ba099b6f7e
commit
1fdc84745c
@ -207,7 +207,7 @@ public class NestedSliderNode extends GroupNode<ViewPager> implements ViewPager.
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Insert
|
//Insert
|
||||||
ViewNode newNode = ViewNode.create(getDoricContext(), type);
|
ViewNode<?> newNode = ViewNode.create(getDoricContext(), type);
|
||||||
newNode.setId(id);
|
newNode.setId(id);
|
||||||
newNode.init(this);
|
newNode.init(this);
|
||||||
newNode.blend(model.getProperty("props").asObject());
|
newNode.blend(model.getProperty("props").asObject());
|
||||||
@ -217,7 +217,7 @@ public class NestedSliderNode extends GroupNode<ViewPager> implements ViewPager.
|
|||||||
}
|
}
|
||||||
int size = mChildNodes.size();
|
int size = mChildNodes.size();
|
||||||
for (int idx = mChildViewIds.size(); idx < size; idx++) {
|
for (int idx = mChildViewIds.size(); idx < size; idx++) {
|
||||||
ViewNode viewNode = mChildNodes.remove(mChildViewIds.size());
|
ViewNode<?> viewNode = mChildNodes.remove(mChildViewIds.size());
|
||||||
slideItems.remove(viewNode.getNodeView());
|
slideItems.remove(viewNode.getNodeView());
|
||||||
}
|
}
|
||||||
mView.getAdapter().notifyDataSetChanged();
|
mView.getAdapter().notifyDataSetChanged();
|
||||||
|
@ -60,6 +60,7 @@ class StickDemo extends Panel {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
(new NestedSlider).also(v => {
|
(new NestedSlider).also(v => {
|
||||||
|
v.scrollable = false
|
||||||
this.sliderView = v;
|
this.sliderView = v;
|
||||||
v.onPageSlided = (idx) => {
|
v.onPageSlided = (idx) => {
|
||||||
this.refreshTabs(idx)
|
this.refreshTabs(idx)
|
||||||
|
Reference in New Issue
Block a user