Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Revert some public interface to ArrayMap.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAfc committed Jan 8, 2019
1 parent 4bf5ee6 commit 81c838e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -123,7 +124,7 @@ public abstract class Card extends ComponentLifecycle {
protected BaseCell mFooter;

@NonNull
protected ConcurrentHashMap<Range<Integer>, Card> mChildren = new ConcurrentHashMap<>();
protected ArrayMap<Range<Integer>, Card> mChildren = new ArrayMap<>();

@NonNull
protected List<BaseCell> mCells = new ArrayList<>();
Expand Down Expand Up @@ -579,7 +580,7 @@ public List<BaseCell> getCells() {
}

@NonNull
public ConcurrentHashMap<Range<Integer>, Card> getChildren() {
public ArrayMap<Range<Integer>, Card> getChildren() {
return mChildren;
}

Expand Down Expand Up @@ -1052,8 +1053,8 @@ public JSONArray optJsonArrayParam(String key) {

public Card findChildCardById(String id) {
if (!mChildren.isEmpty()) {
for (Map.Entry<Range<Integer>, 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;
}
Expand All @@ -1062,7 +1063,7 @@ public Card findChildCardById(String id) {
return null;
}

public ConcurrentHashMap<Range<Integer>, Card> getChildrenCards() {
public ArrayMap<Range<Integer>, Card> getChildrenCards() {
return mChildren;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String, String> args, EventContext eventContext) {
ArrayMap<String, String> args, EventContext eventContext) {
Event event = EventPool.sharedInstance().acquire();
event.type = type;
event.sourceId = sourceId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -44,15 +44,15 @@ public class Event {
/**
* TangramOp1 args
*/
public ConcurrentHashMap<String, String> args;
public ArrayMap<String, String> args;

/**
* Context
*/
public EventContext eventContext;

public Event() {
args = new ConcurrentHashMap<>();
args = new ArrayMap<>();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -50,7 +50,7 @@ public class SlideCard extends WrapperCard implements SwipeCard {

public static final String KEY_PAGE_COUNT = "pageCount";

private ConcurrentHashMap<String, String> args = new ConcurrentHashMap<String, String>();
private ArrayMap<String, String> args = new ArrayMap<String, String>();

private int mIndex;

Expand Down

0 comments on commit 81c838e

Please sign in to comment.