package chat.rocket.android.fragment.chatroom;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import chat.rocket.android.R;
import chat.rocket.android.fragment.AbstractFragment;
import chat.rocket.android.widget.RoomToolbar;
import chat.rocket.core.models.User;

abstract class AbstractChatRoomFragment extends AbstractFragment {
  private RoomToolbar roomToolbar;

  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    roomToolbar = getActivity().findViewById(R.id.activity_main_toolbar);
    return super.onCreateView(inflater, container, savedInstanceState);
  }

  protected void setToolbarTitle(CharSequence title) {
    roomToolbar.setTitle(title);
  }

  protected void showToolbarPrivateChannelIcon() {
    roomToolbar.showPrivateChannelIcon();
  }

  protected void showToolbarPublicChannelIcon() {
    roomToolbar.showPublicChannelIcon();
  }

  protected void showToolbarUserStatuslIcon(String status) {
    switch (status) {
      case User.STATUS_ONLINE:
        roomToolbar.showUserStatusIcon(RoomToolbar.STATUS_ONLINE);
        break;
      case User.STATUS_BUSY:
        roomToolbar.showUserStatusIcon(RoomToolbar.STATUS_BUSY);
        break;
      case User.STATUS_AWAY:
        roomToolbar.showUserStatusIcon(RoomToolbar.STATUS_AWAY);
        break;
      case User.STATUS_OFFLINE:
        roomToolbar.showUserStatusIcon(RoomToolbar.STATUS_OFFLINE);
        break;
      default:
        roomToolbar.showUserStatusIcon(RoomToolbar.STATUS_OFFLINE);
        break;
    }
  }
}
@@ -1105,16 +1105,26 @@
 uslIcon(
+@Nullable 
 String s
@@ -1128,24 +1128,131 @@
 g status) %7B%0A
+    if (status == null) %7B%0A      roomToolbar.showUserStatusIcon(RoomToolbar.STATUS_OFFLINE);%0A    %7D else %7B%0A  
     switch (
@@ -1263,24 +1263,26 @@
 us) %7B%0A      
+  
 case User.ST
@@ -1290,24 +1290,26 @@
 TUS_ONLINE:%0A
+  
         room
@@ -1363,39 +1363,43 @@
 NLINE);%0A        
+  
 break;%0A
+  
       case User.
@@ -1411,16 +1411,18 @@
 S_BUSY:%0A
+  
         
@@ -1478,39 +1478,43 @@
 _BUSY);%0A        
+  
 break;%0A
+  
       case User.
@@ -1526,16 +1526,18 @@
 S_AWAY:%0A
+  
         
@@ -1593,32 +1593,34 @@
 _AWAY);%0A        
+  
 break;%0A      cas
@@ -1612,24 +1612,26 @@
 reak;%0A      
+ 
+ 
 case User.ST
@@ -1640,24 +1640,26 @@
 US_OFFLINE:%0A
+  
         room
@@ -1706,32 +1706,34 @@
 TATUS_OFFLINE);%0A
+  
         break;%0A 
@@ -1737,16 +1737,18 @@
 ;%0A      
+  
 default:
@@ -1748,16 +1748,18 @@
 efault:%0A
+  
         
@@ -1822,30 +1822,40 @@
 E);%0A        
+ 
+ 
 break;%0A
+      %7D%0A
     %7D%0A  %7D%0A%7D

Update AbstractChatRoomFragment.java