Skip to content

Commit 6433e93

Browse files
committedMay 10, 2024
fix default value for margin
1 parent 20030cb commit 6433e93

File tree

1 file changed

+6
-1
lines changed
  • app/src/main/java/fr/nuage/souvenirs/model

1 file changed

+6
-1
lines changed
 

‎app/src/main/java/fr/nuage/souvenirs/model/Album.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.text.SimpleDateFormat;
2525
import java.util.ArrayList;
2626
import java.util.Date;
27+
import java.util.Iterator;
2728
import java.util.Locale;
2829
import java.util.UUID;
2930

@@ -95,7 +96,9 @@ public JSONObject toJSON() {
9596
json.put("id",id.toString());
9697
JSONArray jPages = new JSONArray();
9798
ArrayList<Page> mPages = pages;
98-
for( Page p: mPages ) {
99+
Iterator<Page> iterator = mPages.iterator();
100+
while(iterator.hasNext()){
101+
Page p = iterator.next();
99102
jPages.put(p.toJSON());
100103
}
101104
json.put("pages",jPages);
@@ -215,6 +218,8 @@ public boolean load() {
215218
}
216219
if (json.has("elementMargin")) {
217220
setElementMargin(json.getInt("elementMargin"));
221+
} else {
222+
setElementMargin(0);
218223
}
219224
} catch (JSONException e) {
220225
Log.w(this.getClass().getSimpleName(),"Wrong file format for "+this.albumPath,e);

0 commit comments

Comments
 (0)
Failed to load comments.