Skip to content

Commit

Permalink
Issue #SB-2600 fix: dial code search issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nikithshetty-juspay committed Apr 10, 2018
1 parent 9d9b895 commit cb73d8a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
64 changes: 33 additions & 31 deletions app/src/main/java/org/sunbird/utils/GenieWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,37 +299,39 @@ public void onError(GenieResponse<List<Content>> 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) {
Expand Down

0 comments on commit cb73d8a

Please sign in to comment.