RecyclerView for messenger application
<p>I have converted the chat layout from listView to RecyclerView.</p>

<p>Now m facing some problem, When new messages arrive then it not showing automatically, I have to manually scroll to that messages.</p>

<p>Earlier in ListView it working.</p>

<p>I have used set setStackFormEnd in recylerView.</p>

<p>I want feature like whatsapp has like</p>

<p>if new message arrives and you are able to view last message then it will show that messages but</p>

<p>if you scrolling the messages then it doesn't change the position.</p>

<pre><code>    layoutManager.setStackFromEnd(true);
    messagesView.setLayoutManager(layoutManager);
    messagesView.setItemAnimator(new DefaultItemAnimator());
    messagesView.addOnScrollListener(mOnScrollListener);
</code></pre>

<p>Sample on Create Code Code</p>

<pre><code>super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final RecyclerView recyclerView = (RecyclerView)    findViewById(R.id.recyclerview);
final Button addButton = (Button) findViewById(R.id.button_is_reverse);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setStackFromEnd(true);
layoutManager.setReverseLayout(true);
recyclerView.setLayoutManager(layoutManager);
recyclerView.addItemDecoration(new DividerDecoration(this));
adapter = new SampleAdapter(items);
recyclerView.setAdapter(adapter);
addButton.setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
    items.add("Items" +items.size());
    adapter.notifyItemInserted(items.size());
  }
});
</code></pre>