title: FirebaseRecyclerAdapter dynamic layout
body: <p>Sorry for bad english. Guys, the question is as follows. Is it possible to dynamically change the properties of the markup explain: There is a correspondence between the 2 users, and there is 1 for counting the messages themselves. Here is a method to initialize and configure the adapter:</p>
  
  <pre><code> mFBAdapter = new FirebaseRecyclerAdapter&lt;ChatMessage, FirechatMsgViewHolder&gt;(
          ChatMessage.class,
         // chat_message - my msg layout
          R.layout.chat_message,
          FirechatMsgViewHolder.class,
          mDatabaseReference.child(romName)
  ) {
  
      @Override
      protected void populateViewHolder(FirechatMsgViewHolder firechatMsgViewHolder, ChatMessage chatMessage, int i) {
          mProgressBar.setVisibility(ProgressBar.INVISIBLE);
  
          firechatMsgViewHolder.msgText.setText(chatMessage.getText())          firechatMsgViewHolder.userText.setText(chatMessage.getName());
  
  
          if (mFirebaseUser.getPhotoUrl() == null) {
              firechatMsgViewHolder.userImage.setImageDrawable(
                      ContextCompat.getDrawable(context, R.drawable.ic_account_circle_black_36dp));
          } else {
              mUsername = mFirebaseUser.getDisplayName();
              mPhotoUrl = mFirebaseUser.getPhotoUrl().toString();
              Glide.with(ChatFragment.this).
                      load(chatMessage.getPhotoUrl()).into(firechatMsgViewHolder.userImage);
          }
      }
  };
  
  mFBAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
      @Override
      public void onItemRangeInserted(int positionStart, int itemCount) {
          super.onItemRangeInserted(positionStart, itemCount);
          int chatMsgCount = mFBAdapter.getItemCount();
          int lastVisiblePosition = mLayoutManager.findLastCompletelyVisibleItemPosition();
          if (lastVisiblePosition == -1 ||
                  (positionStart &gt;= (chatMsgCount - 1) &amp;&amp; lastVisiblePosition == (positionStart - 1))) {
              mMsgRecyclerView.scrollToPosition(positionStart);
          }
      }
  });
  
  mMsgRecyclerView.setLayoutManager(mLayoutManager);
  mMsgRecyclerView.setAdapter(mFBAdapter);
  
  mUsername = mFirebaseUser.getDisplayName().toString();
  </code></pre>
  
  <p>have the names of both participants, and I wanted to do something to help them do so, what message sent by the user to appear in his right, and adopted - on the left. There are constant and Gravity.LEFT Gravity.RIGHT, with which you can control the position of the code, but it is bolted. It was a variant type:</p>
  
  <pre><code> if(mFirebaseAuth.getCurrentUser().getDisplayName().equals(mUsername)){
      // gravity right...
  
  } else {
      // gravity lef.....
  }
  </code></pre>
  
  <p>but it did not work. There is some thought, can anyone come across?</p>