本文整理汇总了Java中android.support.v4.util.ArrayMap.size方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayMap.size方法的具体用法?Java ArrayMap.size怎么用?Java ArrayMap.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.util.ArrayMap
的用法示例。
在下文中一共展示了ArrayMap.size方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findSiblingStyleByPosition
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
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;
}
示例2: populateList
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
/**
* populateList adds to documents list a new document
* @param attributes Specifications of the new document
* @param bookmarks New document's bookmarks
*/
private void populateList(ArrayMap<String, Object> attributes, ArrayMap<Integer, String> bookmarks){
// Get extension
String ext = "";
for(int e = attributes.get("uri").toString().length()-1; e>0 && attributes.get("uri").toString().charAt(e) != '.'; --e){
ext = attributes.get("uri").toString().charAt(e) + ext;
}
switch(ext){
case "txt":
documents.add(new TXTDocument(attributes.get("title").toString(), attributes.get("author").toString(), (Date) attributes.get("importDate"),
Integer.valueOf(attributes.get("lastReadPosition").toString()), attributes.get("uri").toString()));
break;
case "epub":
documents.add(new EPubDocument(attributes.get("title").toString(), attributes.get("author").toString(), (Date) attributes.get("importDate"),
Integer.valueOf(attributes.get("lastReadPosition").toString()), attributes.get("uri").toString()));
break;
case "html":
documents.add(new HtmlDocument(attributes.get("title").toString(), attributes.get("author").toString(), (Date) attributes.get("importDate"),
Integer.valueOf(attributes.get("lastReadPosition").toString()), attributes.get("uri").toString()));
default:
// TODO: not supported extension
}
// Add Bookmarks
for(int j=0; j < bookmarks.size(); ++j){
documents.get(documents.size()-1).addBookmark(bookmarks.valueAt(j), bookmarks.keyAt(j));
}
}
示例3: 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);
}
}
示例4: setNameOverrides
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
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);
}
}
}
示例5: composeNavigationUri
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
public static Uri composeNavigationUri(String schemeString, String host, String path, ArrayMap<String, String> extras)
{
StringBuilder builder = new StringBuilder(schemeString).append("://").append(host);
if(!TextUtils.isEmpty(path))
{
builder.append("/").append(path);
}
if(extras != null && extras.size() > 0)
{
builder.append("?");
for(Entry<String, String> entry : extras.entrySet())
{
if(entry == null) continue;
builder.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
}
}
String result = builder.toString();
if(result.endsWith("?") || result.endsWith("&"))
{
result = result.substring(0, result.length() - 1);
}
return Uri.parse(result);
}
示例6: onResult
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
@Override
public void onResult(Object result) {
Log.d("k9res", "onResult: " + result.toString());
if (result.toString().equalsIgnoreCase("swiped_down")) {
//do something or nothing
} else {
if (result != null) {
ArrayMap<String, List<String>> applied_filters = (ArrayMap<String, List<String>>) result;
if (applied_filters.size() != 0) {
List<SingleMovie> filteredList = mData.getAllMovies();
//iterate over arraymap
for (Map.Entry<String, List<String>> entry : applied_filters.entrySet()) {
Log.d("k9res", "entry.key: " + entry.getKey());
switch (entry.getKey()) {
case "genre":
filteredList = mData.getGenreFilteredMovies(entry.getValue(), filteredList);
break;
case "rating":
filteredList = mData.getRatingFilteredMovies(entry.getValue(), filteredList);
break;
case "year":
filteredList = mData.getYearFilteredMovies(entry.getValue(), filteredList);
break;
case "quality":
filteredList = mData.getQualityFilteredMovies(entry.getValue(), filteredList);
break;
}
}
Log.d("k9res", "new size: " + filteredList.size());
mList.clear();
mList.addAll(filteredList);
mAdapter.notifyDataSetChanged();
} else {
mList.addAll(mData.getAllMovies());
mAdapter.notifyDataSetChanged();
}
}
//handle result
}
}