mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-01 07:13:56 +01:00
Merge branch 'master' into dependency-injection
This commit is contained in:
commit
f134d23ecb
111 changed files with 1230 additions and 364 deletions
|
|
@ -27,7 +27,7 @@ public class ModifierSequence {
|
|||
public ModifierSequence(Uri mediaUri, JSONObject data) {
|
||||
this(mediaUri);
|
||||
JSONArray modifiersJSON = data.optJSONArray("modifiers");
|
||||
for(int i=0; i< modifiersJSON.length(); i++) {
|
||||
for (int i=0; i< modifiersJSON.length(); i++) {
|
||||
modifiers.add(PageModifier.fromJSON(modifiersJSON.optJSONObject(i)));
|
||||
}
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ public class ModifierSequence {
|
|||
}
|
||||
|
||||
public String executeModifications(String pageName, String pageContents) {
|
||||
for(PageModifier modifier: modifiers) {
|
||||
for (PageModifier modifier: modifiers) {
|
||||
pageContents = modifier.doModification(pageName, pageContents);
|
||||
}
|
||||
return pageContents;
|
||||
|
|
@ -60,7 +60,7 @@ public class ModifierSequence {
|
|||
JSONObject data = new JSONObject();
|
||||
try {
|
||||
JSONArray modifiersJSON = new JSONArray();
|
||||
for(PageModifier modifier: modifiers) {
|
||||
for (PageModifier modifier: modifiers) {
|
||||
modifiersJSON.put(modifier.toJSON());
|
||||
}
|
||||
data.put("modifiers", modifiersJSON);
|
||||
|
|
@ -81,7 +81,8 @@ public class ModifierSequence {
|
|||
// Hardcoding column positions!
|
||||
ModifierSequence ms = null;
|
||||
try {
|
||||
ms = new ModifierSequence(Uri.parse(cursor.getString(1)), new JSONObject(cursor.getString(2)));
|
||||
ms = new ModifierSequence(Uri.parse(cursor.getString(1)),
|
||||
new JSONObject(cursor.getString(2)));
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue