mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
add missing files
This commit is contained in:
parent
dab8462349
commit
acbd23a7aa
2 changed files with 9 additions and 14 deletions
|
@ -682,21 +682,13 @@ public class JavaScriptDirectInterface {
|
|||
|
||||
/**
|
||||
* Record a user property
|
||||
* @param prefObjStr single key-value JSON string, like "{\"school\": \"Central High\"}"
|
||||
* @param key like "school"
|
||||
* @param propertyString like "Central High"
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void setAnalyticsPref(String prefObjStr) {
|
||||
if (prefObjStr != null) {
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(prefObjStr);
|
||||
JSONArray jsonArray = jsonObject.names();
|
||||
String key = jsonArray.getString(0);
|
||||
String value = jsonObject.getString(key);
|
||||
_activity.setAnalyticsPref(key, value);
|
||||
} catch (JSONException e) {
|
||||
Log.e(LOG_TAG, "JSON error: " + e.getMessage(), e);
|
||||
return;
|
||||
}
|
||||
public void setAnalyticsPref(String key, String propertyString) {
|
||||
if (key != null) {
|
||||
_activity.setAnalyticsPref(key, propertyString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -313,7 +313,10 @@ NSMutableDictionary *soundtimers;
|
|||
NSDictionary *page = [json valueForKey:name];
|
||||
for (NSString *spriteName in [page valueForKey:@"sprites"]) {
|
||||
NSDictionary *sprite = [page valueForKey:spriteName];
|
||||
[sprites setValue:sprite forKey:[sprite valueForKey:@"md5"]];
|
||||
NSString *md5 = [sprite valueForKey:@"md5"];
|
||||
if (md5 != nil) {
|
||||
[sprites setValue:sprite forKey:md5];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue