Nextrek
@ 792
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
package nextrek.minstrek.core; import java.util.ArrayList; import java.util.Locale; import org.json.JSONException; import org.json.JSONObject; public class PageModel { String text; String topImage; ArrayList<ButtonModel> buttons = new ArrayList<ButtonModel>(); public PageModel(JSONObject jsonData) { this.text = jsonData.optString("text"); this.topImage = jsonData.optString("topImage"); if (this.topImage != null) { this.topImage = this.topImage.toLowerCase(Locale.ENGLISH); this.topImage = this.topImage.replaceAll("à", "a"); this.topImage = this.topImage.replaceAll("è", "e"); this.topImage = this.topImage.replaceAll("é", "e"); this.topImage = this.topImage.replaceAll("ì", "i"); this.topImage = this.topImage.replaceAll("ò", "o"); this.topImage = this.topImage.replaceAll("ù", "u"); } int buttonCount = jsonData.optInt("buttons"); for (int i = 0; i < buttonCount; i++) { try { buttons.add(new ButtonModel(jsonData.getJSONObject("button" + i))); } catch (JSONException e) { e.printStackTrace(); } } } public String getText() { return this.text; } public String getTopImage() { return this.topImage; } public ArrayList<ButtonModel> getButtons() { return this.buttons; } } |
Commits for Nextrek/Android/Minstrek/MinstrekLib/app/src/main/java/nextrek/minstrek/core/PageModel.java
Revision | Author | Commited | Message |
---|---|---|---|
792 | MStefanelli | Fri 02 Oct, 2015 12:03:54 +0000 | New gradle version with ad |