Ejemplo n.º 1
0
  @Override
  protected void onStop() {
    super.onStop();

    // Remove all the views
    mRecentsView.removeAllTaskStacks();
  }
Ejemplo n.º 2
0
  @Override
  protected void onResume() {
    super.onResume();

    // Mark Recents as visible

    ReferenceCountedTrigger t = new ReferenceCountedTrigger(this, null, null, null);
    mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(t));
  }
Ejemplo n.º 3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    // Initialize the loader and the configuration
    mConfig = RecentsConfiguration.reinitialize(this);

    setContentView(R.layout.activity_main);

    mRecentsView = (RecentsView) findViewById(R.id.recents_view);
    mRecentsView.setSystemUiVisibility(
        View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);

    updateRecentsTasks();
  }
Ejemplo n.º 4
0
  void updateRecentsTasks() {

    // Load all the tasks

    ArrayList<ProfileStack> stacks = new ArrayList<>();
    ProfileStack mockStack = new ProfileStack();
    Profile mockProfile1 = new Profile();
    mockProfile1.isLaunchTarget = true;
    mockProfile1.key = new Profile.TaskKey();
    mockProfile1.key.id = 0;
    mockStack.addTask(mockProfile1);

    Profile mockProfile2 = new Profile();
    mockProfile2.isLaunchTarget = true;
    mockProfile2.key = new Profile.TaskKey();
    mockProfile2.key.id = 1;
    mockStack.addTask(mockProfile2);

    mockProfile2 = new Profile();
    mockProfile2.isLaunchTarget = true;
    mockProfile2.key = new Profile.TaskKey();
    mockProfile2.key.id = 2;
    mockStack.addTask(mockProfile2);

    mockProfile2 = new Profile();
    mockProfile2.isLaunchTarget = true;
    mockProfile2.key = new Profile.TaskKey();
    mockProfile2.key.id = 3;
    mockStack.addTask(mockProfile2);

    mockProfile2 = new Profile();
    mockProfile2.isLaunchTarget = true;
    mockProfile2.key = new Profile.TaskKey();
    mockProfile2.key.id = 4;
    mockStack.addTask(mockProfile2);

    mockProfile2 = new Profile();
    mockProfile2.isLaunchTarget = true;
    mockProfile2.key = new Profile.TaskKey();
    mockProfile2.key.id = 5;
    mockStack.addTask(mockProfile2);

    mockProfile2 = new Profile();
    mockProfile2.isLaunchTarget = true;
    mockProfile2.key = new Profile.TaskKey();
    mockProfile2.key.id = 6;
    mockStack.addTask(mockProfile2);

    mockProfile2 = new Profile();
    mockProfile2.isLaunchTarget = true;
    mockProfile2.key = new Profile.TaskKey();
    mockProfile2.key.id = 7;
    mockStack.addTask(mockProfile2);

    mockProfile2 = new Profile();
    mockProfile2.isLaunchTarget = true;
    mockProfile2.key = new Profile.TaskKey();
    mockProfile2.key.id = 8;
    mockStack.addTask(mockProfile2);

    mockProfile2 = new Profile();
    mockProfile2.isLaunchTarget = true;
    mockProfile2.key = new Profile.TaskKey();
    mockProfile2.key.id = 9;
    mockStack.addTask(mockProfile2);

    stacks.add(mockStack);
    if (!stacks.isEmpty()) {
      mRecentsView.setTaskStacks(stacks);
    }
    mConfig.launchedWithNoRecentTasks = false;

    // Mark the task that is the launch target
    int taskStackCount = stacks.size();
    if (mConfig.launchedToTaskId != -1) {
      for (int i = 0; i < taskStackCount; i++) {
        ProfileStack stack = stacks.get(i);
        ArrayList<Profile> tasks = stack.getTasks();
        int taskCount = tasks.size();
        for (int j = 0; j < taskCount; j++) {
          Profile t = tasks.get(j);
          if (t.key.id == mConfig.launchedToTaskId) {
            t.isLaunchTarget = true;
            break;
          }
        }
      }
    }
  }