iOS:change the way created item view.
This commit is contained in:
parent
05655972e3
commit
f75a6f8071
@ -119,10 +119,10 @@ public class NavBarPlugin extends DoricJavaPlugin {
|
||||
final JSObject jsObject = decoder.decode().asObject();
|
||||
getDoricContext().getDriver().asyncCall(new Callable<Object>() {
|
||||
@Override
|
||||
public Object call() throws Exception {
|
||||
public Object call() {
|
||||
String viewId = jsObject.getProperty("id").asString().value();
|
||||
String type = jsObject.getProperty("type").asString().value();
|
||||
ViewNode node = ViewNode.create(getDoricContext(), type);
|
||||
ViewNode<?> node = ViewNode.create(getDoricContext(), type);
|
||||
node.setId(viewId);
|
||||
node.init(new FrameLayout.LayoutParams(0, 0));
|
||||
node.blend(jsObject.getProperty("props").asObject());
|
||||
@ -162,10 +162,10 @@ public class NavBarPlugin extends DoricJavaPlugin {
|
||||
final JSObject jsObject = decoder.decode().asObject();
|
||||
getDoricContext().getDriver().asyncCall(new Callable<Object>() {
|
||||
@Override
|
||||
public Object call() throws Exception {
|
||||
public Object call() {
|
||||
String viewId = jsObject.getProperty("id").asString().value();
|
||||
String type = jsObject.getProperty("type").asString().value();
|
||||
ViewNode node = ViewNode.create(getDoricContext(), type);
|
||||
ViewNode<?> node = ViewNode.create(getDoricContext(), type);
|
||||
node.setId(viewId);
|
||||
node.init(new FrameLayout.LayoutParams(0, 0));
|
||||
node.blend(jsObject.getProperty("props").asObject());
|
||||
@ -205,10 +205,10 @@ public class NavBarPlugin extends DoricJavaPlugin {
|
||||
final JSObject jsObject = decoder.decode().asObject();
|
||||
getDoricContext().getDriver().asyncCall(new Callable<Object>() {
|
||||
@Override
|
||||
public Object call() throws Exception {
|
||||
public Object call() {
|
||||
String viewId = jsObject.getProperty("id").asString().value();
|
||||
String type = jsObject.getProperty("type").asString().value();
|
||||
ViewNode node = ViewNode.create(getDoricContext(), type);
|
||||
ViewNode<?> node = ViewNode.create(getDoricContext(), type);
|
||||
node.setId(viewId);
|
||||
node.init(new FrameLayout.LayoutParams(0, 0));
|
||||
node.blend(jsObject.getProperty("props").asObject());
|
||||
|
@ -346,7 +346,7 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection
|
||||
[collectionView registerClass:[DoricFlowLayoutViewCell class] forCellWithReuseIdentifier:identifier];
|
||||
DoricFlowLayoutViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
|
||||
if (!cell.viewNode) {
|
||||
DoricFlowLayoutItemNode *itemNode = [[DoricFlowLayoutItemNode alloc] initWithContext:self.doricContext];
|
||||
DoricFlowLayoutItemNode *itemNode = (DoricFlowLayoutItemNode *) [DoricViewNode create:self.doricContext withType:@"FlowLayoutItem"];
|
||||
[itemNode initWithSuperNode:self];
|
||||
cell.viewNode = itemNode;
|
||||
[cell.contentView addSubview:itemNode.view];
|
||||
|
@ -159,7 +159,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
|
||||
DoricTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId ?: @"doriccell"];
|
||||
if (!cell) {
|
||||
cell = [[DoricTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseId ?: @"doriccell"];
|
||||
DoricListItemNode *listItemNode = [[DoricListItemNode alloc] initWithContext:self.doricContext];
|
||||
DoricListItemNode *listItemNode = (DoricListItemNode *) [DoricViewNode create:self.doricContext withType:@"ListItem"];
|
||||
[listItemNode initWithSuperNode:self];
|
||||
cell.doricListItemNode = listItemNode;
|
||||
cell.backgroundColor = [UIColor clearColor];
|
||||
|
@ -100,7 +100,7 @@ - (void)blendView:(UICollectionView *)view forPropName:(NSString *)name propValu
|
||||
|
||||
- (void)afterBlended:(NSDictionary *)props {
|
||||
bool needToScroll = (self.propLoop && !self.loop)
|
||||
|| (![self.renderPageFuncId isEqualToString: self.propRenderPageFuncId])
|
||||
|| (![self.renderPageFuncId isEqualToString:self.propRenderPageFuncId])
|
||||
|| (self.itemCount == 0 && self.propItemCount > 0);
|
||||
|
||||
// handle item count
|
||||
@ -159,7 +159,7 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection
|
||||
NSDictionary *props = model[@"props"];
|
||||
DoricSliderViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"doricCell" forIndexPath:indexPath];
|
||||
if (!cell.doricSlideItemNode) {
|
||||
DoricSlideItemNode *slideItemNode = [[DoricSlideItemNode alloc] initWithContext:self.doricContext];
|
||||
DoricSlideItemNode *slideItemNode = (DoricSlideItemNode *) [DoricViewNode create:self.doricContext withType:@"SlideItem"];
|
||||
[slideItemNode initWithSuperNode:self];
|
||||
cell.doricSlideItemNode = slideItemNode;
|
||||
[cell.contentView addSubview:slideItemNode.view];
|
||||
|
Reference in New Issue
Block a user