diff --git a/gradle.properties b/gradle.properties index ba8177c..34786db 100644 --- a/gradle.properties +++ b/gradle.properties @@ -46,7 +46,7 @@ org.gradle.jvmargs=-Xmx1536M GROUP=com.alibaba.android ARTIFACT=tangram VERSION=1 -VERSION_NAME=3.1.9.3 +VERSION_NAME=3.1.9.5 PACKAGING_TYPE=aar systemProp.compileSdkVersion=26 systemProp.targetSdkVersion=26 diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/dataparser/concrete/Card.java b/tangram/src/main/java/com/tmall/wireless/tangram/dataparser/concrete/Card.java index 3265820..0572833 100644 --- a/tangram/src/main/java/com/tmall/wireless/tangram/dataparser/concrete/Card.java +++ b/tangram/src/main/java/com/tmall/wireless/tangram/dataparser/concrete/Card.java @@ -30,6 +30,8 @@ import com.alibaba.android.vlayout.layout.FixAreaLayoutHelper; import com.alibaba.android.vlayout.layout.MarginLayoutHelper; +import android.support.v4.util.ArrayMap; + import com.tmall.wireless.tangram.Engine; import com.tmall.wireless.tangram.MVHelper; import com.tmall.wireless.tangram.TangramBuilder; @@ -67,7 +69,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; /** * Basic Card, which will represent LayoutHelpers @@ -123,7 +124,7 @@ public abstract class Card extends ComponentLifecycle { protected BaseCell mFooter; @NonNull - protected ConcurrentHashMap, Card> mChildren = new ConcurrentHashMap<>(); + protected ArrayMap, Card> mChildren = new ArrayMap<>(); @NonNull protected List mCells = new ArrayList<>(); @@ -579,7 +580,7 @@ public List getCells() { } @NonNull - public ConcurrentHashMap, Card> getChildren() { + public ArrayMap, Card> getChildren() { return mChildren; } @@ -1052,8 +1053,8 @@ public JSONArray optJsonArrayParam(String key) { public Card findChildCardById(String id) { if (!mChildren.isEmpty()) { - for (Map.Entry, Card> entry : mChildren.entrySet()) { - Card card = entry.getValue(); + for (int i = 0, size = mChildren.size(); i < size; i++) { + Card card = mChildren.valueAt(i); if (card != null && card.id.equals(id)) { return card; } @@ -1062,7 +1063,7 @@ public Card findChildCardById(String id) { return null; } - public ConcurrentHashMap, Card> getChildrenCards() { + public ArrayMap, Card> getChildrenCards() { return mChildren; } diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/BusSupport.java b/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/BusSupport.java index 700d66f..1e79797 100644 --- a/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/BusSupport.java +++ b/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/BusSupport.java @@ -27,6 +27,7 @@ import org.json.JSONObject; import android.support.annotation.NonNull; +import android.support.v4.util.ArrayMap; import android.text.TextUtils; import java.util.ArrayList; @@ -147,7 +148,7 @@ public static Event obtainEvent() { * returned object's field is filled provided params. */ public static Event obtainEvent(String type, String sourceId, - ConcurrentHashMap args, EventContext eventContext) { + ArrayMap args, EventContext eventContext) { Event event = EventPool.sharedInstance().acquire(); event.type = type; event.sourceId = sourceId; diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/Event.java b/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/Event.java index 79ae10b..6ac9c8a 100644 --- a/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/Event.java +++ b/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/Event.java @@ -24,7 +24,7 @@ package com.tmall.wireless.tangram.eventbus; -import java.util.concurrent.ConcurrentHashMap; +import android.support.v4.util.ArrayMap; /** * Created by longerian on 16/4/26. @@ -44,7 +44,7 @@ public class Event { /** * TangramOp1 args */ - public ConcurrentHashMap args; + public ArrayMap args; /** * Context @@ -52,7 +52,7 @@ public class Event { public EventContext eventContext; public Event() { - args = new ConcurrentHashMap<>(); + args = new ArrayMap<>(); } /** diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/structure/card/SlideCard.java b/tangram/src/main/java/com/tmall/wireless/tangram/structure/card/SlideCard.java index 5192cb9..0a018c3 100644 --- a/tangram/src/main/java/com/tmall/wireless/tangram/structure/card/SlideCard.java +++ b/tangram/src/main/java/com/tmall/wireless/tangram/structure/card/SlideCard.java @@ -33,12 +33,12 @@ import android.support.annotation.Keep; import android.support.annotation.NonNull; +import android.support.v4.util.ArrayMap; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; /** * Created by longerian on 17/1/27. @@ -50,7 +50,7 @@ public class SlideCard extends WrapperCard implements SwipeCard { public static final String KEY_PAGE_COUNT = "pageCount"; - private ConcurrentHashMap args = new ConcurrentHashMap(); + private ArrayMap args = new ArrayMap(); private int mIndex;