Back to project page pinpoint-android.
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.
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; } }