本文整理匯總了Java中android.support.v4.util.ArrayMap.put方法的典型用法代碼示例。如果您正苦於以下問題:Java ArrayMap.put方法的具體用法?Java ArrayMap.put怎麽用?Java ArrayMap.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v4.util.ArrayMap
的用法示例。
在下文中一共展示了ArrayMap.put方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findAllFragmentsWithViews
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
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);
}
}
}
}
示例2: findAllFragmentsWithViewsPreO
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
private void findAllFragmentsWithViewsPreO(
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_INDEX_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);
}
}
}
}
示例3: parseAnnotation
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
private void parseAnnotation(Object target) {
ArrayMap map = new ArrayMap();
Class<?> targetClass = target.getClass();
Field[] fields = targetClass.getDeclaredFields();
for (Field field : fields) {
Annotation[] annotations = field.getAnnotations();
for (Annotation annotation : annotations) {
if (annotation instanceof TurnLeftSideslip) {
map.put("TurnLeftSideslip", annotation);
} else if (annotation instanceof TurnRightSideslip) {
map.put("TurnRightSideslip", annotation);
} else if (annotation instanceof LongTouch) {
map.put("LongTouch", annotation);
} else if (annotation instanceof Drag) {
map.put("Drag", annotation);
}
}
}
itemListener.setLimitMap(map);
}
示例4: readThemeSetting
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/***
* 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;
}
示例5: save
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/**
* Save selected setting to file using settingManager
*/
private void save(){
try{
ArrayMap<String, String> toSave = new ArrayMap<>();
String selFont;
selFont = spnFont.getSelectedItem().toString() + ".ttf"; //rbFOD.isChecked() ? "fonts/OpenDyslexic-Regular.otf" : "default";
toSave.put("font", selFont);
toSave.put("palette", palette);
toSave.put("highlight", highlight);
settingsManager.changeThemeSetting(toSave);
settingsManager.saveSettings(getContext());
Toast.makeText(getContext(), "Impostazioni salvate", Toast.LENGTH_SHORT).show();
}catch (IOException e){
Toast.makeText(getContext(), "Errore salvataggio", Toast.LENGTH_SHORT).show();
}
}
示例6: loadSQLiteData
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
public void loadSQLiteData() {
{
int allCount = 0;
mSqLiteHandle = new SQLiteHandle(getActivity());
Cursor cursor = mSqLiteHandle.queryUnappearFeeds();
if (cursor != null) {
Log.i("過程打印", "存在Feed");
Log.i("count數", String.valueOf(cursor.getCount()));
while (cursor.moveToNext()) {
String name = cursor.getString(cursor.getColumnIndex("RssName"));
int count = cursor.getInt(cursor.getColumnIndex("ItemsCount"));
ArrayMap<String, String> arrayMap = new ArrayMap<String, String>();
arrayMap.put("rssName", name);
arrayMap.put("rssCount", String.valueOf(count));
mRssUnreadList.add(arrayMap);
}
} else {
Log.i("過程打印", "不存在Feed");
}
//更新全部未讀數目
allCount = mSqLiteHandle.queryAllUnreadItems().getCount();
mRssUnreadList.get(0).put("rssCount", Integer.toString(allCount));
mSqLiteHandle.updateUnAppearFeeds();
cursor.close();
mSqLiteHandle.dbClose();
mSqLiteHandle = null;
Log.i("unReadFragment", "onCreateView:mSqLiteHandle已關閉");
}
}
示例7: splitAuthFields
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
private ArrayMap<String, String> splitAuthFields(String authString) {
final ArrayMap<String, String> fields = new ArrayMap<>();
final CharMatcher trimmer = CharMatcher.anyOf("\"\t ");
final Splitter commas = Splitter.on(',').trimResults().omitEmptyStrings();
final Splitter equals = Splitter.on('=').trimResults(trimmer).limit(2);
String[] valuePair;
for (String keyPair : commas.split(authString)) {
valuePair = Iterables.toArray(equals.split(keyPair), String.class);
fields.put(valuePair[0], valuePair[1]);
}
return fields;
}
示例8: findAllFragmentsWithViews
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.O)
private void findAllFragmentsWithViews(
android.app.FragmentManager fragmentManager, ArrayMap<View, android.app.Fragment> result) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
for (android.app.Fragment fragment : fragmentManager.getFragments()) {
if (fragment.getView() != null) {
result.put(fragment.getView(), fragment);
findAllFragmentsWithViews(fragment.getChildFragmentManager(), result);
}
}
} else {
findAllFragmentsWithViewsPreO(fragmentManager, result);
}
}
示例9: setNameOverride
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
private static void setNameOverride(ArrayMap<String, String> overrides, String source, String target) {
if (source != null && target != null) {
for (int index = 0; index < overrides.size(); index++) {
if (source.equals(overrides.valueAt(index))) {
overrides.setValueAt(index, target);
return;
}
}
overrides.put(source, target);
}
}
示例10: VGroup
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
public VGroup(VGroup copy, ArrayMap<String, Object> targetsMap) {
this.mRotate = copy.mRotate;
this.mPivotX = copy.mPivotX;
this.mPivotY = copy.mPivotY;
this.mScaleX = copy.mScaleX;
this.mScaleY = copy.mScaleY;
this.mTranslateX = copy.mTranslateX;
this.mTranslateY = copy.mTranslateY;
this.mThemeAttrs = copy.mThemeAttrs;
this.mGroupName = copy.mGroupName;
this.mChangingConfigurations = copy.mChangingConfigurations;
if (this.mGroupName != null) {
targetsMap.put(this.mGroupName, this);
}
this.mLocalMatrix.set(copy.mLocalMatrix);
ArrayList<Object> children = copy.mChildren;
for (int i = 0; i < children.size(); i++) {
VGroup copyChild = children.get(i);
if (copyChild instanceof VGroup) {
this.mChildren.add(new VGroup(copyChild, targetsMap));
} else {
VPath newPath;
if (copyChild instanceof VFullPath) {
newPath = new VFullPath((VFullPath) copyChild);
} else if (copyChild instanceof VClipPath) {
newPath = new VClipPath((VClipPath) copyChild);
} else {
throw new IllegalStateException("Unknown object in the tree!");
}
this.mChildren.add(newPath);
if (newPath.mPathName != null) {
targetsMap.put(newPath.mPathName, newPath);
}
}
}
}
示例11: getSpecs
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/**
* Returns an ArrayMap containing all the key-value pairs that correspond to
* private members
*
* @return ArrayMap of strings
*/
@Override
public ArrayMap<String, String> getSpecs() {
ArrayMap<String,String> specs = new ArrayMap<String, String>();
specs.put("size", Integer.toString(size));
specs.put("spacing", Integer.toString(spacing));
specs.put("lineSpacing", Integer.toString(lineSpacing));
return specs;
}
示例12: getSpecs
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/**
* Public getter that returns an ArrayMap of key-values containing setting's specifications
*
* @return ArrayMap of key-values strings
*/
@Override
public ArrayMap<String, String> getSpecs() {
ArrayMap<String,String> specs = new ArrayMap<String, String>();
specs.put("font", font);
specs.put("palette", palette);
specs.put("highlight",highlight);
specs.put("originalFont", getOriginalFont(font));
return specs;
}
示例13: getSpecs
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/**
* Public getter that returns an ArrayMap of key-values containing setting's specifications
*
* @return ArrayMap of key-values strings
*/
@Override
public ArrayMap<String, String> getSpecs() {
ArrayMap<String,String> specs = new ArrayMap<String, String>();
specs.put("id", id);
specs.put("language", language);
specs.put("gender", gender);
specs.put("speed", speed);
return specs;
}
示例14: 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;
}
示例15: save
import android.support.v4.util.ArrayMap; //導入方法依賴的package包/類
/**
* 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();
}
}