Android Open Source - pinpoint-android Configuration






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 w  w  .ja v a2s .c  o  m*/
import org.json.JSONException;
import org.json.JSONObject;

public class Configuration {
  private static Configuration INSTANCE;

  private int
      footerHeight,
      headerHeight;

  private Integer
      firstHomescreenId,
      secondHomescreenId,
      thirdHomescreenId;

  private Configuration() {
    this.footerHeight = 300;
    this.headerHeight = 20;

    this.firstHomescreenId = null;
    this.secondHomescreenId = null;
    this.thirdHomescreenId = null;
  }

  public static Configuration getInstance() {
    if (null == INSTANCE) {
      INSTANCE = new Configuration();
    }

    return INSTANCE;
  }

  public int getFooterHeight() {
    return this.footerHeight;
  }

  public void setFooterHeight(int footerHeight) {
    this.footerHeight = footerHeight;
  }

  public int getHeaderHeight() {
    return this.headerHeight;
  }

  public void setHeaderHeight(int headerHeight) {
    this.headerHeight = headerHeight;
  }

  public Integer getFirstHomescreenId() {
    return this.firstHomescreenId;
  }

  public void setFirstHomescreenId(int id) {
    this.firstHomescreenId = id;

    if (null != this.secondHomescreenId && id == this.secondHomescreenId) {
      this.secondHomescreenId = null;
    }

    if (null != this.thirdHomescreenId && id == this.thirdHomescreenId) {
      this.thirdHomescreenId = null;
    }
  }

  public Integer getSecondHomescreenId() {
    return this.secondHomescreenId;
  }

  public void setSecondHomescreenId(int id) {
    this.secondHomescreenId = id;

    if (null != this.firstHomescreenId && id == this.firstHomescreenId) {
      this.firstHomescreenId = null;
    }

    if (null != this.thirdHomescreenId && id == this.thirdHomescreenId) {
      this.thirdHomescreenId = null;
    }
  }

  public Integer getThirdHomescreenId() {
    return this.thirdHomescreenId;
  }

  public void setThirdHomescreenId(int id) {
    this.thirdHomescreenId = id;

    if (null != this.firstHomescreenId && id == this.firstHomescreenId) {
      this.firstHomescreenId = null;
    }

    if (null != this.secondHomescreenId && id == this.secondHomescreenId) {
      this.secondHomescreenId = null;
    }
  }

  public JSONObject toJSON() {
    JSONObject json = new JSONObject();

    try {
      json.put("footerHeight", this.footerHeight);
      json.put("headerHeight", this.headerHeight);

      json.put("firstHomescreenId", this.firstHomescreenId);
      json.put("secondHomescreenId", this.secondHomescreenId);
      json.put("thirdHomescreenId", this.thirdHomescreenId);
    } catch (JSONException exception) {
      Pinpoint.log("Could not create JSONObject from Configuration.");
    }

    return json;
  }
}




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