diff --git a/app/build.gradle b/app/build.gradle index e8490c6..2928fca 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -187,7 +187,7 @@ android { dependencies { final SUPPORT_LIBRARY_VERSION = '25.4.0' - final GENIE_SDK_VERSION = "1.0.624" + final GENIE_SDK_VERSION = "1.0.626" final X_WALK_VERSION = '22.52.561.4' compile fileTree(dir: 'libs', include: ['*.jar']) diff --git a/app/src/main/java/org/sunbird/utils/GenieWrapper.java b/app/src/main/java/org/sunbird/utils/GenieWrapper.java index 610ffbc..d5155ba 100644 --- a/app/src/main/java/org/sunbird/utils/GenieWrapper.java +++ b/app/src/main/java/org/sunbird/utils/GenieWrapper.java @@ -299,37 +299,39 @@ public void onError(GenieResponse> genieResponse) { public void searchContent(final String callback, final String filterParams, final String query, final String type, final int count, final String[] keywords, boolean viewMoreClicked) { try { SunbirdContentSearchCriteria.SearchBuilder builder = new SunbirdContentSearchCriteria.SearchBuilder(); - String[] contentTypes; - - switch (type) { - case "Course": - contentTypes = new String[1]; - contentTypes[0] = ContentType.COURSE; - break; - - case "Library": - contentTypes = new String[7]; - contentTypes[0] = ContentType.STORY; - contentTypes[1] = ContentType.GAME; - contentTypes[2] = ContentType.TEXTBOOK; - contentTypes[3] = ContentType.COLLECTION; - contentTypes[4] = ContentType.WORKSHEET; - contentTypes[5] = ContentType.RESOURCE; - contentTypes[6] = ContentType.LESSONPLAN; - break; - - case "Combined": - default: - contentTypes = new String[8]; - contentTypes[0] = ContentType.STORY; - contentTypes[1] = ContentType.GAME; - contentTypes[2] = ContentType.TEXTBOOK; - contentTypes[3] = ContentType.COLLECTION; - contentTypes[4] = ContentType.WORKSHEET; - contentTypes[5] = ContentType.COURSE; - contentTypes[6] = ContentType.RESOURCE; - contentTypes[7] = ContentType.LESSONPLAN; - break; + String[] contentTypes = null; + + if (keywords == null) { + switch (type) { + case "Course": + contentTypes = new String[1]; + contentTypes[0] = ContentType.COURSE; + break; + + case "Library": + contentTypes = new String[7]; + contentTypes[0] = ContentType.STORY; + contentTypes[1] = ContentType.GAME; + contentTypes[2] = ContentType.TEXTBOOK; + contentTypes[3] = ContentType.COLLECTION; + contentTypes[4] = ContentType.WORKSHEET; + contentTypes[5] = ContentType.RESOURCE; + contentTypes[6] = ContentType.LESSONPLAN; + break; + + case "Combined": + default: + contentTypes = new String[8]; + contentTypes[0] = ContentType.STORY; + contentTypes[1] = ContentType.GAME; + contentTypes[2] = ContentType.TEXTBOOK; + contentTypes[3] = ContentType.COLLECTION; + contentTypes[4] = ContentType.WORKSHEET; + contentTypes[5] = ContentType.COURSE; + contentTypes[6] = ContentType.RESOURCE; + contentTypes[7] = ContentType.LESSONPLAN; + break; + } } if (BuildConfig.FILTER_CONTENT_BY_CHANNEL_ID) {