本文整理汇总了Java中com.google.firebase.database.ServerValue.TIMESTAMP属性的典型用法代码示例。如果您正苦于以下问题:Java ServerValue.TIMESTAMP属性的具体用法?Java ServerValue.TIMESTAMP怎么用?Java ServerValue.TIMESTAMP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.firebase.database.ServerValue
的用法示例。
在下文中一共展示了ServerValue.TIMESTAMP属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: User
public User(FirebaseUser param) {
if (param.getUid() != null) {
uid = param.getUid();
}
if (param.getProviderId() != null) {
providerId = param.getProviderId();
}
if (param.getDisplayName() != null) {
displayName = param.getDisplayName();
}
if (param.getPhotoUrl() != null) {
photoUrl = param.getPhotoUrl().toString();
}
if (param.getEmail() != null) {
email = param.getEmail();
}
emailVerified = param.isEmailVerified();
isAnonymous = param.isAnonymous();
timestamp = ServerValue.TIMESTAMP;
}
示例2: sendTextMessage
private void sendTextMessage() {
if (mMessageBoxState == 1) {
final MessageObject message = new MessageObject(mMessageBox.getText().toString().trim(),
ServerValue.TIMESTAMP,
mMyUid,
mUser.getUid());
if (!isIOnline) message.setState(MessageObject.STATE_NOT_SENT);
DatabaseReference order = mChatRoomRef.push();
message.setMessageID(order.getKey());
final String messageId = message.getMessageID();
mVisitedMessages.put(messageId, 1);
mMessageList.add(message);
mAdapter.notifyItemInserted(mMessageList.size() - 1);
order.setValue(message, new DatabaseReference.CompletionListener() {
@Override
public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {
if (databaseError == null) {
getMessageFromChatRoom(messageId);
}
}
});
updateLastMessageNode(messageId);
mRecyclerView.scrollToPosition(mMessageList.size() - 1);
mMessageBox.setText("");
}
}
示例3: onPostExecute
@Override
protected void onPostExecute(String s) {
// mAlertDialog.dismiss();
if (s == null || s.length() == 0) {
if (getActivity() != null)
Toast.makeText(getActivity(), "image not sent", Toast.LENGTH_SHORT).show();
return;
} else if (s.equals("1")) {
Toast.makeText(getContext(), "not uploaded Please Fix mobile time", Toast.LENGTH_SHORT).show();
return;
}
final MessageObject ms = new MessageObject(s, ServerValue.TIMESTAMP, MessageObject.IMAGE, mMyUid, mUser.getUid());
//Firebase ord = mRef.push();
DatabaseReference order = mChatRoomRef.push();
ms.setMessageID(order.getKey());
order.setValue(ms, new DatabaseReference.CompletionListener() {
@Override
public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {
if (databaseError == null) {
mAdapter.notifyDataSetChanged();
}
}
});
mFile = null;
mMessageList.add(ms);
mVisitedMessages.put(ms.getMessageID(), 1);
mAdapter.notifyDataSetChanged();
mRecyclerView.scrollToPosition(mMessageList.size() - 1);
}
示例4: Meal
public Meal(String user, Product appetizer, Product entree, Product dessert, Product bevevage) {
this.user = user;
this.restaurantId = 1;
this.appetizer = appetizer;
this.entree = entree;
this.dessert = dessert;
this.bevevage = bevevage;
this.timestamp = ServerValue.TIMESTAMP;
this.immutablePrice = (appetizer!=null?appetizer.price:0) +
(entree!=null?entree.price:0) +
(dessert!=null?dessert.price:0) +
(bevevage!=null?bevevage.price:0);
}
示例5: getTime
public Map<String, String> getTime() { return ServerValue.TIMESTAMP; }