Android Open Source - pinpoint-android Task Manager






From Project

Back to project page pinpoint-android.

License

The source code is released under:

MIT License

If you think the Android project pinpoint-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package co.islovely.pinpoint;
//  w  ww .  j av  a2 s  .  c o m
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class TaskManager {
  private List<Task> taskList;

  private Random random;

  private int homescreenId;

  public TaskManager(int homescreenId) {
    this.random = new Random();
    this.taskList = new ArrayList<Task>();
    this.homescreenId = homescreenId;

    List<LauncherItem> launcherItems = LauncherReader.getAllItemsNotInDock(MyApplication.getAppContext());

    for (LauncherItem launcherItem : launcherItems) {
      if (launcherItem.getScreen() == homescreenId) {
        this.taskList.add(new Task(launcherItem, ColumnsActivity.class));
        this.taskList.add(new Task(launcherItem, GridActivity.class));
        this.taskList.add(new Task(launcherItem, QuadrantsActivity.class));
        this.taskList.add(new Task(launcherItem, RowsActivity.class));
      }
    }
  }

  public Task getTask() {
    if (!this.taskList.isEmpty()) {
      Task task = taskList.get(this.random.nextInt(this.taskList.size()));
      this.taskList.remove(task);

      return task;
    }

    return null;
  }
}




Java Source Code List

co.islovely.pinpoint.ColumnsActivity.java
co.islovely.pinpoint.Configuration.java
co.islovely.pinpoint.DeviceMetrics.java
co.islovely.pinpoint.GridActivity.java
co.islovely.pinpoint.HomescreenAdapter.java
co.islovely.pinpoint.HomescreenSelectActivity.java
co.islovely.pinpoint.Homescreen.java
co.islovely.pinpoint.IntermissionActivity.java
co.islovely.pinpoint.LauncherItem.java
co.islovely.pinpoint.LauncherReader.java
co.islovely.pinpoint.LayoutConfigurationActivity.java
co.islovely.pinpoint.MainActivity.java
co.islovely.pinpoint.MyApplication.java
co.islovely.pinpoint.PinpointActivity.java
co.islovely.pinpoint.Pinpoint.java
co.islovely.pinpoint.QuadrantsActivity.java
co.islovely.pinpoint.RowsActivity.java
co.islovely.pinpoint.StatisticsActivity.java
co.islovely.pinpoint.TaskLogEntry.java
co.islovely.pinpoint.TaskLog.java
co.islovely.pinpoint.TaskManager.java
co.islovely.pinpoint.Task.java
co.islovely.pinpoint.User.java
util.Base64.java