public void toggleTimestampForMessage(@Nullable ExampleMessage message){
  final int currentTimestampShownIndex=mMessages.indexOf(mShowTimestampFor);
  final int newTimestampShownIndex=mMessages.indexOf(message);
  if (mShowTimestampFor == message) {
    mShowTimestampFor=null;
  }
 else {
    mShowTimestampFor=message;
    notifyItemChanged(currentTimestampShownIndex);
  }
  notifyItemChanged(newTimestampShownIndex);
}

public void toggleTimestampForMessage ( @ Nullable ExampleMessage message ) { final int currentTimestampShownIndex = mMessages . indexOf ( mShowTimestampFor ) ; final int newTimestampShownIndex = mMessages . indexOf ( message ) ; if ( mShowTimestampFor == message ) { mShowTimestampFor = null ; } else { mShowTimestampFor = message ; notifyItemChanged ( currentTimestampShownIndex ) ; } notifyItemChanged ( newTimestampShownIndex ) ; }
toggles showing the time stamp for a given message . if the message passed as the argument is currently displaying the timestamp it will hide the timestamp . otherwise it will hide the currently showing timestamp and show the time stamp for the message passed .
