gt:                             Task dividerTask = new Task();
context: package com.habitrpg.android.habitica.ui.activities;
  
  import android.app.AlertDialog;
  import android.content.Intent;
  import android.databinding.ObservableArrayList;
  import android.databinding.ObservableList;
  import android.graphics.drawable.BitmapDrawable;
  import android.graphics.drawable.Drawable;
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.support.design.widget.TabLayout;
  import android.support.v4.app.FragmentTransaction;
  import android.support.v7.widget.RecyclerView;
  import android.support.v7.widget.Toolbar;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.FrameLayout;
  import android.widget.TextView;
  
  import com.habitrpg.android.habitica.R;
  import com.habitrpg.android.habitica.components.AppComponent;
  import com.habitrpg.android.habitica.data.ChallengeRepository;
  import com.habitrpg.android.habitica.data.UserRepository;
  import com.habitrpg.android.habitica.events.HabitScoreEvent;
  import com.habitrpg.android.habitica.events.TaskUpdatedEvent;
  import com.habitrpg.android.habitica.events.commands.BuyRewardCommand;
  import com.habitrpg.android.habitica.events.commands.ChecklistCheckedCommand;
  import com.habitrpg.android.habitica.events.commands.TaskCheckedCommand;
  import com.habitrpg.android.habitica.helpers.RxErrorHandler;
  import com.habitrpg.android.habitica.interactors.BuyRewardUseCase;
  import com.habitrpg.android.habitica.interactors.ChecklistCheckUseCase;
  import com.habitrpg.android.habitica.interactors.DailyCheckUseCase;
  import com.habitrpg.android.habitica.interactors.DisplayItemDropUseCase;
  import com.habitrpg.android.habitica.interactors.HabitScoreUseCase;
  import com.habitrpg.android.habitica.interactors.NotifyUserUseCase;
  import com.habitrpg.android.habitica.interactors.TodoCheckUseCase;
  import com.habitrpg.android.habitica.models.LeaveChallengeBody;
  import com.habitrpg.android.habitica.models.responses.TaskScoringResult;
  import com.habitrpg.android.habitica.models.social.Challenge;
  import com.habitrpg.android.habitica.models.tasks.Task;
  import com.habitrpg.android.habitica.models.user.User;
  import com.habitrpg.android.habitica.modules.AppModule;
  import com.habitrpg.android.habitica.ui.fragments.social.challenges.ChallengeDetailDialogHolder;
  import com.habitrpg.android.habitica.ui.fragments.social.challenges.ChallengeTasksRecyclerViewFragment;
  import com.habitrpg.android.habitica.ui.helpers.MarkdownParser;
  import com.habitrpg.android.habitica.ui.views.HabiticaIconsHelper;
  import com.habitrpg.android.habitica.ui.views.HabiticaSnackbar;
  
  import net.pherth.android.emoji_library.EmojiParser;
  import net.pherth.android.emoji_library.EmojiTextView;
  
  import org.greenrobot.eventbus.EventBus;
  import org.greenrobot.eventbus.Subscribe;
  
  import java.util.ArrayList;
  import java.util.Map;
  
  import javax.inject.Inject;
  import javax.inject.Named;
  
  import butterknife.BindView;
  import butterknife.ButterKnife;
  import butterknife.OnClick;
  import rx.functions.Action1;
  
  
  public class ChallengeDetailActivity extends BaseActivity {
  
      public static String CHALLENGE_ID = "CHALLENGE_ID";
  
      @BindView(R.id.detail_tabs)
      TabLayout detail_tabs;
      @BindView(R.id.toolbar)
      Toolbar toolbar;
  
      @Inject
      ChallengeRepository challengeRepository;
      @Inject
      @Named(AppModule.NAMED_USER_ID)
      String userId;
      @Inject
      UserRepository userRepository;
  
      @BindView(R.id.floating_menu_wrapper)
      FrameLayout floatingMenuWrapper;
  
      // region UseCases
  
      @Inject
      HabitScoreUseCase habitScoreUseCase;
  
      @Inject
      DailyCheckUseCase dailyCheckUseCase;
  
      @Inject
      TodoCheckUseCase todoCheckUseCase;
  
      @Inject
      BuyRewardUseCase buyRewardUseCase;
  
      @Inject
      ChecklistCheckUseCase checklistCheckUseCase;
  
      @Inject
      DisplayItemDropUseCase displayItemDropUseCase;
  
      @Inject
      NotifyUserUseCase notifyUserUseCase;
  
      // endregion
  
      @Nullable
      private Challenge challenge;
      private User user;
  
      @Override
      protected int getLayoutResId() {
          return R.layout.activity_challenge_detail;
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.menu_challenge_details, menu);
  
          if(challenge != null && challenge.leaderId != null && !challenge.leaderId.equals(userId)){
              menu.setGroupVisible(R.id.challenge_edit_action_group, false);
          }
  
          return true;
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          setupToolbar(toolbar);
  
          if (getSupportActionBar() != null) {
              getSupportActionBar().setTitle(R.string.challenge_details);
          }
          detail_tabs.setVisibility(View.GONE);
  
          Bundle extras = getIntent().getExtras();
  
          String challengeId = extras.getString(CHALLENGE_ID);
  
          ObservableList<Task> fullList = new ObservableArrayList<>();
  
          userRepository.getUser(userId).first().subscribe(user -> {
              ChallengeDetailActivity.this.user = user;
              createTaskRecyclerFragment(fullList);
          }, RxErrorHandler.handleEmptyError());
  
          if (challengeId != null) {
              challengeRepository.getChallengeTasks(challengeId)
                      .first()
                      .subscribe(taskList -> {
                          ArrayList<Task> resultList = new ArrayList<>();
  
                          ArrayList<Task> todos = new ArrayList<>();
                          ArrayList<Task> habits = new ArrayList<>();
                          ArrayList<Task> dailies = new ArrayList<>();
                          ArrayList<Task> rewards = new ArrayList<>();
  
                          for (Map.Entry<String, Task> entry : taskList.tasks.entrySet()) {
                              switch (entry.getValue().type) {
                                  case Task.TYPE_TODO:
                                      todos.add(entry.getValue());
                                      break;
                                  case Task.TYPE_HABIT:
  
                                      habits.add(entry.getValue());
                                      break;
                                  case Task.TYPE_DAILY:
  
                                      dailies.add(entry.getValue());
                                      break;
                                  case Task.TYPE_REWARD:
  
                                      rewards.add(entry.getValue());
                                      break;
                              }
                          }
  
  
                          if (!habits.isEmpty()) {
                              Task dividerTask = new Task();
                              dividerTask.setId("divhabits");
                              dividerTask.type = "divider";
                              dividerTask.text = "Challenge Habits";
  
                              resultList.add(dividerTask);
                              resultList.addAll(habits);
                          }
  
  
                          if (!dailies.isEmpty()) {
  