当前位置: 首页>>代码示例>>Java>>正文


Java ParseObject.getList方法代码示例

本文整理汇总了Java中com.parse.ParseObject.getList方法的典型用法代码示例。如果您正苦于以下问题:Java ParseObject.getList方法的具体用法?Java ParseObject.getList怎么用?Java ParseObject.getList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.parse.ParseObject的用法示例。


在下文中一共展示了ParseObject.getList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: get

import com.parse.ParseObject; //导入方法依赖的package包/类
public static <T> List<T> get(ParseObject parseObject, String key, List<T> defValue) {
    return (List<T>) parseObject.getList(key);
}
 
开发者ID:yongjhih,项目名称:auto-parse,代码行数:4,代码来源:AutoParseHelper.java

示例2: getItemView

import com.parse.ParseObject; //导入方法依赖的package包/类
@Override
public View getItemView(ParseObject event, View convertView, ViewGroup parent) {
    if(convertView==null){
        convertView= LayoutInflater.from(parent.getContext()).inflate(R.layout.cell_event, parent, false);
    }
    aqCell.recycle(convertView);
    aqCell.id(R.id.text1).text(event.getString("hospital"));
    aqCell.id(R.id.textDate).text(StringUtils.formatDate(event.getDate("startTime"), StringUtils.DATE_AND_TIME_SHORT));
    int duration = event.getInt("duration");
    int clockRes = Reflect.getImageResId("ic_clock_" + duration);
    if (clockRes==0)clockRes=R.drawable.ic_clock_60;
    aqCell.id(R.id.imgDate).image(clockRes);
    String category = event.getString("category");
    category = StringUtils.isNullOrEmpty(category, "lecture").toLowerCase();
    int categoryRes = Reflect.getImageResId("ic_event_" + category);
    if(categoryRes==0) categoryRes=R.drawable.ic_event_lecture;
    aqCell.id(R.id.imgCategory).image(categoryRes);

    List<String> tags = event.getList("tags");
    if(tags==null) tags = new ArrayList<>();
    TagCloudLinkView hashTags = (TagCloudLinkView) aqCell.id(R.id.hashtag_tags).getView();
    while(hashTags.getTags().size()>0){
        hashTags.remove(0);
    }
    for(String tag : tags){
        hashTags.add(new Tag(1, tag));
    }
    hashTags.drawTags();
    ParseObject owner = event.getParseObject("owner");
    if(owner!=null)
        aqCell.id(R.id.textOwnerName).text(String.format("%s %s", owner.get("firstName"), owner.get("lastName")));
    else
        aqCell.id(R.id.textOwnerName).text("");
    int headCount = event.getInt("headCount");
    int quota = event.getInt("quota");
    SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
    if(headCount>=quota)
        StringUtils.appendSpan(stringBuilder, ""+headCount, new ForegroundColorSpan(getResources().getColor(R.color.body_text_1_negative)));
    else
    stringBuilder.append(""+headCount);
    stringBuilder.append(String.format("/%d places taken", quota));
    aqCell.id(R.id.textHeadCount).text(stringBuilder);

    return convertView;
}
 
开发者ID:rockgecko-development,项目名称:connectedteam-android,代码行数:46,代码来源:FeedListFragment.java

示例3: modelToUI

import com.parse.ParseObject; //导入方法依赖的package包/类
private void modelToUI() {
    ParseObject event = mEvent;
    aq.id(R.id.textHospitalName).text(event.getString("hospital"));
    String location = event.getString("location");
    location+=" "+StringUtils.isNullOrEmpty(event.getString("room"), "");
    aq.id(R.id.textLocation).text(location);
    aq.id(R.id.textDate).text(StringUtils.formatDate(event.getDate("startTime"), StringUtils.DATE_AND_TIME_SHORT));
    int duration = event.getInt("duration");
    int clockRes = Reflect.getImageResId("ic_clock_" + duration);
    if (clockRes==0)clockRes=R.drawable.ic_clock_60;
    aq.id(R.id.imgDate).image(clockRes);
    String category = event.getString("category");
    category = StringUtils.isNullOrEmpty(category, "lecture").toLowerCase();
    int categoryRes = Reflect.getImageResId("ic_event_" + category);
    if(categoryRes==0) categoryRes=R.drawable.ic_event_lecture;
    aq.id(R.id.imgCategory).image(categoryRes);

    List<String> tags = event.getList("tags");
    if(tags==null) tags = new ArrayList<>();
    TagCloudLinkView hashTags = (TagCloudLinkView) aq.id(R.id.hashtag_tags).getView();
    while(hashTags.getTags().size()>0){
        hashTags.remove(0);
    }
    for(String tag : tags){
        hashTags.add(new Tag(1, tag));
    }
    hashTags.drawTags();

    ParseObject owner = event.getParseObject("owner");
    if(owner!=null)
        aq.id(R.id.textOwnerName).text(String.format("%s %s", owner.get("firstName"), owner.get("lastName")));
    else
        aq.id(R.id.textOwnerName).text("");
    aq.id(R.id.textBlurb).text(event.getString("blurb"));
    int headCount = event.getInt("headCount");
    int quota = event.getInt("quota");
    SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
    if(headCount>=quota)
        StringUtils.appendSpan(stringBuilder, ""+headCount, new ForegroundColorSpan(getResources().getColor(R.color.body_text_1_negative)));
    else
        stringBuilder.append(""+headCount);
    stringBuilder.append(String.format("/%d places taken", quota));
    aq.id(R.id.textHeadCount).text(stringBuilder);

    ParseUser user = ParseUser.getCurrentUser();
    if(user!=null && owner!=null && user.getObjectId().equals(owner.getObjectId())){
        aq.id(R.id.btn_submit).text("Cancel").enabled(false);
    }
    else{
        aq.id(R.id.btn_submit).text("Reserve").enabled(!mHasJoined);

    }
}
 
开发者ID:rockgecko-development,项目名称:connectedteam-android,代码行数:54,代码来源:EventDetailsFragment.java


注:本文中的com.parse.ParseObject.getList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。