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


Java ServerValue.TIMESTAMP属性代码示例

本文整理汇总了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;
}
 
开发者ID:r3bl-alliance,项目名称:starterproject_todolist_react_redux_firebase_ts_md,代码行数:21,代码来源:User.java

示例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("");
    }
}
 
开发者ID:shawara,项目名称:ChatUp,代码行数:35,代码来源:ChatFragment.java

示例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);
}
 
开发者ID:shawara,项目名称:ChatUp,代码行数:29,代码来源:ChatFragment.java

示例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);
}
 
开发者ID:Danihelsan,项目名称:MikuyConcept,代码行数:13,代码来源:Meal.java

示例5: getTime

public Map<String, String> getTime() { return ServerValue.TIMESTAMP; } 
开发者ID:GoogleCloudPlatform,项目名称:firebase-appengine-backend,代码行数:1,代码来源:Message.java


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