本文整理匯總了Java中com.parse.ParseObject.getParseObject方法的典型用法代碼示例。如果您正苦於以下問題:Java ParseObject.getParseObject方法的具體用法?Java ParseObject.getParseObject怎麽用?Java ParseObject.getParseObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.parse.ParseObject
的用法示例。
在下文中一共展示了ParseObject.getParseObject方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: conversationFromSubscription
import com.parse.ParseObject; //導入方法依賴的package包/類
public static ExampleConversation conversationFromSubscription(ParseObject subscription, ParseHelper helper) {
final ParseObject chatParseObject = subscription.getParseObject(ChatSubscriptionTable.Fields.CHAT);
if (chatParseObject.isDataAvailable()) {
final String name = TextUtils.isEmpty(chatParseObject.getString(ChatTable.Fields.NAME)) ? subscription.getString(ChatSubscriptionTable.Fields.NAME) : chatParseObject.getString(ChatTable.Fields.NAME);
final List<BaseUser> users = Collections.emptyList(); // TODO: Populate!
int unread = chatParseObject.getInt(ChatTable.Fields.MESSAGE_COUNT) - subscription.getInt(ChatSubscriptionTable.Fields.LAST_SEEN_COUNT);
final boolean hasLastMessage = chatParseObject.has(ChatTable.Fields.LAST_MESSAGE) && chatParseObject.getParseObject(ChatTable.Fields.LAST_MESSAGE).isDataAvailable();
final ExampleMessage lastMessage = hasLastMessage ? from(chatParseObject.getParseObject(ChatTable.Fields.LAST_MESSAGE), helper) : null;
return new ExampleConversation(chatParseObject.getObjectId(),
name,
users,
lastMessage,
unread);
}
else {
return new ExampleConversation(chatParseObject.getObjectId());
}
}
示例2: get
import com.parse.ParseObject; //導入方法依賴的package包/類
public static Object get(ParseObject parseObject, String key, Object defValue) {
return parseObject.getParseObject(key);
}
示例3: 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;
}
示例4: 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);
}
}