當前位置: 首頁>>代碼示例>>Java>>正文


Java ArrayMap.get方法代碼示例

本文整理匯總了Java中android.support.v4.util.ArrayMap.get方法的典型用法代碼示例。如果您正苦於以下問題:Java ArrayMap.get方法的具體用法?Java ArrayMap.get怎麽用?Java ArrayMap.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.util.ArrayMap的用法示例。


在下文中一共展示了ArrayMap.get方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadData

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/**
 * 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));
}
 
開發者ID:Visions-Team,項目名稱:eBread,代碼行數:31,代碼來源:SettingTTSFragment.java

示例2: getCode

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
public CodeReader getCode(String type) {
    CodeReader ret = null;

    for (int i = 0, size = mCodeReaders.length; i < size; i++) {
        int tabIndex = i;
        ArrayMap<String, CodeReader> viewCodes = mCodeReaders[tabIndex];
        ArrayMap<String, Integer> codes = mUiTab[tabIndex];
        if (viewCodes != null && codes != null && viewCodes.containsKey(type) && codes.containsKey(type)) {
            if (null != codes) {
                ret = viewCodes.get(type);
                ret.seek(codes.get(type));
            } else {
                Log.e(TAG, "getCode type invalide type:" + type + "  total size:");
            }
            break;
        }
    }
    return ret;
}
 
開發者ID:alibaba,項目名稱:Virtualview-Android,代碼行數:20,代碼來源:UiCodeLoader.java

示例3: changeSetting

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/**
 * Updates settings by using an ArrayMap of key-value pairs
 *
 * @param settingsChanged ArrayMap passed as parameter that contains changed values
 */
@Override
public void changeSetting(ArrayMap<String, String> settingsChanged){
    String newSize = settingsChanged.get("size");
    String newSpacing = settingsChanged.get("spacing");
    String newLineSpacing = settingsChanged.get("lineSpacing");
    size = newSize != null ? Integer.parseInt(newSize) : size;
    spacing = newSpacing != null ? Integer.parseInt(newSpacing) : spacing;
    lineSpacing = newLineSpacing != null ? Integer.parseInt(newLineSpacing) : lineSpacing;
}
 
開發者ID:Visions-Team,項目名稱:eBread,代碼行數:15,代碼來源:TextSetting.java

示例4: changeSetting

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/**
 * Public method that changes the Setting's private values
 *
 * @param settingsChanged ArrayMap containing key-value pairs of changed settings
 */
@Override
public void changeSetting(ArrayMap<String, String> settingsChanged){
    String newFont = settingsChanged.get("font");
    String newPalette = settingsChanged.get("palette");
    String newHighlight = settingsChanged.get("highlight");
    font = newFont != null ? newFont : font;
    palette = newPalette != null ? newPalette : palette;
    highlight = newHighlight != null ? newHighlight : highlight;
}
 
開發者ID:Visions-Team,項目名稱:eBread,代碼行數:15,代碼來源:ThemeSetting.java

示例5: changeSetting

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/**
 * Public method that changes the Setting's private values
 *
 * @param settingsChanged ArrayMap containing key-value pairs of changed settings
 */
@Override
public void changeSetting(ArrayMap<String, String> settingsChanged){
    String newId = settingsChanged.get("id");
    String newLanguage = settingsChanged.get("language");
    String newGender = settingsChanged.get("gender");
    String newSpeed = settingsChanged.get("speed");
    id = newId != null ? newId : id;
    language = newLanguage != null ? newLanguage : language;
    gender = newGender != null ? newGender : gender;
    speed = newSpeed != null ? newSpeed : speed;
}
 
開發者ID:Visions-Team,項目名稱:eBread,代碼行數:17,代碼來源:FattsSetting.java

示例6: loadData

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/**
 * Set checked the radio buttons according to saved settings
 * @throws IOException
 * @throws XmlPullParserException
 */
private void loadData() throws IOException, XmlPullParserException {
    ArrayMap<String, String> values = settingsManager.getSettings();
    String selFont = values.get("font");
    String selPalette = values.get("palette");
    String setHighlight = values.get("highlight");
    highlight = setHighlight;
    // Load font
    int pos = ((ArrayAdapter<String>) spnFont.getAdapter()).getPosition(selFont);
    spnFont.setSelection(pos);
    // Load palette
    switch(selPalette){
        case "Rainbow":
            setRadioButton(rbTR);
            break;
        case "Pale cream - dark blue":
            setRadioButton(rbTP);
            break;
        case "Rounded letters":
            setRadioButton(rbTRL);
        case "Classic":
            setRadioButton(rbTC);
            break;
    }
    // Load highlight
    switch(setHighlight) {
        case "underline":
            setRadioButton(rbUL);
            break;
        case "background":
            setRadioButton(rbBG);
            break;
    }
}
 
開發者ID:Visions-Team,項目名稱:eBread,代碼行數:39,代碼來源:SettingThemeFragment.java

示例7: setEpicenterIn

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
private void setEpicenterIn(ArrayMap<String, View> namedViews, TransitionState state) {
    if (this.mSharedElementTargetNames != null && !namedViews.isEmpty()) {
        View epicenter = (View) namedViews.get(this.mSharedElementTargetNames.get(0));
        if (epicenter != null) {
            state.enteringEpicenterView.epicenter = epicenter;
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:9,代碼來源:BackStackRecord.java

示例8: remapNames

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
private static ArrayMap<String, View> remapNames(ArrayList<String> inMap, ArrayList<String> toGoInMap, ArrayMap<String, View> namedViews) {
    if (namedViews.isEmpty()) {
        return namedViews;
    }
    ArrayMap<String, View> remappedViews = new ArrayMap();
    int numKeys = inMap.size();
    for (int i = 0; i < numKeys; i++) {
        View view = (View) namedViews.get(inMap.get(i));
        if (view != null) {
            remappedViews.put(toGoInMap.get(i), view);
        }
    }
    return remappedViews;
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:15,代碼來源:BackStackRecord.java

示例9: setBackNameOverrides

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
private void setBackNameOverrides(TransitionState state, ArrayMap<String, View> namedViews, boolean isEnd) {
    int count = this.mSharedElementTargetNames == null ? 0 : this.mSharedElementTargetNames.size();
    for (int i = 0; i < count; i++) {
        String source = (String) this.mSharedElementSourceNames.get(i);
        View view = (View) namedViews.get((String) this.mSharedElementTargetNames.get(i));
        if (view != null) {
            String target = FragmentTransitionCompat21.getTransitionName(view);
            if (isEnd) {
                setNameOverride(state.nameOverrides, source, target);
            } else {
                setNameOverride(state.nameOverrides, target, source);
            }
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:16,代碼來源:BackStackRecord.java

示例10: setLimitMap

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
public void setLimitMap(ArrayMap arrayMap) {
        Object value = arrayMap.get("TurnLeftSideslip");
        if (value != null) {
            if (value instanceof TurnLeftSideslip) {
                leftSideslip = true;
                leftAutoClose = ((TurnLeftSideslip) value).autoClose();
                mLeftIntRes = ((TurnLeftSideslip) value).value();
//                setLeftView(((TurnLeftSideslip) value).value());
            }
        }
        value = arrayMap.get("TurnRightSideslip");
        if (value != null) {
            if (value instanceof TurnRightSideslip) {
                rightSideslip = true;
                mRightIntRes = ((TurnRightSideslip) value).value();
            }
        }
        value = arrayMap.get("LongTouch");
        if (value != null) {
            if (value instanceof LongTouch) {
                longPress = true;
            }
        }
        value = arrayMap.get("Drag");
        if (value != null) {
            if (value instanceof Drag) {
                drag = true;
//                swap = ((Drag) value).swap();
                swap = true;
            }
        }
    }
 
開發者ID:qinhehu,項目名稱:Gesture,代碼行數:33,代碼來源:ItemTouchListener.java

示例11: loadFromBuffer

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
public boolean loadFromBuffer(CodeReader reader, int pageId, int patchVersion) {
    boolean ret = true;

    int tabIndex = pageId;
    if (tabIndex < Common.MAX_TAB_SIZE) {
        ArrayMap<String, CodeReader> typeToCodeReader = mCodeReaders[tabIndex];
        if (null == typeToCodeReader) {
            typeToCodeReader = new ArrayMap<>();
            mCodeReaders[tabIndex] = typeToCodeReader;
        }

        ArrayMap<String, Integer> typeToPos = mUiTab[tabIndex];
        if (null == typeToPos) {
            typeToPos = new ArrayMap<>();
            mUiTab[tabIndex] = typeToPos;
        }

        int count = reader.readInt();
        Log.w(TAG, "load view count: " + count);
        for(int i = 0; i < count; ++i) {
            short nameSize = reader.readShort();
            String name = new String(reader.getCode(), reader.getPos(), nameSize, Charset.forName("UTF-8"));
            CodeReader oldCodeReader = typeToCodeReader.get(name);
            if (oldCodeReader != null) {
                int oldPatchVersion = oldCodeReader.getPatchVersion();
                if (patchVersion <= oldPatchVersion) {
                    //avoid loading code repeat
                    continue;
                }
            }
            Log.w(TAG, "load view name " + name);
            typeToCodeReader.put(name, reader);
            reader.seekBy(nameSize);

            short uiCodeSize = reader.readShort();
            typeToPos.put(name, reader.getPos());
            if (!reader.seekBy(uiCodeSize) ) {
                ret = false;
                Log.e(TAG, "seekBy error:" + uiCodeSize + " i:" + i);
                break;
            }
        }
    } else {
        ret = false;
    }

    return ret;
}
 
開發者ID:alibaba,項目名稱:Virtualview-Android,代碼行數:49,代碼來源:UiCodeLoader.java

示例12: configureTransitions

import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
private boolean configureTransitions(int containerId, TransitionState state, boolean isBack, SparseArray<Fragment> firstOutFragments, SparseArray<Fragment> lastInFragments) {
    View sceneRoot = (ViewGroup) this.mManager.mContainer.onFindViewById(containerId);
    if (sceneRoot == null) {
        return false;
    }
    final Fragment inFragment = (Fragment) lastInFragments.get(containerId);
    Fragment outFragment = (Fragment) firstOutFragments.get(containerId);
    Object enterTransition = getEnterTransition(inFragment, isBack);
    Object sharedElementTransition = getSharedElementTransition(inFragment, outFragment, isBack);
    Object exitTransition = getExitTransition(outFragment, isBack);
    ArrayMap<String, View> namedViews = null;
    ArrayList<View> sharedElementTargets = new ArrayList();
    if (sharedElementTransition != null) {
        namedViews = remapSharedElements(state, outFragment, isBack);
        if (namedViews.isEmpty()) {
            sharedElementTransition = null;
            namedViews = null;
        } else {
            SharedElementCallback callback = isBack ? outFragment.mEnterTransitionCallback : inFragment.mEnterTransitionCallback;
            if (callback != null) {
                callback.onSharedElementStart(new ArrayList(namedViews.keySet()), new ArrayList(namedViews.values()), null);
            }
            prepareSharedElementTransition(state, sceneRoot, sharedElementTransition, inFragment, outFragment, isBack, sharedElementTargets);
        }
    }
    if (enterTransition == null && sharedElementTransition == null && exitTransition == null) {
        return false;
    }
    ArrayList<View> exitingViews = new ArrayList();
    exitTransition = captureExitingViews(exitTransition, outFragment, exitingViews, namedViews, state.nonExistentView);
    if (!(this.mSharedElementTargetNames == null || namedViews == null)) {
        View epicenterView = (View) namedViews.get(this.mSharedElementTargetNames.get(0));
        if (epicenterView != null) {
            if (exitTransition != null) {
                FragmentTransitionCompat21.setEpicenter(exitTransition, epicenterView);
            }
            if (sharedElementTransition != null) {
                FragmentTransitionCompat21.setEpicenter(sharedElementTransition, epicenterView);
            }
        }
    }
    ViewRetriever viewRetriever = new ViewRetriever() {
        public View getView() {
            return inFragment.getView();
        }
    };
    ArrayList<View> enteringViews = new ArrayList();
    ArrayMap<String, View> renamedViews = new ArrayMap();
    boolean allowOverlap = true;
    if (inFragment != null) {
        allowOverlap = isBack ? inFragment.getAllowReturnTransitionOverlap() : inFragment.getAllowEnterTransitionOverlap();
    }
    Object transition = FragmentTransitionCompat21.mergeTransitions(enterTransition, exitTransition, sharedElementTransition, allowOverlap);
    if (transition != null) {
        FragmentTransitionCompat21.addTransitionTargets(enterTransition, sharedElementTransition, sceneRoot, viewRetriever, state.nonExistentView, state.enteringEpicenterView, state.nameOverrides, enteringViews, namedViews, renamedViews, sharedElementTargets);
        excludeHiddenFragmentsAfterEnter(sceneRoot, state, containerId, transition);
        FragmentTransitionCompat21.excludeTarget(transition, state.nonExistentView, true);
        excludeHiddenFragments(state, containerId, transition);
        FragmentTransitionCompat21.beginDelayedTransition(sceneRoot, transition);
        FragmentTransitionCompat21.cleanupTransitions(sceneRoot, state.nonExistentView, enterTransition, enteringViews, exitTransition, exitingViews, sharedElementTransition, sharedElementTargets, transition, state.hiddenFragmentViews, renamedViews);
    }
    if (transition != null) {
        return true;
    }
    return false;
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:67,代碼來源:BackStackRecord.java


注:本文中的android.support.v4.util.ArrayMap.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。