Java 类android.support.v4.util.ArrayMap 实例源码

项目:boohee_v5.6    文件:BackStackRecord.java   
private void prepareSharedElementTransition(TransitionState state, View sceneRoot, Object sharedElementTransition, Fragment inFragment, Fragment outFragment, boolean isBack, ArrayList<View> sharedElementTargets) {
    final View view = sceneRoot;
    final Object obj = sharedElementTransition;
    final ArrayList<View> arrayList = sharedElementTargets;
    final TransitionState transitionState = state;
    final boolean z = isBack;
    final Fragment fragment = inFragment;
    final Fragment fragment2 = outFragment;
    sceneRoot.getViewTreeObserver().addOnPreDrawListener(new OnPreDrawListener() {
        public boolean onPreDraw() {
            view.getViewTreeObserver().removeOnPreDrawListener(this);
            if (obj != null) {
                FragmentTransitionCompat21.removeTargets(obj, arrayList);
                arrayList.clear();
                ArrayMap<String, View> namedViews = BackStackRecord.this.mapSharedElementsIn(transitionState, z, fragment);
                FragmentTransitionCompat21.setSharedElementTargets(obj, transitionState.nonExistentView, namedViews, arrayList);
                BackStackRecord.this.setEpicenterIn(namedViews, transitionState);
                BackStackRecord.this.callSharedElementEnd(transitionState, fragment, fragment2, z, namedViews);
            }
            return true;
        }
    });
}
项目:weex-uikit    文件:WXListDomObject.java   
@Override
protected Map<String, String> getDefaultStyle() {
    Map<String,String> map = new ArrayMap<>();

    boolean isVertical = true;
    if (parent != null) {
        if (parent.getType() != null) {
            if (parent.getType().equals(WXBasicComponentType.HLIST)) {
                isVertical = false;
            }
        }
    }

    String prop = isVertical ? Constants.Name.HEIGHT : Constants.Name.WIDTH;
    if (getStyles().get(prop) == null &&
        getStyles().get(Constants.Name.FLEX) == null) {
        map.put(Constants.Name.FLEX, "1");
    }

    return map;
}
项目:weex-3d-map    文件:WXListDomObject.java   
@Override
protected Map<String, String> getDefaultStyle() {
    Map<String,String> map = new ArrayMap<>();

    boolean isVertical = true;
    if (parent != null) {
        if (parent.getType() != null) {
            if (parent.getType().equals(WXBasicComponentType.HLIST)) {
                isVertical = false;
            }
        }
    }

    String prop = isVertical ? Constants.Name.HEIGHT : Constants.Name.WIDTH;
    if (getStyles().get(prop) == null &&
        getStyles().get(Constants.Name.FLEX) == null) {
        map.put(Constants.Name.FLEX, "1");
    }

    return map;
}
项目:GitHub    文件:RequestManagerRetriever.java   
private void findAllFragmentsWithViews(
    android.app.FragmentManager fragmentManager, ArrayMap<View, android.app.Fragment> result) {
  int index = 0;
  while (true) {
    tempBundle.putInt(FRAGMENT_INDEX_KEY, index++);
    android.app.Fragment fragment = null;
    try {
      fragment = fragmentManager.getFragment(tempBundle, FRAGMENT_MANAGER_GET_FRAGMENT_KEY);
    } catch (Exception e) {
      // This generates log spam from FragmentManager anyway.
    }
    if (fragment == null) {
      break;
    }
    if (fragment.getView() != null) {
      result.put(fragment.getView(), fragment);
      if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) {
        findAllFragmentsWithViews(fragment.getChildFragmentManager(), result);
      }
    }
  }
}
项目:eBread    文件:ShowDocumentFragmentTest.java   
@Test
public void pauseTest() {
    Class<?> reflected = showDoc.getClass();
    try {
        Method method = reflected.getDeclaredMethod("resetValues");
        method.setAccessible(true);
        method.invoke(showDoc);

        Field pauseBool = reflected.getDeclaredField("boolValues");
        pauseBool.setAccessible(true);
        Assert.assertFalse(((ArrayMap<String, Boolean>) pauseBool.get(showDoc)).get("isPaused"));

        Field field = reflected.getDeclaredField("audioPlayer");
        field.setAccessible(true);
        field.set(showDoc,new MediaPlayer());

        showDoc.pause();
        Assert.assertTrue(((ArrayMap<String, Boolean>) pauseBool.get(showDoc)).get("isPaused"));

    } catch(Exception e){
        assertFalse(true);
    }
}
项目:xlight_android_native    文件:ParticleCloud.java   
private DeviceState fromSimpleDeviceModel(Models.SimpleDevice offlineDevice) {
    Set<String> functions = new HashSet<>();
    Map<String, VariableType> variables = new ArrayMap<>();

    return new DeviceState.DeviceStateBuilder(offlineDevice.id, functions, variables)
            .name(offlineDevice.name)
            .cellular(offlineDevice.cellular)
            .connected(offlineDevice.isConnected)
            .version("")
            .deviceType(ParticleDeviceType.fromInt(offlineDevice.productId))
            .platformId(offlineDevice.platformId)
            .productId(offlineDevice.productId)
            .imei(offlineDevice.imei)
            .currentBuild(offlineDevice.currentBuild)
            .defaultBuild(offlineDevice.defaultBuild)
            .ipAddress(offlineDevice.ipAddress)
            .lastAppName("")
            .status(offlineDevice.status)
            .requiresUpdate(false)
            .lastHeard(offlineDevice.lastHeard)
            .build();
}
项目:weex-uikit    文件:BasicListComponent.java   
/**
 * generate viewtype by component
 *
 * @param component
 * @return
 */
private int generateViewType(WXComponent component) {
  long id;
  try {
    id = Integer.parseInt(component.getDomObject().getRef());
    String type = component.getDomObject().getAttrs().getScope();

    if (!TextUtils.isEmpty(type)) {
      if (mRefToViewType == null) {
        mRefToViewType = new ArrayMap<>();
      }
      if (!mRefToViewType.containsKey(type)) {
        mRefToViewType.put(type, id);
      }
      id = mRefToViewType.get(type);

    }
  } catch (RuntimeException e) {
    WXLogUtils.eTag(TAG, e);
    id = RecyclerView.NO_ID;
    WXLogUtils.e(TAG, "getItemViewType: NO ID, this will crash the whole render system of WXListRecyclerView");
  }
  return (int) id;
}
项目:ucar-weex-core    文件:BasicListComponent.java   
/**
 * generate viewtype by component
 *
 * @param component
 * @return
 */
private int generateViewType(WXComponent component) {
  long id;
  try {
    id = Integer.parseInt(component.getDomObject().getRef());
    String type = component.getDomObject().getAttrs().getScope();

    if (!TextUtils.isEmpty(type)) {
      if (mRefToViewType == null) {
        mRefToViewType = new ArrayMap<>();
      }
      if (!mRefToViewType.containsKey(type)) {
        mRefToViewType.put(type, id);
      }
      id = mRefToViewType.get(type);

    }
  } catch (RuntimeException e) {
    WXLogUtils.eTag(TAG, e);
    id = RecyclerView.NO_ID;
    WXLogUtils.e(TAG, "getItemViewType: NO ID, this will crash the whole render system of WXListRecyclerView");
  }
  return (int) id;
}
项目:eBread    文件:SettingTTSFragment.java   
/**
 * Load voice settings from file and set radio buttons
 * @throws IOException
 * @throws XmlPullParserException
 */
private void loadData() throws IOException, XmlPullParserException {
    ArrayMap<String, String> values = settingsManager.getSettings();
    voice = values.get("id");
    Voice loadedVoice = searchVoice(voice);
    if(loadedVoice == null){
        Toast.makeText(getContext(), "Errore caricamento impostazioni", Toast.LENGTH_SHORT).show();
        return;
    }
    // Language/Locale
    language = loadedVoice.get("locale");
    spnLanguage.setSelection(((ArrayAdapter) spnLanguage.getAdapter()).getPosition(language));
    // Gender
    gender = loadedVoice.get("gender");
    if(gender.equals("male"))
        rbM.setChecked(true);
    else
        rbF.setChecked(true);
    updateChoice();
    // Voice
    int pos=((ArrayAdapter) spnVoice.getAdapter()).getPosition(voice);
    spnVoice.setSelection(pos);
    // Speed
    speed = Float.valueOf(values.get("speed"));
    spnSpeed.setSelection(Math.round((speed - 1) / 0.25f));
}
项目:yyox    文件:BaseChatActivity.java   
private void bindConnect() {

        refreshListAndNotifyData(presenter.getLastMessages(dbMessageCount));
        Bundle bundle = new Bundle();
        Map<String, String> map = new ArrayMap<>();
        map.put("appid", SPUtils.getAppid());
        map.put("platform", "Android");
        map.put("token", SPUtils.getUserToken());
        map.put("version", "2.2");
        map.put("uuid", Utils.getUUID(mActivity));
        bundle.putString("query", com.kf5.sdk.im.utils.Utils.getMapAppend(map));
        bundle.putString("url", SPUtils.getChatUrl());
        presenter.initParams(bundle);
        presenter.connect();

    }
项目:easyfilemanager    文件:MultiMap.java   
/**
 * Construct a new map, that contains a unique String key for each value.
 * <p>
 * Current algorithm will construct unique key by appending a unique position number to
 * key's toString() value
 *
 * @return a {@link Map}
 */
public ArrayMap<String, V> getUniqueMap() {
    ArrayMap<String, V> uniqueMap = new ArrayMap<>();
    for (Map.Entry<K, List<V>> entry : mInternalMap.entrySet()) {
        int count = 1;
        for (V value : entry.getValue()) {
            if (count == 1) {
                addUniqueEntry(uniqueMap, entry.getKey().toString(), value);
            } else {
                // append unique number to key for each value
                addUniqueEntry(uniqueMap, String.format("%s%d", entry.getKey(), count), value);
            }
            count++;
        }
    }
    return uniqueMap;
}
项目:ExpandRecyclerView    文件:RecyclerViewGroupAdapter.java   
public RecyclerViewGroupAdapter(Context context, List<T> dataList
        , @LayoutRes int[] typeLayoutIds, Integer groupType, RecyclerViewGroupTypeProcessor<T> groupTypeProcessor) {
    mContext = context;
    if (groupType != null && groupType >= 0) mGroupViewType = groupType;
    mDataList = dataList;
    if (typeLayoutIds != null && typeLayoutIds.length != 0) {
        mTypeLayoutIds = new ArrayMap<>();
        int typeSize = typeLayoutIds.length;
        for (int i = 0; i < typeSize; i++) {
            mTypeLayoutIds.put(i, typeLayoutIds[i]);
        }
    }
    mGroupTypeProcessor = groupTypeProcessor;

    initGroup();
}
项目:ExpandRecyclerView    文件:RecyclerViewGroupAdapter.java   
/**
 * init group info for group count, position map and count map
 */
private void initGroup() {
    mGroupPositionMap = new ArrayMap<>();
    mGroupItemCountMap = new ArrayMap<>();
    mGroupCount = 0;

    int lastGroupPosition = 0;

    if (mDataList != null && !mDataList.isEmpty()) {
        int dataSize = mDataList.size();
        for (int i = 0; i < dataSize; i++) {
            if (getItemViewType(i) == mGroupViewType) {
                mGroupPositionMap.put(mGroupCount, i);
                lastGroupPosition = i;

                if (mGroupCount != 0) {
                    mGroupItemCountMap.put(mGroupCount - 1, i - mGroupPositionMap.get(mGroupCount - 1));
                }
                mGroupCount++;
            }
        }
        mGroupItemCountMap.put(mGroupCount - 1, dataSize - lastGroupPosition);
    }
}
项目:ExpandRecyclerView    文件:RecyclerViewGroupAdapter.java   
/**
 * find out the child position of its group
 *
 * @param position adapter item position
 * @return
 */
private int findChildGroupPosition(int position) {

    if (mChildGroupPositionCacheMap == null)
        mChildGroupPositionCacheMap = new ArrayMap<>();
    if (mDataList == null || mDataList.isEmpty()) return -1;
    int tempPosition = mDataList.size();
    int groupPosition = 0;

    if (mChildGroupPositionCacheMap.containsKey(position))
        return mChildGroupPositionCacheMap.get(position);
    for (int i = mGroupCount; i > 0; i--) {
        if (tempPosition <= position) {
            groupPosition = i;
            mChildGroupPositionCacheMap.put(position, groupPosition);
            break;
        }

        tempPosition -= mGroupItemCountMap.get(i - 1);
    }
    return groupPosition;
}
项目:ExpandRecyclerView    文件:RecyclerViewGroupAdapter.java   
/**
 * find out the child position of its group
 *
 * @param groupPosition the group position of the group list
 * @param position      adapter item position
 * @return
 */
private int findChildPosition(int groupPosition, int position) {

    if (mChildItemPositionCacheMap == null)
        mChildItemPositionCacheMap = new ArrayMap<>();
    if (mDataList == null || mDataList.isEmpty()) return -1;
    int positionInGroup = 0;
    if (mChildItemPositionCacheMap.containsKey(position))
        return mChildItemPositionCacheMap.get(position);

    int groupItemCount = mGroupItemCountMap.get(groupPosition);
    int groupRealPosition = mGroupPositionMap.get(groupPosition);
    positionInGroup = (position - groupRealPosition) % groupItemCount - 1;
    mChildItemPositionCacheMap.put(position, positionInGroup);

    return positionInGroup;

}
项目:eBread    文件:SettingManager.java   
/***
 * Public method that read information about theme settings from XML file
 * @param parser                    the current parser used to parse the XML file
 * @return ThemeSetting contains loaded settings
 * @throws XmlPullParserException
 * @throws IOException
 */
private ThemeSetting readThemeSetting(XmlPullParser parser) throws XmlPullParserException, IOException {
    parser.require(XmlPullParser.START_TAG, null, "themesetting");

    ArrayMap<String, String> newValues = new ArrayMap<>();
    while (parser.next() != XmlPullParser.END_TAG) {
        if (parser.getEventType() != XmlPullParser.START_TAG) {
            continue;
        }
        String name = parser.getName();
        if (name.equals("font")) {
            newValues.put("font", readText(parser));
        } else if (name.equals("palette")) {
            newValues.put("palette", readText(parser));
        } else if (name.equals("highlight")) {
            newValues.put("highlight", readText(parser));
        }
    }

    ThemeSetting themesetting = new ThemeSetting();
    themesetting.changeSetting(newValues);
    return themesetting;
}
项目:zabbkit-android    文件:LoginActivity.java   
private void performLogin() {
    if (!TextUtils.isEmpty(mNameView.getText().toString())
            && !TextUtils.isEmpty(mPasswordView.getText().toString())
            && !TextUtils.isEmpty(mUrlView.getText().toString())) {
        final String userName = mNameView.getText().toString().trim();
        final String userPassword = mPasswordView.getText().toString();
        final Map<String, Object> params = new ArrayMap<String, Object>();
        params.put(Constants.PREFS_USER, userName);
        params.put(Constants.PREFS_PASSWORD, userPassword);

        showDialog();
        Communicator.getInstance().login(params,
                collectUrl(mUrlView.getText().toString()), this);
    } else {
        DialogHelper.showAlertDialog(LoginActivity.this, getString(R.string.fill_fields));
    }
}
项目:godlibrary    文件:ExpandableListViewCheckAdapter.java   
public ArrayMap<Integer, long[]> getIds() {
    ArrayMap<Integer, long[]> arrayMap = new ArrayMap<>();
    if (choiceMode == ListView.CHOICE_MODE_MULTIPLE) {
        for (Map.Entry<Integer, SparseBooleanArray> entry : multipleIds.entrySet()) {
            List<Integer> l = new ArrayList<>();
            SparseBooleanArray ids = entry.getValue();
            for (int i = 0; i < ids.size(); i++) {
                if (ids.valueAt(i)) {
                    l.add(ids.keyAt(i));
                }
            }
            long[] _ids = new long[l.size()];
            for (int i = 0; i < l.size(); i++) {
                _ids[i] = l.get(i);
            }
            arrayMap.put(entry.getKey(), _ids);
        }
    }
    return arrayMap;
}
项目:weex-3d-map    文件:WXListComponent.java   
/**
 * generate viewtype by component
 * @param component
 * @return
 */
private int generateViewType(WXComponent component) {
    long id;
    try {
        id = Integer.parseInt(component.getDomObject().getRef());
        String type = component.getDomObject().getAttrs().getScope();

        if (!TextUtils.isEmpty(type)) {
            if (mRefToViewType == null) {
                mRefToViewType = new ArrayMap<>();
            }
            if (!mRefToViewType.containsKey(type)) {
                mRefToViewType.put(type, id);
            }
            id = mRefToViewType.get(type);

        }
    } catch (RuntimeException e) {
      WXLogUtils.eTag(TAG, e);
      id = RecyclerView.NO_ID;
      WXLogUtils.e(TAG, "getItemViewType: NO ID, this will crash the whole render system of WXListRecyclerView");
    }
    return (int) id;
}
项目:zabbkit-android    文件:TriggersRequestService.java   
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
    for (DataEvent dataEvent : dataEvents) {
        if (dataEvent.getType() == DataEvent.TYPE_CHANGED) {
            if (ZabbkitConstants.PATH_DATA_REQUEST.equals(dataEvent.getDataItem().getUri().getPath())) {

                Map<String, Object> params = new ArrayMap<String, Object>();

                params.put(Constants.REQ_SELECT_HOSTS, new String[]{
                        Constants.REQ_VAL_HOST_ID, Constants.REQ_VAL_HOST});
                params.put(Constants.REQ_SORT_FIELD, Constants.REQ_VAL_DESCRIPTION);
                params.put(Constants.REQ_OUTPUT, Constants.REQ_VAL_EXTEND);
                params.put(Constants.REQ_MONITORED, true);
                params.put(Constants.REQ_EXPAND_DESCRIPTION, true);
                Communicator.getInstance().getTriggers(params, this);

            }
        }
    }
}
项目:vlayout    文件:RangeGridLayoutHelper.java   
public GridRangeStyle findSiblingStyleByPosition(int position) {
    GridRangeStyle rangeStyle = null;
    if (mParent != null) {
        ArrayMap<Range<Integer>, GridRangeStyle> siblings = mParent.mChildren;
        for (int i = 0, size = siblings.size(); i < size; i++) {
            Range range = siblings.keyAt(i);
            if (range.contains(position)) {
                GridRangeStyle childRangeStyle = siblings.valueAt(i);
                if (!childRangeStyle.equals(this)) {
                    rangeStyle = childRangeStyle;
                }
                break;
            }
        }
    }
    return rangeStyle;
}
项目:chromium-for-android-56-debug-video    文件:CastMessageHandler.java   
/**
 * Initializes a new {@link CastMessageHandler} instance.
 * @param session  The {@link CastSession} for communicating with the Cast SDK.
 * @param provider The {@link CastMediaRouteProvider} for communicating with the page.
 */
public CastMessageHandler(CastMediaRouteProvider provider) {
    mRouteProvider = provider;
    mRequests = new SparseArray<RequestRecord>();
    mStopRequests = new ArrayMap<String, Queue<Integer>>();
    mVolumeRequests = new ArrayDeque<RequestRecord>();
    mHandler = new Handler();

    synchronized (INIT_LOCK) {
        if (sMediaOverloadedMessageTypes == null) {
            sMediaOverloadedMessageTypes = new HashMap<String, String>();
            sMediaOverloadedMessageTypes.put("STOP_MEDIA", "STOP");
            sMediaOverloadedMessageTypes.put("MEDIA_SET_VOLUME", "SET_VOLUME");
            sMediaOverloadedMessageTypes.put("MEDIA_GET_STATUS", "GET_STATUS");
        }
    }
}
项目:AgentWebX5    文件:JsInterfaceHolderImpl.java   
@Override
public JsInterfaceHolder addJavaObjects(ArrayMap<String, Object> maps) {



    if(!checkSecurity()){
        return this;
    }
    Set<Map.Entry<String, Object>> sets = maps.entrySet();
    for (Map.Entry<String, Object> mEntry : sets) {


        Object v = mEntry.getValue();
        boolean t = checkObject(v);
        if (!t)
            throw new JsInterfaceObjectException("this object has not offer method javascript to call ,please check addJavascriptInterface annotation was be added");

        else
            addJavaObjectDirect(mEntry.getKey(), v);
    }

    return this;
}
项目:Tangram-Android    文件:LinearScrollView.java   
@Override
public void onMotionEvent(View view, MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_UP) {
        if (lSCell != null && lSCell.serviceManager != null) {
            BusSupport busSupport = lSCell.serviceManager.getService(BusSupport.class);
            ArrayMap<String, String> params = new ArrayMap<String, String>();
            params.put("spmcOffset", String.valueOf(lSCell.cells.size()));
            busSupport.post(BusSupport.obtainEvent("onMotionEvent", null, params, null));
        }
    }
}
项目:Reer    文件:starredFragment.java   
public void loadSQLiteData() {
    {
        SQLiteHandle mSqLiteHandle = new SQLiteHandle(getActivity());
        Cursor cursor = mSqLiteHandle.queryUnappearstaredItems();

        if (cursor != null) {

            if (cursor != null || cursor.getCount() != 0 || cursor.getCount() != -1) {
                Log.i("cursor", "存在");

                while (cursor.moveToNext()) {
                    Map<String, String> map = new ArrayMap<String, String>();

                    map.put("title", cursor.getString(cursor.getColumnIndex("ItemTitle")));
                    map.put("pubdate", cursor.getString(cursor.getColumnIndex("ItemPubdate")));
                    map.put("description", cursor.getString(cursor.getColumnIndex("ItemDescription")));
                    map.put("rssname", cursor.getString(cursor.getColumnIndex("RssName")));

                    Log.i("appear-item", map.get("title") + ":" + map.get("pubdate"));
                    mapList.add(map);
                }
            }
            cursor.close();

            mSqLiteHandle.updateUnAppearStaredItems();
        }
        mSqLiteHandle.dbClose();
        mSqLiteHandle = null;
    }
}
项目:GitHub    文件:NodeAdapter.java   
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
    holder.tvTitle.setText(mMap.keyAt(position));
    holder.flContent.removeAllViews();
    ArrayMap<String,String> mNodeBlock = mMap.valueAt(position);
    for (ArrayMap.Entry<String,String> node : mNodeBlock.entrySet()) {
        TextView tvNode = new TextView(mContext);
        tvNode.setText(node.getValue());
        tvNode.setTextColor(ContextCompat.getColor(mContext, R.color.colorText));
        tvNode.setPadding(SystemUtil.dp2px(6f), SystemUtil.dp2px(6f), SystemUtil.dp2px(6f), SystemUtil.dp2px(6f));
        tvNode.setOnClickListener(new OnNodeClickListener(node.getKey()));
        holder.flContent.addView(tvNode);
    }
}
项目:weex-uikit    文件:PesudoStatus.java   
public Map<String,Object> updateStatusAndGetUpdateStyles(String clzName,
                                                         boolean status,
                                                         Map<String, Map<String,Object>> pesudoStyles,
                                                         Map<String,Object> originalStyles){
  String prevStatusesStr = getStatuses();//before change
  setStatus(clzName,status);
  String statusesStr = getStatuses();//after change

  Map<String,Object> updateStyles = pesudoStyles.get(statusesStr);
  Map<String,Object> prevUpdateStyles = pesudoStyles.get(prevStatusesStr);

  /**
   * NEW INSTANCE, DO NOT USE MAP OBJECT FROM pesudoStyles
   */
  Map<String,Object> resultStyles = new ArrayMap<>();
  if(prevStatusesStr != null){
    resultStyles.putAll(prevUpdateStyles);
  }

  //reset
  for (String key : resultStyles.keySet()) {
    resultStyles.put(key, originalStyles.containsKey(key) ? originalStyles.get(key) : "");
  }

  //apply new update
  if(updateStyles != null) {
    for (Map.Entry<String, Object> entry : updateStyles.entrySet()) {
      resultStyles.put(entry.getKey(), entry.getValue());
    }
  }
  return resultStyles;
}
项目:eBread    文件:SettingManager.java   
public ArrayMap<String, String> getSettings() {
    ArrayMap<String, String> allSetts= new ArrayMap<>();
    allSetts.putAll((SimpleArrayMap<String,String>) settings.get(0).getSpecs());
    allSetts.putAll((SimpleArrayMap<String,String>) settings.get(1).getSpecs());
    allSetts.putAll((SimpleArrayMap<String,String>) settings.get(2).getSpecs());
    return allSetts;
}
项目:boohee_v5.6    文件:BackStackRecord.java   
private ArrayMap<String, View> mapEnteringSharedElements(TransitionState state, Fragment inFragment, boolean isBack) {
    ArrayMap<String, View> namedViews = new ArrayMap();
    View root = inFragment.getView();
    if (root == null || this.mSharedElementSourceNames == null) {
        return namedViews;
    }
    FragmentTransitionCompat21.findNamedViews(namedViews, root);
    if (isBack) {
        return remapNames(this.mSharedElementSourceNames, this.mSharedElementTargetNames, namedViews);
    }
    namedViews.retainAll(this.mSharedElementTargetNames);
    return namedViews;
}
项目:Tangram-Android    文件:LinearScrollView.java   
@Override
public void onOverScroll(View view, float offset) {
    if (lSCell != null && lSCell.serviceManager != null) {
        BusSupport busSupport = lSCell.serviceManager.getService(BusSupport.class);
        ArrayMap<String, String> params = new ArrayMap<String, String>();
        params.put("offset", String.valueOf(offset));
        busSupport.post(BusSupport.obtainEvent("onOverScroll", null, params, null));
    }
}
项目:eBread    文件:SettingTTSFragment.java   
/**
 * Save setting data to file by settingManager
 */
private void save(){
    ArrayMap<String, String> values = getVoiceSpec(voice);
    values.put("speed", Float.toString(speed));
    try {
        settingsManager.changeFattsSetting(values);
        settingsManager.saveSettings(getContext());
        Toast.makeText(getContext(), "Impostazioni salvate", Toast.LENGTH_SHORT).show();
    }catch(IOException e){
        Toast.makeText(getContext(), "Errore salvataggio", Toast.LENGTH_SHORT).show();
    }
}
项目:xlight_android_native    文件:Parcelables.java   
public static Map<String, String> readStringMap(Parcel parcel) {
    Map<String, String> map = new ArrayMap<>();
    Bundle bundle = parcel.readBundle(Parcelables.class.getClassLoader());
    for (String key : bundle.keySet()) {
        map.put(key, bundle.getString(key));
    }
    return map;
}
项目:eBread    文件:SettingManagerInstrumentedTest.java   
@Before
public void setUp() throws Exception {
    context = InstrumentationRegistry.getTargetContext();
    settingManager = new SettingManager();

    settingManager.loadSettings(context);

    mockedMap = new ArrayMap<>();
    mockedMap2 = new ArrayMap<>();

    mockedMap.put("key0","value");
    mockedMap.put("key1","value");
    mockedMap.put("key2","value");
}
项目:yyox    文件:RatingActivity.java   
@Override
public void onClick(View v) {
    int id = v.getId();
    if (id == R.id.kf5_return_img) {
        finish();
    } else if (id == R.id.kf5_right_text_view) {
        Map<String, String> dataMap = new ArrayMap<>();
        dataMap.put(Field.CONTENT, mETContent.getText().toString());
        dataMap.put(Field.TICKET_ID, String.valueOf(mTicketId));
        dataMap.put(Field.RATING, String.valueOf(mRatingStatus));
        showDialog = true;
        presenter.rating(dataMap);
    }
}
项目:firefox-tv    文件:ErrorPage.java   
public static void loadErrorPage(final AmazonWebView webView, final String desiredURL, final int errorCode) {
    final Pair<Integer, Integer> errorResourceIDs = errorDescriptionMap.get(errorCode);

    if (errorResourceIDs == null) {
        throw new IllegalArgumentException("Cannot load error description for unsupported errorcode=" + errorCode);
    }

    // This is quite hacky: ideally we'd just load the css file directly using a '<link rel="stylesheet"'.
    // However WebView thinks it's still loading the original page, which can be an https:// page.
    // If mixed content blocking is enabled (which is probably what we want in Focus), then webkit
    // will block file:///android_res/ links from being loaded - which blocks our css from being loaded.
    // We could hack around that by enabling mixed content when loading an error page (and reenabling it
    // once that's loaded), but doing that correctly and reliably isn't particularly simple. Loading
    // the css data and stuffing it into our html is much simpler, especially since we're already doing
    // string substitutions.
    // As an added bonus: file:/// URIs are broken if the app-ID != app package, see:
    // https://code.google.com/p/android/issues/detail?id=211768 (this breaks loading css via file:///
    // references when running debug builds, and probably klar too) - which means this wouldn't
    // be possible even if we hacked around the mixed content issues.
    final String cssString = HtmlLoader.loadResourceFile(webView.getContext(), R.raw.errorpage_style, null);

    final Map<String, String> substitutionMap = new ArrayMap<>();

    final Resources resources = webView.getContext().getResources();

    substitutionMap.put("%page-title%", resources.getString(R.string.errorpage_title));
    substitutionMap.put("%button%", resources.getString(R.string.errorpage_refresh));

    substitutionMap.put("%messageShort%", resources.getString(errorResourceIDs.first));
    substitutionMap.put("%messageLong%", resources.getString(errorResourceIDs.second, desiredURL));

    substitutionMap.put("%css%", cssString);

    final String errorPage = HtmlLoader.loadResourceFile(webView.getContext(), R.raw.errorpage, substitutionMap);

    // We could load the raw html file directly into the webview using a file:///android_res/
    // URI - however we'd then need to do some JS hacking to do our String substitutions. Moreover
    // we'd have to deal with the mixed-content issues detailed above in that case.
    webView.loadDataWithBaseURL(desiredURL, errorPage, "text/html", "UTF8", desiredURL);
}
项目:yyox    文件:FeedBackDetailsActivity.java   
@Override
    public void submitData() {

        Comment comment = new Comment();
        comment.setContent(mETContent.getText().toString());
        comment.setCreatedAt(System.currentTimeMillis() / 1000);
        comment.setMessageStatus(MessageStatus.SENDING);
//        comment.setAuthorName(!TextUtils.isEmpty(SPUtils.getUserName()) ? SPUtils.getUserName() : "Android SDK");
        comment.setAuthorName(nickName);
        List<Attachment> attachments = new ArrayList<>();
        for (int i = 0; i < getFileList().size(); i++) {
            Attachment attachment = new Attachment();
            attachment.setContent_url(getFileList().get(i).getAbsolutePath());
            attachment.setName(getFileList().get(i).getName());
            attachments.add(attachment);
        }
        comment.setAttachmentList(attachments);
        mCommentList.add(comment);
        commentPosition = mCommentList.indexOf(comment);
        mListView.setSelection(mCommentList.size() - 1);
        showDialog = false;
        String content = mETContent.getText().toString();
        Map<String, String> map = new ArrayMap<>();
        map.put(ParamsKey.CONTENT, content);
        map.put(ParamsKey.TICKET_ID, String.valueOf(ticket_id));
        mETContent.setText("");
        presenter.replayTicket(map);
    }
项目:yyox    文件:FeedBackActivity.java   
@Override
public Map<String, String> getDataMap() {
    Map<String, String> map = new ArrayMap<>();
    map.put(ParamsKey.TITLE, SPUtils.getTicketTitle());
    map.put(ParamsKey.CONTENT, mETContent.getText().toString());
    return map;
}
项目:yyox    文件:HelpCenterTypeChildPresenter.java   
@Override
public void getPostListById(HelpCenterRequestType helpCenterRequestType) {
    Map<String, String> map = new ArrayMap<>();
    map.put(Field.FORUM_ID, String.valueOf(getMvpView().getPostId()));
    map.putAll(getMvpView().getCustomMap());
    HelpCenterTypeChildCase.RequestCase requestCase = new HelpCenterTypeChildCase.RequestCase(helpCenterRequestType, map);
    dealData(requestCase);
}
项目:ucar-weex-core    文件:PesudoStatus.java   
public Map<String,Object> updateStatusAndGetUpdateStyles(String clzName,
                                                         boolean status,
                                                         Map<String, Map<String,Object>> pesudoStyles,
                                                         Map<String,Object> originalStyles){
  String prevStatusesStr = getStatuses();//before change
  setStatus(clzName,status);
  String statusesStr = getStatuses();//after change

  Map<String,Object> updateStyles = pesudoStyles.get(statusesStr);
  Map<String,Object> prevUpdateStyles = pesudoStyles.get(prevStatusesStr);

  /**
   * NEW INSTANCE, DO NOT USE MAP OBJECT FROM pesudoStyles
   */
  Map<String,Object> resultStyles = new ArrayMap<>();
  if(prevUpdateStyles != null){
    resultStyles.putAll(prevUpdateStyles);
  }

  //reset
  for (String key : resultStyles.keySet()) {
    resultStyles.put(key, originalStyles.containsKey(key) ? originalStyles.get(key) : "");
  }

  //apply new update
  if(updateStyles != null) {
    for (Map.Entry<String, Object> entry : updateStyles.entrySet()) {
      resultStyles.put(entry.getKey(), entry.getValue());
    }
  }
  return resultStyles;
}
项目:letv    文件:BackStackRecord.java   
private void setNameOverrides(TransitionState state, ArrayMap<String, View> namedViews, boolean isEnd) {
    int count = namedViews.size();
    for (int i = 0; i < count; i++) {
        String source = (String) namedViews.keyAt(i);
        String target = FragmentTransitionCompat21.getTransitionName((View) namedViews.valueAt(i));
        if (isEnd) {
            setNameOverride(state.nameOverrides, source, target);
        } else {
            setNameOverride(state.nameOverrides, target, source);
        }
    }
}