added back register device request, campaigns and articles implementation, new libs
Showing
22 changed files
with
847 additions
and
725 deletions
.idea/.gitignore
deleted
100644 → 0
.idea/compiler.xml
deleted
100644 → 0
.idea/deploymentTargetDropDown.xml
deleted
100644 → 0
.idea/deploymentTargetSelector.xml
deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project version="4"> | ||
| 3 | - <component name="deploymentTargetSelector"> | ||
| 4 | - <selectionStates> | ||
| 5 | - <SelectionState runConfigName="app"> | ||
| 6 | - <option name="selectionMode" value="DROPDOWN" /> | ||
| 7 | - <DropdownSelection timestamp="2025-02-13T08:44:19.612560Z"> | ||
| 8 | - <Target type="DEFAULT_BOOT"> | ||
| 9 | - <handle> | ||
| 10 | - <DeviceId pluginId="PhysicalDevice" identifier="serial=R58M42EM7YT" /> | ||
| 11 | - </handle> | ||
| 12 | - </Target> | ||
| 13 | - </DropdownSelection> | ||
| 14 | - <DialogSelection /> | ||
| 15 | - </SelectionState> | ||
| 16 | - </selectionStates> | ||
| 17 | - </component> | ||
| 18 | -</project> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
.idea/gradle.xml
deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project version="4"> | ||
| 3 | - <component name="GradleMigrationSettings" migrationVersion="1" /> | ||
| 4 | - <component name="GradleSettings"> | ||
| 5 | - <option name="linkedExternalProjectsSettings"> | ||
| 6 | - <GradleProjectSettings> | ||
| 7 | - <option name="testRunner" value="CHOOSE_PER_TEST" /> | ||
| 8 | - <option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||
| 9 | - <option name="gradleHome" value="$PROJECT_DIR$/../../../../../../gradle-6.6.1" /> | ||
| 10 | - <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> | ||
| 11 | - <option name="modules"> | ||
| 12 | - <set> | ||
| 13 | - <option value="$PROJECT_DIR$" /> | ||
| 14 | - <option value="$PROJECT_DIR$/app" /> | ||
| 15 | - <option value="$PROJECT_DIR$/warply_android_sdk" /> | ||
| 16 | - </set> | ||
| 17 | - </option> | ||
| 18 | - <option name="resolveExternalAnnotations" value="false" /> | ||
| 19 | - </GradleProjectSettings> | ||
| 20 | - </option> | ||
| 21 | - </component> | ||
| 22 | -</project> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
| 1 | -<component name="InspectionProjectProfileManager"> | ||
| 2 | - <profile version="1.0"> | ||
| 3 | - <option name="myName" value="Project Default" /> | ||
| 4 | - <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true"> | ||
| 5 | - <option name="TOP_LEVEL_CLASS_OPTIONS"> | ||
| 6 | - <value> | ||
| 7 | - <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> | ||
| 8 | - <option name="REQUIRED_TAGS" value="" /> | ||
| 9 | - </value> | ||
| 10 | - </option> | ||
| 11 | - <option name="INNER_CLASS_OPTIONS"> | ||
| 12 | - <value> | ||
| 13 | - <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> | ||
| 14 | - <option name="REQUIRED_TAGS" value="" /> | ||
| 15 | - </value> | ||
| 16 | - </option> | ||
| 17 | - <option name="METHOD_OPTIONS"> | ||
| 18 | - <value> | ||
| 19 | - <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> | ||
| 20 | - <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" /> | ||
| 21 | - </value> | ||
| 22 | - </option> | ||
| 23 | - <option name="FIELD_OPTIONS"> | ||
| 24 | - <value> | ||
| 25 | - <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> | ||
| 26 | - <option name="REQUIRED_TAGS" value="" /> | ||
| 27 | - </value> | ||
| 28 | - </option> | ||
| 29 | - <option name="IGNORE_DEPRECATED" value="false" /> | ||
| 30 | - <option name="IGNORE_JAVADOC_PERIOD" value="true" /> | ||
| 31 | - <option name="IGNORE_DUPLICATED_THROWS" value="false" /> | ||
| 32 | - <option name="IGNORE_POINT_TO_ITSELF" value="false" /> | ||
| 33 | - <option name="myAdditionalJavadocTags" value="guide" /> | ||
| 34 | - </inspection_tool> | ||
| 35 | - </profile> | ||
| 36 | -</component> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
.idea/jarRepositories.xml
deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project version="4"> | ||
| 3 | - <component name="RemoteRepositoriesConfiguration"> | ||
| 4 | - <remote-repository> | ||
| 5 | - <option name="id" value="central" /> | ||
| 6 | - <option name="name" value="Maven Central repository" /> | ||
| 7 | - <option name="url" value="https://repo1.maven.org/maven2" /> | ||
| 8 | - </remote-repository> | ||
| 9 | - <remote-repository> | ||
| 10 | - <option name="id" value="jboss.community" /> | ||
| 11 | - <option name="name" value="JBoss Community repository" /> | ||
| 12 | - <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> | ||
| 13 | - </remote-repository> | ||
| 14 | - <remote-repository> | ||
| 15 | - <option name="id" value="maven" /> | ||
| 16 | - <option name="name" value="maven" /> | ||
| 17 | - <option name="url" value="https://developer.huawei.com/repo/" /> | ||
| 18 | - </remote-repository> | ||
| 19 | - <remote-repository> | ||
| 20 | - <option name="id" value="MavenRepo" /> | ||
| 21 | - <option name="name" value="MavenRepo" /> | ||
| 22 | - <option name="url" value="https://repo.maven.apache.org/maven2/" /> | ||
| 23 | - </remote-repository> | ||
| 24 | - <remote-repository> | ||
| 25 | - <option name="id" value="Google" /> | ||
| 26 | - <option name="name" value="Google" /> | ||
| 27 | - <option name="url" value="https://dl.google.com/dl/android/maven2/" /> | ||
| 28 | - </remote-repository> | ||
| 29 | - <remote-repository> | ||
| 30 | - <option name="id" value="maven2" /> | ||
| 31 | - <option name="name" value="maven2" /> | ||
| 32 | - <option name="url" value="https://plugins.gradle.org/m2/" /> | ||
| 33 | - </remote-repository> | ||
| 34 | - </component> | ||
| 35 | -</project> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
.idea/migrations.xml
deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project version="4"> | ||
| 3 | - <component name="ProjectMigrations"> | ||
| 4 | - <option name="MigrateToGradleLocalJavaHome"> | ||
| 5 | - <set> | ||
| 6 | - <option value="$PROJECT_DIR$" /> | ||
| 7 | - </set> | ||
| 8 | - </option> | ||
| 9 | - </component> | ||
| 10 | -</project> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
.idea/misc.xml
deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project version="4"> | ||
| 3 | - <component name="DesignSurface"> | ||
| 4 | - <option name="filePathToZoomLevelMap"> | ||
| 5 | - <map> | ||
| 6 | - <entry key="..\:/Users/Warply/AppData/Local/Android/Sdk/platforms/android-31/data/res/drawable/btn_dropdown.xml" value="0.2705" /> | ||
| 7 | - <entry key="..\:/Users/Warply/AppData/Local/Android/Sdk/platforms/android-31/data/res/layout/simple_spinner_dropdown_item.xml" value="0.358695652173913" /> | ||
| 8 | - <entry key="..\:/Users/Warply/AppData/Local/Android/Sdk/platforms/android-31/data/res/layout/simple_spinner_item.xml" value="0.358695652173913" /> | ||
| 9 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/app/src/main/res/layout/activity_main.xml" value="0.22418478260869565" /> | ||
| 10 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/app/src/main/res/layout/activity_splash.xml" value="0.358695652173913" /> | ||
| 11 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/app/src/main/res/layout/campaign_grid_item.xml" value="0.18802083333333333" /> | ||
| 12 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.196" /> | ||
| 13 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border.xml" value="0.2965" /> | ||
| 14 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_gradient.xml" value="0.2965" /> | ||
| 15 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_grey_bg.xml" value="0.2705" /> | ||
| 16 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_grey_bg2.xml" value="0.2705" /> | ||
| 17 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_grey_bg3.xml" value="0.2705" /> | ||
| 18 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_grey_bg4.xml" value="0.2705" /> | ||
| 19 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_grey_bg_left_radius.xml" value="0.2705" /> | ||
| 20 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_grey_bg_right_radius.xml" value="0.2705" /> | ||
| 21 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_light_blue.xml" value="0.2965" /> | ||
| 22 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_light_grey.xml" value="0.2965" /> | ||
| 23 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_white.xml" value="0.2705" /> | ||
| 24 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_white2.xml" value="0.2705" /> | ||
| 25 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_white3.xml" value="0.2705" /> | ||
| 26 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_white_bg_right_radius.xml" value="0.2705" /> | ||
| 27 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/banner_border_white_rounded_top.xml" value="0.2965" /> | ||
| 28 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/bg_spinner_arrow.xml" value="0.2705" /> | ||
| 29 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/bottom_border.xml" value="0.2705" /> | ||
| 30 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/bottom_border_gradient.xml" value="0.2705" /> | ||
| 31 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/bottom_border_gradient2.xml" value="0.2965" /> | ||
| 32 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/bottom_border_gradient_grey_bg.xml" value="0.2965" /> | ||
| 33 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/bottom_border_grey_transparent.xml" value="0.2965" /> | ||
| 34 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/bottom_border_light_blue.xml" value="0.2965" /> | ||
| 35 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/bottom_border_transparent.xml" value="0.2705" /> | ||
| 36 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/button_border_dark_blue.xml" value="0.2965" /> | ||
| 37 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/button_border_grey.xml" value="0.2705" /> | ||
| 38 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/divider.xml" value="0.2965" /> | ||
| 39 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/divider2.xml" value="0.2965" /> | ||
| 40 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/round_border.xml" value="0.2705" /> | ||
| 41 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/round_border_green.xml" value="0.2705" /> | ||
| 42 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/round_border_green2.xml" value="0.2965" /> | ||
| 43 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/round_border_green2_tr.xml" value="0.2965" /> | ||
| 44 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/round_border_tr.xml" value="0.2705" /> | ||
| 45 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/round_border_with_border_radius.xml" value="0.2705" /> | ||
| 46 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_button_green.xml" value="0.2705" /> | ||
| 47 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_button_green_border.xml" value="0.2965" /> | ||
| 48 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_button_grey.xml" value="0.2705" /> | ||
| 49 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_cos_campaign.xml" value="0.2705" /> | ||
| 50 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_cos_white.xml" value="0.2705" /> | ||
| 51 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_menu_explore.xml" value="0.2705" /> | ||
| 52 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_menu_home.xml" value="0.2705" /> | ||
| 53 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_menu_loyalty.xml" value="0.2705" /> | ||
| 54 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_menu_profile.xml" value="0.2705" /> | ||
| 55 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_menu_shop.xml" value="0.2705" /> | ||
| 56 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_spinner_arrow.xml" value="0.2705" /> | ||
| 57 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/selector_tab_title_color.xml" value="0.2705" /> | ||
| 58 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_campaign_white.xml" value="0.2705" /> | ||
| 59 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_campaign_white_tr.xml" value="0.2705" /> | ||
| 60 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_coupon_info.xml" value="0.2705" /> | ||
| 61 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_gradient.xml" value="0.2705" /> | ||
| 62 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_gradient2.xml" value="0.2705" /> | ||
| 63 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_gradient3.xml" value="0.2705" /> | ||
| 64 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_gradient4.xml" value="0.2705" /> | ||
| 65 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_gradient5.xml" value="0.2705" /> | ||
| 66 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_gradient6.xml" value="0.2965" /> | ||
| 67 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_gradient6_shahow.xml" value="0.2965" /> | ||
| 68 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_gradient_coupons_bg.xml" value="0.2705" /> | ||
| 69 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_green.xml" value="0.2705" /> | ||
| 70 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_green_tr.xml" value="0.2705" /> | ||
| 71 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_grey.xml" value="0.2705" /> | ||
| 72 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_grey2.xml" value="0.2705" /> | ||
| 73 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_grey2_tr.xml" value="0.2705" /> | ||
| 74 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_grey3.xml" value="0.2705" /> | ||
| 75 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_grey4.xml" value="0.2965" /> | ||
| 76 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_grey5.xml" value="0.2965" /> | ||
| 77 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_grey_shadow.xml" value="0.2965" /> | ||
| 78 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_loyalty.xml" value="0.2705" /> | ||
| 79 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_loyalty_no_border.xml" value="0.2965" /> | ||
| 80 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_loyalty_white.xml" value="0.2965" /> | ||
| 81 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_mfy_rounded.xml" value="0.2965" /> | ||
| 82 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_profile.xml" value="0.2705" /> | ||
| 83 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_profile_gradient.xml" value="0.2705" /> | ||
| 84 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_profile_image.xml" value="0.2965" /> | ||
| 85 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_sky_blue.xml" value="0.2705" /> | ||
| 86 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_transparent.xml" value="0.2705" /> | ||
| 87 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_transparent_rounded.xml" value="0.2705" /> | ||
| 88 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_transparent_rounded2.xml" value="0.2705" /> | ||
| 89 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_transparent_rounded3.xml" value="0.2705" /> | ||
| 90 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_transparent_top_rounded.xml" value="0.2705" /> | ||
| 91 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_transparent_upper_circle.xml" value="0.2705" /> | ||
| 92 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_white.xml" value="0.2705" /> | ||
| 93 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_white2.xml" value="0.2705" /> | ||
| 94 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_white_border.xml" value="0.2965" /> | ||
| 95 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_white_rounded_lower.xml" value="0.2705" /> | ||
| 96 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_white_rounded_top.xml" value="0.2965" /> | ||
| 97 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_cos_white_tr.xml" value="0.2705" /> | ||
| 98 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_dashed.xml" value="0.2705" /> | ||
| 99 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_dashed_vertical.xml" value="0.2705" /> | ||
| 100 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_line_gradient.xml" value="0.2965" /> | ||
| 101 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_market_limit.xml" value="0.2965" /> | ||
| 102 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_round_border_gradient.xml" value="0.2965" /> | ||
| 103 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_round_border_gradient2.xml" value="0.2965" /> | ||
| 104 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/shape_top_left_rounded.xml" value="0.2705" /> | ||
| 105 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/svg_background_more.xml" value="0.2705" /> | ||
| 106 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/svg_background_transparent.xml" value="0.2965" /> | ||
| 107 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/drawable/svg_background_transparent2.xml" value="0.2965" /> | ||
| 108 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/font/warply_font_family.xml" value="0.396875" /> | ||
| 109 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/active_coupon_layout.xml" value="0.358695652173913" /> | ||
| 110 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/active_rewards_layout.xml" value="0.358695652173913" /> | ||
| 111 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_active_coupons.xml" value="0.358695652173913" /> | ||
| 112 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_active_gifts.xml" value="0.36666666666666664" /> | ||
| 113 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_active_rewards.xml" value="0.358695652173913" /> | ||
| 114 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_base_fragment.xml" value="0.25" /> | ||
| 115 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_bill_payment.xml" value="0.358695652173913" /> | ||
| 116 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_contextual.xml" value="0.22" /> | ||
| 117 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_coupon_gift.xml" value="0.36666666666666664" /> | ||
| 118 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_coupon_info.xml" value="0.2" /> | ||
| 119 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_coupon_share.xml" value="0.22" /> | ||
| 120 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_coupons_history.xml" value="0.358695652173913" /> | ||
| 121 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_couponset_info.xml" value="0.22" /> | ||
| 122 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_gifts_for_you.xml" value="0.22" /> | ||
| 123 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_list_for_you.xml" value="0.358695652173913" /> | ||
| 124 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_loyalty.xml" value="0.3226397800183318" /> | ||
| 125 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_loyalty_analysis.xml" value="0.33" /> | ||
| 126 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_loyalty_market_analysis.xml" value="0.23157894736842105" /> | ||
| 127 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml" value="0.30782684739833843" /> | ||
| 128 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_more_for_you.xml" value="0.22" /> | ||
| 129 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_past_coupons.xml" value="0.358695652173913" /> | ||
| 130 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_shops.xml" value="0.36666666666666664" /> | ||
| 131 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_shops_huawei.xml" value="0.18618618618618618" /> | ||
| 132 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_steps.xml" value="0.358695652173913" /> | ||
| 133 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_telco.xml" value="0.2" /> | ||
| 134 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_unified_coupon_info.xml" value="0.23157894736842105" /> | ||
| 135 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_webview.xml" value="0.4282238442822384" /> | ||
| 136 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/burnt_coupon_layout.xml" value="0.358695652173913" /> | ||
| 137 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/button_with_image.xml" value="0.358695652173913" /> | ||
| 138 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/carousel_item.xml" value="0.358695652173913" /> | ||
| 139 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/cos_analysis.xml" value="0.358695652173913" /> | ||
| 140 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/cos_piechart.xml" value="0.358695652173913" /> | ||
| 141 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/cos_piechart2.xml" value="0.358695652173913" /> | ||
| 142 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/cos_piechart_conditional_render.xml" value="0.358695652173913" /> | ||
| 143 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/coupon_layout.xml" value="0.358695652173913" /> | ||
| 144 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/coupon_transaction.xml" value="0.358695652173913" /> | ||
| 145 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/custom_coupon_layout.xml" value="0.30085470085470084" /> | ||
| 146 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/dl_dialog.xml" value="0.358695652173913" /> | ||
| 147 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/dl_map_pin.xml" value="0.36666666666666664" /> | ||
| 148 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/dl_share.xml" value="0.36666666666666664" /> | ||
| 149 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/dlg_success.xml" value="0.358695652173913" /> | ||
| 150 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/expired_coupon_layout.xml" value="0.36666666666666664" /> | ||
| 151 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/fragment_home.xml" value="0.22" /> | ||
| 152 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/fragment_loyalty.xml" value="0.358695652173913" /> | ||
| 153 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/fragment_profile.xml" value="0.358695652173913" /> | ||
| 154 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/gift_layout.xml" value="0.358695652173913" /> | ||
| 155 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/info_widget.xml" value="0.358695652173913" /> | ||
| 156 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/item_merged_gifts_recycler.xml" value="0.36666666666666664" /> | ||
| 157 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/item_profile_recycler.xml" value="0.358695652173913" /> | ||
| 158 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/item_profile_recycler2.xml" value="0.36666666666666664" /> | ||
| 159 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/item_profile_recycler_vertical.xml" value="0.358695652173913" /> | ||
| 160 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/item_selectable.xml" value="0.36666666666666664" /> | ||
| 161 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/item_share.xml" value="0.36666666666666664" /> | ||
| 162 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/layout_inapp_alert_dialog_default.xml" value="0.358695652173913" /> | ||
| 163 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/loyalty_analysis_container.xml" value="0.358695652173913" /> | ||
| 164 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/loyalty_banner.xml" value="0.358695652173913" /> | ||
| 165 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/loyalty_burnt_coupons.xml" value="0.358695652173913" /> | ||
| 166 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/loyalty_coupons.xml" value="0.358695652173913" /> | ||
| 167 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/loyalty_gifts.xml" value="0.358695652173913" /> | ||
| 168 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/loyalty_redeemed_gifts.xml" value="0.358695652173913" /> | ||
| 169 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/market_coupon_layout.xml" value="0.23157894736842105" /> | ||
| 170 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/past_coupon_layout.xml" value="0.358695652173913" /> | ||
| 171 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/payment_success_dialog.xml" value="0.358695652173913" /> | ||
| 172 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/redeemed_gift_layout.xml" value="0.358695652173913" /> | ||
| 173 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/shape_cos_gradient.xml" value="0.358695652173913" /> | ||
| 174 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/shared_coupon_layout.xml" value="0.36666666666666664" /> | ||
| 175 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/spinner_dropdown_item.xml" value="0.358695652173913" /> | ||
| 176 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/spinner_dropdown_item_grey.xml" value="0.358695652173913" /> | ||
| 177 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/spinner_dropdown_item_sky_blue.xml" value="0.358695652173913" /> | ||
| 178 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/spinner_item.xml" value="0.358695652173913" /> | ||
| 179 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/spinner_item_grey.xml" value="0.358695652173913" /> | ||
| 180 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/tab_analysis.xml" value="0.358695652173913" /> | ||
| 181 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/tab_analysis_grey_bg.xml" value="0.358695652173913" /> | ||
| 182 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/tab_coupon_analysis.xml" value="0.36666666666666664" /> | ||
| 183 | - <entry key="..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/menu/menu_bottom_nav.xml" value="0.36666666666666664" /> | ||
| 184 | - </map> | ||
| 185 | - </option> | ||
| 186 | - </component> | ||
| 187 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="zulu-17" project-jdk-type="JavaSDK"> | ||
| 188 | - <output url="file://$PROJECT_DIR$/build/classes" /> | ||
| 189 | - </component> | ||
| 190 | - <component name="ProjectType"> | ||
| 191 | - <option name="id" value="Android" /> | ||
| 192 | - </component> | ||
| 193 | -</project> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
.idea/runConfigurations.xml
deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project version="4"> | ||
| 3 | - <component name="RunConfigurationProducerService"> | ||
| 4 | - <option name="ignoredProducers"> | ||
| 5 | - <set> | ||
| 6 | - <option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" /> | ||
| 7 | - <option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" /> | ||
| 8 | - <option value="com.intellij.execution.junit.PatternConfigurationProducer" /> | ||
| 9 | - <option value="com.intellij.execution.junit.TestInClassConfigurationProducer" /> | ||
| 10 | - <option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" /> | ||
| 11 | - <option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" /> | ||
| 12 | - <option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" /> | ||
| 13 | - <option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" /> | ||
| 14 | - </set> | ||
| 15 | - </option> | ||
| 16 | - </component> | ||
| 17 | -</project> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
.idea/vcs.xml
deleted
100644 → 0
| ... | @@ -68,7 +68,7 @@ dependencies { | ... | @@ -68,7 +68,7 @@ dependencies { | 
| 68 | implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' | 68 | implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' | 
| 69 | implementation 'io.reactivex.rxjava3:rxjava:3.1.8' | 69 | implementation 'io.reactivex.rxjava3:rxjava:3.1.8' | 
| 70 | implementation 'io.reactivex.rxjava3:rxandroid:3.0.2' | 70 | implementation 'io.reactivex.rxjava3:rxandroid:3.0.2' | 
| 71 | - implementation 'com.google.android.material:material:1.12.0' | 71 | + implementation 'com.google.android.material:material:1.13.0' | 
| 72 | implementation 'org.greenrobot:eventbus:3.3.1' | 72 | implementation 'org.greenrobot:eventbus:3.3.1' | 
| 73 | implementation 'com.google.guava:guava:33.0.0-android' | 73 | implementation 'com.google.guava:guava:33.0.0-android' | 
| 74 | 74 | ||
| ... | @@ -99,14 +99,14 @@ dependencies { | ... | @@ -99,14 +99,14 @@ dependencies { | 
| 99 | implementation 'androidx.sqlite:sqlite:2.5.2' | 99 | implementation 'androidx.sqlite:sqlite:2.5.2' | 
| 100 | 100 | ||
| 101 | //------------------------------ Retrofit -----------------------------// | 101 | //------------------------------ Retrofit -----------------------------// | 
| 102 | - implementation 'com.squareup.retrofit2:retrofit:2.9.0' | 102 | + implementation 'com.squareup.retrofit2:retrofit:3.0.0' | 
| 103 | - implementation 'com.squareup.retrofit2:converter-gson:2.9.0' | 103 | + implementation 'com.squareup.retrofit2:converter-gson:3.0.0' | 
| 104 | 104 | ||
| 105 | //------------------------------ Lifecycle -----------------------------// | 105 | //------------------------------ Lifecycle -----------------------------// | 
| 106 | implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" | 106 | implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" | 
| 107 | 107 | ||
| 108 | //------------------------------ Retrofit Logs -----------------------------// | 108 | //------------------------------ Retrofit Logs -----------------------------// | 
| 109 | -// implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' | 109 | + implementation 'com.squareup.okhttp3:logging-interceptor:5.1.0' | 
| 110 | } | 110 | } | 
| 111 | 111 | ||
| 112 | // In every export please update the version number | 112 | // In every export please update the version number | ... | ... | 
| ... | @@ -744,7 +744,7 @@ public enum Warply { | ... | @@ -744,7 +744,7 @@ public enum Warply { | 
| 744 | return; | 744 | return; | 
| 745 | } | 745 | } | 
| 746 | if (!WarpUtils.isRegisteredWarply(context)) { | 746 | if (!WarpUtils.isRegisteredWarply(context)) { | 
| 747 | - registerWarply(context); | 747 | + registerWarply(); | 
| 748 | return; | 748 | return; | 
| 749 | } | 749 | } | 
| 750 | if (WarpUtils.getIsDEVICEINFOENABLED(context)) | 750 | if (WarpUtils.getIsDEVICEINFOENABLED(context)) | 
| ... | @@ -1378,7 +1378,7 @@ public enum Warply { | ... | @@ -1378,7 +1378,7 @@ public enum Warply { | 
| 1378 | WarplyDBHelper.getInstance(mContext).deleteAllRequests(); | 1378 | WarplyDBHelper.getInstance(mContext).deleteAllRequests(); | 
| 1379 | WarplyDBHelper.getInstance(mContext).deleteAllPushRequests(); | 1379 | WarplyDBHelper.getInstance(mContext).deleteAllPushRequests(); | 
| 1380 | WarplyDBHelper.getInstance(mContext).deleteAllPushAckRequests(); | 1380 | WarplyDBHelper.getInstance(mContext).deleteAllPushAckRequests(); | 
| 1381 | - String webId = result.optString("web_id", ""); | 1381 | + String webId = result.optString("web_id", "deprecated"); | 
| 1382 | WarpUtils.setWebId(mContext, webId); | 1382 | WarpUtils.setWebId(mContext, webId); | 
| 1383 | String apiKey = result.optString("api_key", ""); | 1383 | String apiKey = result.optString("api_key", ""); | 
| 1384 | WarpUtils.setApiKey(mContext, apiKey); | 1384 | WarpUtils.setApiKey(mContext, apiKey); | ... | ... | 
| ... | @@ -10,6 +10,7 @@ import android.widget.LinearLayout; | ... | @@ -10,6 +10,7 @@ import android.widget.LinearLayout; | 
| 10 | import android.widget.RelativeLayout; | 10 | import android.widget.RelativeLayout; | 
| 11 | import android.widget.TextView; | 11 | import android.widget.TextView; | 
| 12 | 12 | ||
| 13 | +import androidx.constraintlayout.widget.ConstraintLayout; | ||
| 13 | import androidx.recyclerview.widget.LinearLayoutManager; | 14 | import androidx.recyclerview.widget.LinearLayoutManager; | 
| 14 | import androidx.recyclerview.widget.RecyclerView; | 15 | import androidx.recyclerview.widget.RecyclerView; | 
| 15 | import androidx.viewpager2.widget.ViewPager2; | 16 | import androidx.viewpager2.widget.ViewPager2; | 
| ... | @@ -24,7 +25,7 @@ import ly.warp.sdk.R; | ... | @@ -24,7 +25,7 @@ import ly.warp.sdk.R; | 
| 24 | import ly.warp.sdk.io.adapters.BannerAdapter; | 25 | import ly.warp.sdk.io.adapters.BannerAdapter; | 
| 25 | import ly.warp.sdk.io.adapters.OfferAdapter; | 26 | import ly.warp.sdk.io.adapters.OfferAdapter; | 
| 26 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 27 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 
| 27 | -import ly.warp.sdk.io.models.Campaign; | 28 | +import ly.warp.sdk.io.models.BannerItem; | 
| 28 | import ly.warp.sdk.io.models.DummyDataProvider; | 29 | import ly.warp.sdk.io.models.DummyDataProvider; | 
| 29 | import ly.warp.sdk.io.models.OfferCategory; | 30 | import ly.warp.sdk.io.models.OfferCategory; | 
| 30 | import ly.warp.sdk.io.models.OfferItem; | 31 | import ly.warp.sdk.io.models.OfferItem; | 
| ... | @@ -85,6 +86,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe | ... | @@ -85,6 +86,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe | 
| 85 | private TextView mTvAllOffers, mTvAllFavorites, mTvAllViability, mTvAllFamily, | 86 | private TextView mTvAllOffers, mTvAllFavorites, mTvAllViability, mTvAllFamily, | 
| 86 | mTvAllCoffee, mTvAllTravelling, mTvAllKids, mTvAllPurchases; | 87 | mTvAllCoffee, mTvAllTravelling, mTvAllKids, mTvAllPurchases; | 
| 87 | private ImageView mIvProfile; | 88 | private ImageView mIvProfile; | 
| 89 | + private ConstraintLayout mViewPager; | ||
| 88 | 90 | ||
| 89 | // =========================================================== | 91 | // =========================================================== | 
| 90 | // Methods for/from SuperClass/Interfaces | 92 | // Methods for/from SuperClass/Interfaces | 
| ... | @@ -143,6 +145,8 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe | ... | @@ -143,6 +145,8 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe | 
| 143 | mPbLoading = findViewById(R.id.pb_loading); | 145 | mPbLoading = findViewById(R.id.pb_loading); | 
| 144 | mPbLoading.setOnTouchListener((v, event) -> true); | 146 | mPbLoading.setOnTouchListener((v, event) -> true); | 
| 145 | 147 | ||
| 148 | + mViewPager = findViewById(R.id.cl_viewpager); | ||
| 149 | + | ||
| 146 | mIvProfile = findViewById(R.id.profile_icon); | 150 | mIvProfile = findViewById(R.id.profile_icon); | 
| 147 | mIvProfile.setOnClickListener(this); | 151 | mIvProfile.setOnClickListener(this); | 
| 148 | 152 | ||
| ... | @@ -421,10 +425,14 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe | ... | @@ -421,10 +425,14 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe | 
| 421 | mBannerViewPager = findViewById(R.id.banner_viewpager); | 425 | mBannerViewPager = findViewById(R.id.banner_viewpager); | 
| 422 | mDotsContainer = findViewById(R.id.dots_container); | 426 | mDotsContainer = findViewById(R.id.dots_container); | 
| 423 | 427 | ||
| 424 | - mBannerAdapter = new BannerAdapter(this, WarplyManagerHelper.getCampaignList()); | 428 | + mBannerAdapter = new BannerAdapter(this, WarplyManagerHelper.getBannerList()); | 
| 425 | - mBannerAdapter.setOnBannerClickListener(campaign -> { | 429 | + mBannerAdapter.setOnBannerCampaignClickListener(campaign -> { | 
| 426 | startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(campaign))); | 430 | startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(campaign))); | 
| 427 | }); | 431 | }); | 
| 432 | + mBannerAdapter.setOnBannerContentClickListener(article -> { | ||
| 433 | + //TODO: click article | ||
| 434 | + String s = ""; | ||
| 435 | + }); | ||
| 428 | 436 | ||
| 429 | // Set the number of pages to preload for adjacent items | 437 | // Set the number of pages to preload for adjacent items | 
| 430 | mBannerViewPager.setOffscreenPageLimit(5); | 438 | mBannerViewPager.setOffscreenPageLimit(5); | 
| ... | @@ -432,7 +440,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe | ... | @@ -432,7 +440,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe | 
| 432 | mBannerViewPager.setAdapter(mBannerAdapter); | 440 | mBannerViewPager.setAdapter(mBannerAdapter); | 
| 433 | 441 | ||
| 434 | // Setup pagination dots | 442 | // Setup pagination dots | 
| 435 | - setupPaginationDots(WarplyManagerHelper.getCampaignList().size()); | 443 | + setupPaginationDots(WarplyManagerHelper.getBannerList().size()); | 
| 436 | 444 | ||
| 437 | // Handle page changes | 445 | // Handle page changes | 
| 438 | mBannerViewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { | 446 | mBannerViewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { | 
| ... | @@ -486,26 +494,29 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe | ... | @@ -486,26 +494,29 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe | 
| 486 | } | 494 | } | 
| 487 | } | 495 | } | 
| 488 | 496 | ||
| 489 | - private CallbackReceiver<ArrayList<Campaign>> mCampaignsCallback = new CallbackReceiver<ArrayList<Campaign>>() { | 497 | + private CallbackReceiver<ArrayList<BannerItem>> mCampaignsCallback = new CallbackReceiver<ArrayList<BannerItem>>() { | 
| 490 | @Override | 498 | @Override | 
| 491 | - public void onSuccess(ArrayList<Campaign> result) { | 499 | + public void onSuccess(ArrayList<BannerItem> result) { | 
| 492 | mPbLoading.setVisibility(View.GONE); | 500 | mPbLoading.setVisibility(View.GONE); | 
| 493 | if (result != null && !result.isEmpty()) { | 501 | if (result != null && !result.isEmpty()) { | 
| 494 | // Preloads the campaigns' images | 502 | // Preloads the campaigns' images | 
| 495 | - result.forEach(campaign -> { | 503 | + result.forEach(bannerItem -> { | 
| 496 | Glide.with(getApplicationContext()) | 504 | Glide.with(getApplicationContext()) | 
| 497 | - .load(campaign.getLogoUrl()) | 505 | + .load(bannerItem.isCampaign() ? bannerItem.getCampaign().getLogoUrl() : bannerItem.getContent().getImgPreview()) | 
| 498 | .diskCacheStrategy(DiskCacheStrategy.DATA) | 506 | .diskCacheStrategy(DiskCacheStrategy.DATA) | 
| 499 | .preload(); | 507 | .preload(); | 
| 500 | }); | 508 | }); | 
| 501 | 509 | ||
| 502 | setupBannerCarousel(); | 510 | setupBannerCarousel(); | 
| 511 | + } else { | ||
| 512 | + mViewPager.setVisibility(View.GONE); | ||
| 503 | } | 513 | } | 
| 504 | } | 514 | } | 
| 505 | 515 | ||
| 506 | @Override | 516 | @Override | 
| 507 | public void onFailure(int errorCode) { | 517 | public void onFailure(int errorCode) { | 
| 508 | mPbLoading.setVisibility(View.GONE); | 518 | mPbLoading.setVisibility(View.GONE); | 
| 519 | + mViewPager.setVisibility(View.GONE); | ||
| 509 | } | 520 | } | 
| 510 | }; | 521 | }; | 
| 511 | } | 522 | } | ... | ... | 
| ... | @@ -15,25 +15,36 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; | ... | @@ -15,25 +15,36 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; | 
| 15 | import java.util.ArrayList; | 15 | import java.util.ArrayList; | 
| 16 | 16 | ||
| 17 | import ly.warp.sdk.R; | 17 | import ly.warp.sdk.R; | 
| 18 | +import ly.warp.sdk.io.models.BannerItem; | ||
| 18 | import ly.warp.sdk.io.models.Campaign; | 19 | import ly.warp.sdk.io.models.Campaign; | 
| 20 | +import ly.warp.sdk.io.models.Content; | ||
| 19 | 21 | ||
| 20 | public class BannerAdapter extends RecyclerView.Adapter<BannerAdapter.BannerViewHolder> { | 22 | public class BannerAdapter extends RecyclerView.Adapter<BannerAdapter.BannerViewHolder> { | 
| 21 | 23 | ||
| 22 | private final Context mContext; | 24 | private final Context mContext; | 
| 23 | - private final ArrayList<Campaign> mCampaigns; | 25 | + private final ArrayList<BannerItem> mBannerItems; | 
| 24 | - private OnBannerClickListener mListener; | 26 | + private OnBannerCampaignClickListener mListenerCampaign; | 
| 27 | + private OnBannerContentClickListener mListenerContent; | ||
| 25 | 28 | ||
| 26 | - public interface OnBannerClickListener { | 29 | + public interface OnBannerCampaignClickListener { | 
| 27 | - void onBannerClick(Campaign campaign); | 30 | + void onBannerCampaignClick(Campaign campaign); | 
| 28 | } | 31 | } | 
| 29 | 32 | ||
| 30 | - public BannerAdapter(Context context, ArrayList<Campaign> campaigns) { | 33 | + public interface OnBannerContentClickListener { | 
| 34 | + void onBannerContentClick(Content content); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + public BannerAdapter(Context context, ArrayList<BannerItem> campaigns) { | ||
| 31 | this.mContext = context; | 38 | this.mContext = context; | 
| 32 | - this.mCampaigns = campaigns; | 39 | + this.mBannerItems = campaigns; | 
| 33 | } | 40 | } | 
| 34 | 41 | ||
| 35 | - public void setOnBannerClickListener(OnBannerClickListener listener) { | 42 | + public void setOnBannerCampaignClickListener(OnBannerCampaignClickListener listener) { | 
| 36 | - this.mListener = listener; | 43 | + this.mListenerCampaign = listener; | 
| 44 | + } | ||
| 45 | + | ||
| 46 | + public void setOnBannerContentClickListener(OnBannerContentClickListener listener) { | ||
| 47 | + this.mListenerContent = listener; | ||
| 37 | } | 48 | } | 
| 38 | 49 | ||
| 39 | @NonNull | 50 | @NonNull | 
| ... | @@ -45,27 +56,44 @@ public class BannerAdapter extends RecyclerView.Adapter<BannerAdapter.BannerView | ... | @@ -45,27 +56,44 @@ public class BannerAdapter extends RecyclerView.Adapter<BannerAdapter.BannerView | 
| 45 | 56 | ||
| 46 | @Override | 57 | @Override | 
| 47 | public void onBindViewHolder(@NonNull BannerViewHolder holder, int position) { | 58 | public void onBindViewHolder(@NonNull BannerViewHolder holder, int position) { | 
| 48 | - Campaign campaignItem = mCampaigns.get(position); | 59 | + BannerItem bannerItem = mBannerItems.get(position); | 
| 49 | 60 | ||
| 50 | - Glide.with(mContext) | 61 | + if (bannerItem.isCampaign()) { | 
| 62 | + Glide.with(mContext) | ||
| 51 | // .setDefaultRequestOptions( | 63 | // .setDefaultRequestOptions( | 
| 52 | // RequestOptions | 64 | // RequestOptions | 
| 53 | // .placeholderOf(R.drawable.demo_logo) | 65 | // .placeholderOf(R.drawable.demo_logo) | 
| 54 | // .error(R.drawable.demo_logo)) | 66 | // .error(R.drawable.demo_logo)) | 
| 55 | - .load(campaignItem.getLogoUrl()) | 67 | + .load(bannerItem.getCampaign().getLogoUrl()) | 
| 56 | - .diskCacheStrategy(DiskCacheStrategy.DATA) | 68 | + .diskCacheStrategy(DiskCacheStrategy.DATA) | 
| 57 | - .into(holder.imageView); | 69 | + .into(holder.imageView); | 
| 58 | - | 70 | + | 
| 59 | - holder.itemView.setOnClickListener(v -> { | 71 | + holder.itemView.setOnClickListener(v -> { | 
| 60 | - if (mListener != null) { | 72 | + if (mListenerCampaign != null) { | 
| 61 | - mListener.onBannerClick(campaignItem); | 73 | + mListenerCampaign.onBannerCampaignClick(bannerItem.getCampaign()); | 
| 62 | - } | 74 | + } | 
| 63 | - }); | 75 | + }); | 
| 76 | + } else { | ||
| 77 | + Glide.with(mContext) | ||
| 78 | +// .setDefaultRequestOptions( | ||
| 79 | +// RequestOptions | ||
| 80 | +// .placeholderOf(R.drawable.demo_logo) | ||
| 81 | +// .error(R.drawable.demo_logo)) | ||
| 82 | + .load(bannerItem.getContent().getImgPreview()) | ||
| 83 | + .diskCacheStrategy(DiskCacheStrategy.DATA) | ||
| 84 | + .into(holder.imageView); | ||
| 85 | + | ||
| 86 | + holder.itemView.setOnClickListener(v -> { | ||
| 87 | + if (mListenerContent != null) { | ||
| 88 | + mListenerContent.onBannerContentClick(bannerItem.getContent()); | ||
| 89 | + } | ||
| 90 | + }); | ||
| 91 | + } | ||
| 64 | } | 92 | } | 
| 65 | 93 | ||
| 66 | @Override | 94 | @Override | 
| 67 | public int getItemCount() { | 95 | public int getItemCount() { | 
| 68 | - return mCampaigns.size(); | 96 | + return mBannerItems.size(); | 
| 69 | } | 97 | } | 
| 70 | 98 | ||
| 71 | static class BannerViewHolder extends RecyclerView.ViewHolder { | 99 | static class BannerViewHolder extends RecyclerView.ViewHolder { | ... | ... | 
| 1 | +package ly.warp.sdk.io.models; | ||
| 2 | + | ||
| 3 | +public class BannerItem { | ||
| 4 | + public enum ItemType { | ||
| 5 | + CAMPAIGN, | ||
| 6 | + CONTENT | ||
| 7 | + } | ||
| 8 | + | ||
| 9 | + private ItemType type; | ||
| 10 | + private Campaign campaign; | ||
| 11 | + private Content content; | ||
| 12 | + private int sorting; | ||
| 13 | + | ||
| 14 | + public BannerItem(Campaign campaign) { | ||
| 15 | + this.type = ItemType.CAMPAIGN; | ||
| 16 | + this.campaign = campaign; | ||
| 17 | + this.content = null; | ||
| 18 | + this.sorting = campaign.getSorting(); | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + public BannerItem(Content content) { | ||
| 22 | + this.type = ItemType.CONTENT; | ||
| 23 | + this.content = content; | ||
| 24 | + this.campaign = null; | ||
| 25 | + this.sorting = content.getSorting(); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + public ItemType getType() { | ||
| 29 | + return type; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + public Campaign getCampaign() { | ||
| 33 | + return campaign; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + public Content getContent() { | ||
| 37 | + return content; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + public boolean isCampaign() { | ||
| 41 | + return type == ItemType.CAMPAIGN; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + public boolean isContent() { | ||
| 45 | + return type == ItemType.CONTENT; | ||
| 46 | + } | ||
| 47 | +} | 
| ... | @@ -72,8 +72,6 @@ public class Campaign implements Parcelable, Serializable { | ... | @@ -72,8 +72,6 @@ public class Campaign implements Parcelable, Serializable { | 
| 72 | private static final String ACTIONS = "actions"; | 72 | private static final String ACTIONS = "actions"; | 
| 73 | private static final String BUS_ID = "busId"; | 73 | private static final String BUS_ID = "busId"; | 
| 74 | private static final String CAMPAIGN_TYPE_SETTINGS = "campaign_type_settings"; | 74 | private static final String CAMPAIGN_TYPE_SETTINGS = "campaign_type_settings"; | 
| 75 | - private static final String BANNER_IMAGE = "Banner_img"; | ||
| 76 | - private static final String BANNER_TITLE = "Banner_title"; | ||
| 77 | private static final String CATEGORY_ID = "category_id"; | 75 | private static final String CATEGORY_ID = "category_id"; | 
| 78 | private static final String COUPON_AVAILABILITY = "coupon_availability"; | 76 | private static final String COUPON_AVAILABILITY = "coupon_availability"; | 
| 79 | 77 | ||
| ... | @@ -103,8 +101,6 @@ public class Campaign implements Parcelable, Serializable { | ... | @@ -103,8 +101,6 @@ public class Campaign implements Parcelable, Serializable { | 
| 103 | private String busId; | 101 | private String busId; | 
| 104 | private ArrayList<CampaignAction> actions = new ArrayList<>(); | 102 | private ArrayList<CampaignAction> actions = new ArrayList<>(); | 
| 105 | private String campaignTypeSettings; | 103 | private String campaignTypeSettings; | 
| 106 | - private String bannerImage; | ||
| 107 | - private String bannerTitle; | ||
| 108 | private String categoryId; | 104 | private String categoryId; | 
| 109 | private Integer couponAvailability; | 105 | private Integer couponAvailability; | 
| 110 | private String endDate, startDate; | 106 | private String endDate, startDate; | 
| ... | @@ -148,8 +144,6 @@ public class Campaign implements Parcelable, Serializable { | ... | @@ -148,8 +144,6 @@ public class Campaign implements Parcelable, Serializable { | 
| 148 | this.busId = ""; | 144 | this.busId = ""; | 
| 149 | this.actions = new ArrayList<>(); | 145 | this.actions = new ArrayList<>(); | 
| 150 | this.campaignTypeSettings = ""; | 146 | this.campaignTypeSettings = ""; | 
| 151 | - this.bannerImage = ""; | ||
| 152 | - this.bannerTitle = ""; | ||
| 153 | this.couponAvailability = null; | 147 | this.couponAvailability = null; | 
| 154 | this.categoryId = ""; | 148 | this.categoryId = ""; | 
| 155 | this.endDate = ""; | 149 | this.endDate = ""; | 
| ... | @@ -186,20 +180,6 @@ public class Campaign implements Parcelable, Serializable { | ... | @@ -186,20 +180,6 @@ public class Campaign implements Parcelable, Serializable { | 
| 186 | this.isNew = json.optBoolean(IS_NEW); | 180 | this.isNew = json.optBoolean(IS_NEW); | 
| 187 | this.sorting = json.optInt(SORTING); | 181 | this.sorting = json.optInt(SORTING); | 
| 188 | this.extraFields = json.optString(EXTRA_FIELDS); | 182 | this.extraFields = json.optString(EXTRA_FIELDS); | 
| 189 | - if (!TextUtils.isEmpty(this.extraFields)) { | ||
| 190 | - JSONObject extraFieldsResp = WarpJSONParser.getJSONFromString(this.extraFields); | ||
| 191 | - if (extraFieldsResp != null) { | ||
| 192 | - if (extraFieldsResp.has("Banner_title")) { | ||
| 193 | - this.bannerTitle = extraFieldsResp.optString(BANNER_TITLE, ""); | ||
| 194 | - } | ||
| 195 | - if (extraFieldsResp.has("Banner_img")) { | ||
| 196 | - this.bannerImage = extraFieldsResp.optString(BANNER_IMAGE, ""); | ||
| 197 | - } | ||
| 198 | - } | ||
| 199 | - } else { | ||
| 200 | - this.bannerImage = ""; | ||
| 201 | - this.bannerTitle = ""; | ||
| 202 | - } | ||
| 203 | this.type = json.optString(TYPE); | 183 | this.type = json.optString(TYPE); | 
| 204 | this.expired = json.optBoolean(EXPIRED); | 184 | this.expired = json.optBoolean(EXPIRED); | 
| 205 | this.show = json.optBoolean(SHOW); | 185 | this.show = json.optBoolean(SHOW); | 
| ... | @@ -651,22 +631,6 @@ public class Campaign implements Parcelable, Serializable { | ... | @@ -651,22 +631,6 @@ public class Campaign implements Parcelable, Serializable { | 
| 651 | this.campaignTypeSettings = campaignTypeSettings; | 631 | this.campaignTypeSettings = campaignTypeSettings; | 
| 652 | } | 632 | } | 
| 653 | 633 | ||
| 654 | - public String getBannerImage() { | ||
| 655 | - return this.bannerImage; | ||
| 656 | - } | ||
| 657 | - | ||
| 658 | - public String getBannerTitle() { | ||
| 659 | - return this.bannerTitle; | ||
| 660 | - } | ||
| 661 | - | ||
| 662 | - public void setBannerImage(String bannerImage) { | ||
| 663 | - this.bannerImage = bannerImage; | ||
| 664 | - } | ||
| 665 | - | ||
| 666 | - public void setBannerTitle(String bannerTitle) { | ||
| 667 | - this.bannerTitle = bannerTitle; | ||
| 668 | - } | ||
| 669 | - | ||
| 670 | public String getEndDate() { | 634 | public String getEndDate() { | 
| 671 | return endDate; | 635 | return endDate; | 
| 672 | } | 636 | } | ... | ... | 
| 1 | +/* | ||
| 2 | + * Copyright 2010-2013 Warply Ltd. All rights reserved. | ||
| 3 | + * | ||
| 4 | + * Redistribution and use in source and binary forms, without modification, are | ||
| 5 | + * permitted provided that the following conditions are met: | ||
| 6 | + * | ||
| 7 | + * 1. Redistributions of source code must retain the above copyright notice, | ||
| 8 | + * this list of conditions and the following disclaimer. | ||
| 9 | + * | ||
| 10 | + * 2. Redistributions in binary form must reproduce the above copyright notice, | ||
| 11 | + * this list of conditions and the following disclaimer in the documentation | ||
| 12 | + * and/or other materials provided with the distribution. | ||
| 13 | + * | ||
| 14 | + * THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR | ||
| 15 | + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
| 16 | + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | ||
| 17 | + * EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
| 18 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 19 | + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, | ||
| 20 | + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
| 21 | + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
| 22 | + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | ||
| 23 | + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 24 | + */ | ||
| 25 | + | ||
| 26 | +package ly.warp.sdk.io.models; | ||
| 27 | + | ||
| 28 | +import android.os.Parcel; | ||
| 29 | +import android.os.Parcelable; | ||
| 30 | + | ||
| 31 | +import org.json.JSONArray; | ||
| 32 | +import org.json.JSONException; | ||
| 33 | +import org.json.JSONObject; | ||
| 34 | + | ||
| 35 | +import java.io.Serializable; | ||
| 36 | +import java.util.ArrayList; | ||
| 37 | + | ||
| 38 | +import ly.warp.sdk.utils.WarpUtils; | ||
| 39 | +import ly.warp.sdk.utils.constants.WarpConstants; | ||
| 40 | + | ||
| 41 | +/** | ||
| 42 | + * Created by Panagiotis Triantafyllou on 04-Sept-25. | ||
| 43 | + */ | ||
| 44 | + | ||
| 45 | +public class Content implements Parcelable, Serializable { | ||
| 46 | + | ||
| 47 | + private static final long serialVersionUID = -4754964462459705285L; | ||
| 48 | + | ||
| 49 | + /* Constants used to export the Content in JSON formal and vice versa */ | ||
| 50 | + | ||
| 51 | + private static final String ID = "id"; | ||
| 52 | + private static final String ID_ID = "id_id"; | ||
| 53 | + private static final String CUSTOM_ID = "custom_id"; | ||
| 54 | + private static final String NAME = "name"; | ||
| 55 | + private static final String DESCRIPTION = "description"; | ||
| 56 | + private static final String SHORT_DESCRIPTION = "short_description"; | ||
| 57 | + private static final String COUPON_DESCRIPTION = "coupon_description"; | ||
| 58 | + private static final String ACTIVE = "active"; | ||
| 59 | + private static final String CREATED = "created"; | ||
| 60 | + private static final String CATEGORY_ID = "category_id"; | ||
| 61 | + private static final String CATEGORY_NAME = "category_name"; | ||
| 62 | + private static final String CATEGORY_UUID = "category_uuid"; | ||
| 63 | + private static final String MERCHANT_UUID = "merchant_uuid"; | ||
| 64 | + private static final String TAGS = "tags"; | ||
| 65 | + private static final String START_DATE = "start_date"; | ||
| 66 | + private static final String END_DATE = "end_date"; | ||
| 67 | + private static final String IMG_PREVIEW = "img_preview"; | ||
| 68 | + private static final String IMG = "img"; | ||
| 69 | + private static final String FAVOURITE = "favourite"; | ||
| 70 | + private static final String EXTRA_FIELDS = "extra_fields"; | ||
| 71 | + private static final String PARTICIPATED = "participated"; | ||
| 72 | + private static final String PARTICIPATED_FIELDS = "participated_fields"; | ||
| 73 | + private static final String PARENT = "parent"; | ||
| 74 | + private static final String SORTING = "sorting"; | ||
| 75 | + private static final String CONSUMER_FULL_NAME = "consumer_full_name"; | ||
| 76 | + private static final String CONSUMER_PHOTO = "consumer_photo"; | ||
| 77 | + | ||
| 78 | + /* Member variables of the Content object */ | ||
| 79 | + | ||
| 80 | + private String id = ""; | ||
| 81 | + private int idid = 0; | ||
| 82 | + private String customId = ""; | ||
| 83 | + private String name = ""; | ||
| 84 | + private String description = ""; | ||
| 85 | + private String shortDescription = ""; | ||
| 86 | + private String couponDescription = ""; | ||
| 87 | + private boolean active = false; | ||
| 88 | + private String created = ""; | ||
| 89 | + private int categoryId = 0; | ||
| 90 | + private String categoryName = ""; | ||
| 91 | + private String categoryUuid = ""; | ||
| 92 | + private String merchantUuid = ""; | ||
| 93 | + private ArrayList<Tags> tags = new ArrayList<Tags>(); | ||
| 94 | + private String startDate = ""; | ||
| 95 | + private String endDate = ""; | ||
| 96 | + private String imgPreview = ""; | ||
| 97 | + private ArrayList<String> img = new ArrayList<String>(); | ||
| 98 | + private boolean favourite = false; | ||
| 99 | + private JSONObject extraFields = new JSONObject(); | ||
| 100 | + private String participated = ""; | ||
| 101 | + private JSONObject participatedFields = new JSONObject(); | ||
| 102 | + private String parent = ""; | ||
| 103 | + private int sorting = 0; | ||
| 104 | + private String consumerFullName = ""; | ||
| 105 | + private String consumerPhoto = ""; | ||
| 106 | + | ||
| 107 | + | ||
| 108 | + public Content() { | ||
| 109 | + this.id = ""; | ||
| 110 | + this.idid = 0; | ||
| 111 | + this.customId = ""; | ||
| 112 | + this.name = ""; | ||
| 113 | + this.description = ""; | ||
| 114 | + this.shortDescription = ""; | ||
| 115 | + this.couponDescription = ""; | ||
| 116 | + this.active = false; | ||
| 117 | + this.created = ""; | ||
| 118 | + this.categoryId = 0; | ||
| 119 | + this.categoryName = ""; | ||
| 120 | + this.categoryUuid = ""; | ||
| 121 | + this.merchantUuid = ""; | ||
| 122 | + this.tags = new ArrayList<Tags>(); | ||
| 123 | + this.startDate = ""; | ||
| 124 | + this.endDate = ""; | ||
| 125 | + this.imgPreview = ""; | ||
| 126 | + this.img = new ArrayList<String>(); | ||
| 127 | + this.favourite = false; | ||
| 128 | + this.extraFields = new JSONObject(); | ||
| 129 | + this.participated = ""; | ||
| 130 | + this.participatedFields = new JSONObject(); | ||
| 131 | + this.parent = ""; | ||
| 132 | + this.sorting = 0; | ||
| 133 | + this.consumerFullName = ""; | ||
| 134 | + this.consumerPhoto = ""; | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + /** | ||
| 138 | + * Basic constructor used to create an object from a String, representing a | ||
| 139 | + * JSON Object | ||
| 140 | + * | ||
| 141 | + * @param json The String, representing the JSON Object | ||
| 142 | + * @throws JSONException Thrown if the String cannot be converted to JSON | ||
| 143 | + */ | ||
| 144 | + public Content(String json) throws JSONException { | ||
| 145 | + this(new JSONObject(json)); | ||
| 146 | + } | ||
| 147 | + | ||
| 148 | + public class Tags { | ||
| 149 | + private static final String NAME = "name"; | ||
| 150 | + private static final String ID = "id"; | ||
| 151 | + | ||
| 152 | + | ||
| 153 | + private String name = ""; | ||
| 154 | + private String id = ""; | ||
| 155 | + | ||
| 156 | + public Tags() { | ||
| 157 | + this.name = ""; | ||
| 158 | + this.id = ""; | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + public Tags(JSONObject json) { | ||
| 162 | + if (json != null) { | ||
| 163 | + this.name = json.isNull(NAME) ? "" : json.optString(NAME); | ||
| 164 | + this.id = json.isNull(ID) ? "" : json.optString(ID); | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + public String getName() { | ||
| 169 | + return name; | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + public void setName(String name) { | ||
| 173 | + this.name = name; | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + public String getId() { | ||
| 177 | + return id; | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + public void setId(String id) { | ||
| 181 | + this.id = id; | ||
| 182 | + } | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + /** | ||
| 186 | + * Constructor used to create an Object from a given JSON Object | ||
| 187 | + * | ||
| 188 | + * @param json JSON Object used to create the Content | ||
| 189 | + */ | ||
| 190 | + public Content(JSONObject json) { | ||
| 191 | + if (json != null) { | ||
| 192 | + this.id = json.optString(ID); | ||
| 193 | + this.idid = json.optInt(ID_ID); | ||
| 194 | + this.customId = json.isNull(CUSTOM_ID) ? "" : json.optString(CUSTOM_ID); | ||
| 195 | + this.name = json.optString(NAME); | ||
| 196 | + this.description = json.optString(DESCRIPTION); | ||
| 197 | + this.shortDescription = json.optString(SHORT_DESCRIPTION); | ||
| 198 | + this.couponDescription = json.optString(COUPON_DESCRIPTION); | ||
| 199 | + this.active = json.optBoolean(ACTIVE); | ||
| 200 | + this.created = json.optString(CREATED); | ||
| 201 | + this.categoryId = json.optInt(CATEGORY_ID); | ||
| 202 | + this.categoryName = json.optString(CATEGORY_NAME); | ||
| 203 | + this.categoryUuid = json.optString(CATEGORY_UUID); | ||
| 204 | + this.merchantUuid = json.isNull(MERCHANT_UUID) ? "" : json.optString(MERCHANT_UUID); | ||
| 205 | + JSONArray tempTags = json.optJSONArray(TAGS); | ||
| 206 | + if (tempTags != null) { | ||
| 207 | + for (int i = 0; i < tempTags.length(); i++) { | ||
| 208 | + this.tags.add(new Tags(tempTags.optJSONObject(i))); | ||
| 209 | + } | ||
| 210 | + } else { | ||
| 211 | + this.tags = new ArrayList<Tags>(); | ||
| 212 | + } | ||
| 213 | + this.startDate = json.isNull(START_DATE) ? "" : json.optString(START_DATE); | ||
| 214 | + this.endDate = json.isNull(END_DATE) ? "" : json.optString(END_DATE); | ||
| 215 | + this.imgPreview = json.optString(IMG_PREVIEW); | ||
| 216 | + try { | ||
| 217 | + JSONArray tempImg = new JSONArray(json.optString(IMG)); | ||
| 218 | + if (tempImg != null) { | ||
| 219 | + for (int i = 0; i < tempImg.length(); i++) { | ||
| 220 | + this.img.add(tempImg.optString(i)); | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + } catch (JSONException e) { | ||
| 224 | + this.img = new ArrayList<String>(); | ||
| 225 | + } | ||
| 226 | + this.favourite = json.optBoolean(FAVOURITE); | ||
| 227 | + this.extraFields = json.optJSONObject(EXTRA_FIELDS); | ||
| 228 | + this.participated = json.isNull(PARTICIPATED) ? "" : json.optString(PARTICIPATED); | ||
| 229 | + this.participatedFields = json.optJSONObject(PARTICIPATED_FIELDS); | ||
| 230 | + this.parent = json.isNull(PARENT) ? "" : json.optString(PARENT); | ||
| 231 | + this.sorting = json.optInt(SORTING); | ||
| 232 | + this.consumerFullName = json.isNull(CONSUMER_FULL_NAME) ? "" : json.optString(CONSUMER_FULL_NAME); | ||
| 233 | + this.consumerPhoto = json.isNull(CONSUMER_PHOTO) ? "" : json.optString(CONSUMER_PHOTO); | ||
| 234 | + } | ||
| 235 | + } | ||
| 236 | + | ||
| 237 | + public Content(Parcel source) { | ||
| 238 | + this.id = source.readString(); | ||
| 239 | + this.idid = source.readInt(); | ||
| 240 | + this.customId = source.readString(); | ||
| 241 | + this.name = source.readString(); | ||
| 242 | + this.description = source.readString(); | ||
| 243 | + this.shortDescription = source.readString(); | ||
| 244 | + this.couponDescription = source.readString(); | ||
| 245 | + this.active = source.readByte() != 0; | ||
| 246 | + this.created = source.readString(); | ||
| 247 | + this.categoryId = source.readInt(); | ||
| 248 | + this.categoryName = source.readString(); | ||
| 249 | + this.categoryUuid = source.readString(); | ||
| 250 | + this.merchantUuid = source.readString(); | ||
| 251 | + this.tags = source.readArrayList(null); | ||
| 252 | + this.startDate = source.readString(); | ||
| 253 | + this.endDate = source.readString(); | ||
| 254 | + this.imgPreview = source.readString(); | ||
| 255 | + this.img = source.createStringArrayList(); | ||
| 256 | + this.favourite = source.readByte() != 0; | ||
| 257 | + this.extraFields = (JSONObject) source.readSerializable(); | ||
| 258 | + this.participated = source.readString(); | ||
| 259 | + this.participatedFields = (JSONObject) source.readSerializable(); | ||
| 260 | + this.parent = source.readString(); | ||
| 261 | + this.sorting = source.readInt(); | ||
| 262 | + this.consumerFullName = source.readString(); | ||
| 263 | + this.consumerPhoto = source.readString(); | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + @Override | ||
| 267 | + public void writeToParcel(Parcel dest, int flags) { | ||
| 268 | + dest.writeString(this.id); | ||
| 269 | + dest.writeInt(this.idid); | ||
| 270 | + dest.writeString(this.customId); | ||
| 271 | + dest.writeString(this.name); | ||
| 272 | + dest.writeString(this.description); | ||
| 273 | + dest.writeString(this.shortDescription); | ||
| 274 | + dest.writeString(this.couponDescription); | ||
| 275 | + dest.writeByte(this.active ? (byte) 1 : (byte) 0); | ||
| 276 | + dest.writeString(this.created); | ||
| 277 | + dest.writeInt(this.categoryId); | ||
| 278 | + dest.writeString(this.categoryName); | ||
| 279 | + dest.writeString(this.categoryUuid); | ||
| 280 | + dest.writeString(this.merchantUuid); | ||
| 281 | + dest.writeList(this.tags); | ||
| 282 | + dest.writeString(this.startDate); | ||
| 283 | + dest.writeString(this.endDate); | ||
| 284 | + dest.writeString(this.imgPreview); | ||
| 285 | + dest.writeStringList(this.img); | ||
| 286 | + dest.writeByte(this.favourite ? (byte) 1 : (byte) 0); | ||
| 287 | + dest.writeSerializable((Serializable) this.extraFields); | ||
| 288 | + dest.writeString(this.participated); | ||
| 289 | + dest.writeSerializable((Serializable) this.participatedFields); | ||
| 290 | + dest.writeString(this.parent); | ||
| 291 | + dest.writeInt(this.sorting); | ||
| 292 | + dest.writeString(this.consumerFullName); | ||
| 293 | + dest.writeString(this.consumerPhoto); | ||
| 294 | + } | ||
| 295 | + | ||
| 296 | + /** | ||
| 297 | + * Converts the Content into a JSON Object | ||
| 298 | + * | ||
| 299 | + * @return The JSON Object created from this Content | ||
| 300 | + */ | ||
| 301 | + public JSONObject toJSONObject() { | ||
| 302 | + JSONObject jObj = new JSONObject(); | ||
| 303 | + try { | ||
| 304 | + jObj.putOpt(ID, this.id); | ||
| 305 | + jObj.putOpt(ID_ID, this.idid); | ||
| 306 | + } catch (JSONException e) { | ||
| 307 | + if (WarpConstants.DEBUG) { | ||
| 308 | + e.printStackTrace(); | ||
| 309 | + } | ||
| 310 | + } | ||
| 311 | + return jObj; | ||
| 312 | + } | ||
| 313 | + | ||
| 314 | + /** | ||
| 315 | + * String representation of the Content, as a JSON object | ||
| 316 | + * | ||
| 317 | + * @return A String representation of JSON object | ||
| 318 | + */ | ||
| 319 | + public String toString() { | ||
| 320 | + if (toJSONObject() != null) | ||
| 321 | + return toJSONObject().toString(); | ||
| 322 | + return null; | ||
| 323 | + } | ||
| 324 | + | ||
| 325 | + /** | ||
| 326 | + * String representation of the Content, as a human readable JSON object | ||
| 327 | + * | ||
| 328 | + * @return A human readable String representation of JSON object | ||
| 329 | + */ | ||
| 330 | + public String toHumanReadableString() { | ||
| 331 | + String humanReadableString = null; | ||
| 332 | + try { | ||
| 333 | + humanReadableString = toJSONObject().toString(2); | ||
| 334 | + } catch (JSONException e) { | ||
| 335 | + WarpUtils.warn("Failed converting Content JSON object to String", e); | ||
| 336 | + } | ||
| 337 | + return humanReadableString; | ||
| 338 | + } | ||
| 339 | + | ||
| 340 | + // ================================================================================ | ||
| 341 | + // Getters | ||
| 342 | + // ================================================================================ | ||
| 343 | + | ||
| 344 | + | ||
| 345 | + public String getId() { | ||
| 346 | + return id; | ||
| 347 | + } | ||
| 348 | + | ||
| 349 | + public void setId(String id) { | ||
| 350 | + this.id = id; | ||
| 351 | + } | ||
| 352 | + | ||
| 353 | + public int getIdid() { | ||
| 354 | + return idid; | ||
| 355 | + } | ||
| 356 | + | ||
| 357 | + public void setIdid(int idid) { | ||
| 358 | + this.idid = idid; | ||
| 359 | + } | ||
| 360 | + | ||
| 361 | + public String getCustomId() { | ||
| 362 | + return customId; | ||
| 363 | + } | ||
| 364 | + | ||
| 365 | + public void setCustomId(String customId) { | ||
| 366 | + this.customId = customId; | ||
| 367 | + } | ||
| 368 | + | ||
| 369 | + public String getName() { | ||
| 370 | + return name; | ||
| 371 | + } | ||
| 372 | + | ||
| 373 | + public void setName(String name) { | ||
| 374 | + this.name = name; | ||
| 375 | + } | ||
| 376 | + | ||
| 377 | + public String getDescription() { | ||
| 378 | + return description; | ||
| 379 | + } | ||
| 380 | + | ||
| 381 | + public void setDescription(String description) { | ||
| 382 | + this.description = description; | ||
| 383 | + } | ||
| 384 | + | ||
| 385 | + public String getShortDescription() { | ||
| 386 | + return shortDescription; | ||
| 387 | + } | ||
| 388 | + | ||
| 389 | + public void setShortDescription(String shortDescription) { | ||
| 390 | + this.shortDescription = shortDescription; | ||
| 391 | + } | ||
| 392 | + | ||
| 393 | + public String getCouponDescription() { | ||
| 394 | + return couponDescription; | ||
| 395 | + } | ||
| 396 | + | ||
| 397 | + public void setCouponDescription(String couponDescription) { | ||
| 398 | + this.couponDescription = couponDescription; | ||
| 399 | + } | ||
| 400 | + | ||
| 401 | + public boolean isActive() { | ||
| 402 | + return active; | ||
| 403 | + } | ||
| 404 | + | ||
| 405 | + public void setActive(boolean active) { | ||
| 406 | + this.active = active; | ||
| 407 | + } | ||
| 408 | + | ||
| 409 | + public String getCreated() { | ||
| 410 | + return created; | ||
| 411 | + } | ||
| 412 | + | ||
| 413 | + public void setCreated(String created) { | ||
| 414 | + this.created = created; | ||
| 415 | + } | ||
| 416 | + | ||
| 417 | + public int getCategoryId() { | ||
| 418 | + return categoryId; | ||
| 419 | + } | ||
| 420 | + | ||
| 421 | + public void setCategoryId(int categoryId) { | ||
| 422 | + this.categoryId = categoryId; | ||
| 423 | + } | ||
| 424 | + | ||
| 425 | + public String getCategoryName() { | ||
| 426 | + return categoryName; | ||
| 427 | + } | ||
| 428 | + | ||
| 429 | + public void setCategoryName(String categoryName) { | ||
| 430 | + this.categoryName = categoryName; | ||
| 431 | + } | ||
| 432 | + | ||
| 433 | + public String getCategoryUuid() { | ||
| 434 | + return categoryUuid; | ||
| 435 | + } | ||
| 436 | + | ||
| 437 | + public void setCategoryUuid(String categoryUuid) { | ||
| 438 | + this.categoryUuid = categoryUuid; | ||
| 439 | + } | ||
| 440 | + | ||
| 441 | + public String getMerchantUuid() { | ||
| 442 | + return merchantUuid; | ||
| 443 | + } | ||
| 444 | + | ||
| 445 | + public void setMerchantUuid(String merchantUuid) { | ||
| 446 | + this.merchantUuid = merchantUuid; | ||
| 447 | + } | ||
| 448 | + | ||
| 449 | + public ArrayList<Tags> getTags() { | ||
| 450 | + return tags; | ||
| 451 | + } | ||
| 452 | + | ||
| 453 | + public void setTags(ArrayList<Tags> tags) { | ||
| 454 | + this.tags = tags; | ||
| 455 | + } | ||
| 456 | + | ||
| 457 | + public String getStartDate() { | ||
| 458 | + return startDate; | ||
| 459 | + } | ||
| 460 | + | ||
| 461 | + public void setStartDate(String startDate) { | ||
| 462 | + this.startDate = startDate; | ||
| 463 | + } | ||
| 464 | + | ||
| 465 | + public String getEndDate() { | ||
| 466 | + return endDate; | ||
| 467 | + } | ||
| 468 | + | ||
| 469 | + public void setEndDate(String endDate) { | ||
| 470 | + this.endDate = endDate; | ||
| 471 | + } | ||
| 472 | + | ||
| 473 | + public String getImgPreview() { | ||
| 474 | + return imgPreview; | ||
| 475 | + } | ||
| 476 | + | ||
| 477 | + public void setImgPreview(String imgPreview) { | ||
| 478 | + this.imgPreview = imgPreview; | ||
| 479 | + } | ||
| 480 | + | ||
| 481 | + public ArrayList<String> getImg() { | ||
| 482 | + return img; | ||
| 483 | + } | ||
| 484 | + | ||
| 485 | + public void setImg(ArrayList<String> img) { | ||
| 486 | + this.img = img; | ||
| 487 | + } | ||
| 488 | + | ||
| 489 | + public boolean isFavourite() { | ||
| 490 | + return favourite; | ||
| 491 | + } | ||
| 492 | + | ||
| 493 | + public void setFavourite(boolean favourite) { | ||
| 494 | + this.favourite = favourite; | ||
| 495 | + } | ||
| 496 | + | ||
| 497 | + public JSONObject getExtraFields() { | ||
| 498 | + return extraFields; | ||
| 499 | + } | ||
| 500 | + | ||
| 501 | + public void setExtraFields(JSONObject extraFields) { | ||
| 502 | + this.extraFields = extraFields; | ||
| 503 | + } | ||
| 504 | + | ||
| 505 | + public String getParticipated() { | ||
| 506 | + return participated; | ||
| 507 | + } | ||
| 508 | + | ||
| 509 | + public void setParticipated(String participated) { | ||
| 510 | + this.participated = participated; | ||
| 511 | + } | ||
| 512 | + | ||
| 513 | + public JSONObject getParticipatedFields() { | ||
| 514 | + return participatedFields; | ||
| 515 | + } | ||
| 516 | + | ||
| 517 | + public void setParticipatedFields(JSONObject participatedFields) { | ||
| 518 | + this.participatedFields = participatedFields; | ||
| 519 | + } | ||
| 520 | + | ||
| 521 | + public String getParent() { | ||
| 522 | + return parent; | ||
| 523 | + } | ||
| 524 | + | ||
| 525 | + public void setParent(String parent) { | ||
| 526 | + this.parent = parent; | ||
| 527 | + } | ||
| 528 | + | ||
| 529 | + public int getSorting() { | ||
| 530 | + return sorting; | ||
| 531 | + } | ||
| 532 | + | ||
| 533 | + public void setSorting(int sorting) { | ||
| 534 | + this.sorting = sorting; | ||
| 535 | + } | ||
| 536 | + | ||
| 537 | + public String getConsumerFullName() { | ||
| 538 | + return consumerFullName; | ||
| 539 | + } | ||
| 540 | + | ||
| 541 | + public void setConsumerFullName(String consumerFullName) { | ||
| 542 | + this.consumerFullName = consumerFullName; | ||
| 543 | + } | ||
| 544 | + | ||
| 545 | + public String getConsumerPhoto() { | ||
| 546 | + return consumerPhoto; | ||
| 547 | + } | ||
| 548 | + | ||
| 549 | + public void setConsumerPhoto(String consumerPhoto) { | ||
| 550 | + this.consumerPhoto = consumerPhoto; | ||
| 551 | + } | ||
| 552 | + | ||
| 553 | + @Override | ||
| 554 | + public int describeContents() { | ||
| 555 | + return 0; | ||
| 556 | + } | ||
| 557 | + | ||
| 558 | + public static final Creator<Content> CREATOR = new Creator<Content>() { | ||
| 559 | + public Content createFromParcel(Parcel source) { | ||
| 560 | + return new Content(source); | ||
| 561 | + } | ||
| 562 | + | ||
| 563 | + public Content[] newArray(int size) { | ||
| 564 | + return new Content[size]; | ||
| 565 | + } | ||
| 566 | + }; | ||
| 567 | +} | 
| ... | @@ -33,12 +33,12 @@ public interface ApiService { | ... | @@ -33,12 +33,12 @@ public interface ApiService { | 
| 33 | @Headers("Content-Type: application/json") | 33 | @Headers("Content-Type: application/json") | 
| 34 | @POST("/partners/dei/app_login") | 34 | @POST("/partners/dei/app_login") | 
| 35 | Call<ResponseBody> dehUser(@Body RequestBody request, | 35 | Call<ResponseBody> dehUser(@Body RequestBody request, | 
| 36 | - @Header(WarpConstants.HEADER_DATE) String timeStamp, | 36 | + @Header(WarpConstants.HEADER_DATE) String timeStamp, | 
| 37 | - @Header(WarpConstants.HEADER_LOYALTY_BUNDLE_ID) String bundleId, | 37 | + @Header(WarpConstants.HEADER_LOYALTY_BUNDLE_ID) String bundleId, | 
| 38 | - @Header(WarpConstants.HEADER_UNIQUE_DEVICE_ID) String deviceId, | 38 | + @Header(WarpConstants.HEADER_UNIQUE_DEVICE_ID) String deviceId, | 
| 39 | - @Header(WarpConstants.HEADER_CHANNEL) String channel, | 39 | + @Header(WarpConstants.HEADER_CHANNEL) String channel, | 
| 40 | - @Header(WarpConstants.HEADER_WEB_ID) String webId, | 40 | + @Header(WarpConstants.HEADER_WEB_ID) String webId, | 
| 41 | - @Header(WarpConstants.HEADER_SIGNATURE) String signature); | 41 | + @Header(WarpConstants.HEADER_SIGNATURE) String signature); | 
| 42 | 42 | ||
| 43 | @Headers("Content-Type: application/json") | 43 | @Headers("Content-Type: application/json") | 
| 44 | @POST("/partners/cosmote/verify") | 44 | @POST("/partners/cosmote/verify") | 
| ... | @@ -97,14 +97,14 @@ public interface ApiService { | ... | @@ -97,14 +97,14 @@ public interface ApiService { | 
| 97 | 97 | ||
| 98 | @Headers("Content-Type: application/json") | 98 | @Headers("Content-Type: application/json") | 
| 99 | @POST("/api/mobile/v2/{appUuid}/context/") | 99 | @POST("/api/mobile/v2/{appUuid}/context/") | 
| 100 | - Call<ResponseBody> getCampaignsAvailability(@Path("appUuid") String appUuid, | 100 | + Call<ResponseBody> getArticles(@Path("appUuid") String appUuid, | 
| 101 | - @Body RequestBody request, | 101 | + @Body RequestBody request, | 
| 102 | - @Header(WarpConstants.HEADER_DATE) String timeStamp, | 102 | + @Header(WarpConstants.HEADER_DATE) String timeStamp, | 
| 103 | - @Header(WarpConstants.HEADER_LOYALTY_BUNDLE_ID) String bundleId, | 103 | + @Header(WarpConstants.HEADER_LOYALTY_BUNDLE_ID) String bundleId, | 
| 104 | - @Header(WarpConstants.HEADER_UNIQUE_DEVICE_ID) String deviceId, | 104 | + @Header(WarpConstants.HEADER_UNIQUE_DEVICE_ID) String deviceId, | 
| 105 | - @Header(WarpConstants.HEADER_CHANNEL) String channel, | 105 | + @Header(WarpConstants.HEADER_CHANNEL) String channel, | 
| 106 | - @Header(WarpConstants.HEADER_WEB_ID) String webId, | 106 | + @Header(WarpConstants.HEADER_WEB_ID) String webId, | 
| 107 | - @Header(WarpConstants.HEADER_SIGNATURE) String signature); | 107 | + @Header(WarpConstants.HEADER_SIGNATURE) String signature); | 
| 108 | 108 | ||
| 109 | @Headers("Content-Type: application/json") | 109 | @Headers("Content-Type: application/json") | 
| 110 | @POST("/oauth/{appUuid}/context") | 110 | @POST("/oauth/{appUuid}/context") | 
| ... | @@ -118,18 +118,6 @@ public interface ApiService { | ... | @@ -118,18 +118,6 @@ public interface ApiService { | 
| 118 | @Header(WarpConstants.HEADER_SIGNATURE) String signature, | 118 | @Header(WarpConstants.HEADER_SIGNATURE) String signature, | 
| 119 | @Header(WarpConstants.HEADER_AUTHORIZATION) String bearer); | 119 | @Header(WarpConstants.HEADER_AUTHORIZATION) String bearer); | 
| 120 | 120 | ||
| 121 | - @Headers("Content-Type: application/json") | ||
| 122 | - @POST("/oauth/{appUuid}/context") | ||
| 123 | - Call<ResponseBody> getMarketPassDetails(@Path("appUuid") String appUuid, | ||
| 124 | - @Body RequestBody request, | ||
| 125 | - @Header(WarpConstants.HEADER_DATE) String timeStamp, | ||
| 126 | - @Header(WarpConstants.HEADER_LOYALTY_BUNDLE_ID) String bundleId, | ||
| 127 | - @Header(WarpConstants.HEADER_UNIQUE_DEVICE_ID) String deviceId, | ||
| 128 | - @Header(WarpConstants.HEADER_CHANNEL) String channel, | ||
| 129 | - @Header(WarpConstants.HEADER_WEB_ID) String webId, | ||
| 130 | - @Header(WarpConstants.HEADER_SIGNATURE) String signature, | ||
| 131 | - @Header(WarpConstants.HEADER_AUTHORIZATION) String bearer); | ||
| 132 | - | ||
| 133 | // =========================================================== | 121 | // =========================================================== | 
| 134 | // Getter & Setter | 122 | // Getter & Setter | 
| 135 | // =========================================================== | 123 | // =========================================================== | ... | ... | 
| ... | @@ -32,6 +32,7 @@ import java.util.ArrayList; | ... | @@ -32,6 +32,7 @@ import java.util.ArrayList; | 
| 32 | 32 | ||
| 33 | import ly.warp.sdk.Warply; | 33 | import ly.warp.sdk.Warply; | 
| 34 | import ly.warp.sdk.db.WarplyDBHelper; | 34 | import ly.warp.sdk.db.WarplyDBHelper; | 
| 35 | +import ly.warp.sdk.io.models.BannerItem; | ||
| 35 | import ly.warp.sdk.io.models.Campaign; | 36 | import ly.warp.sdk.io.models.Campaign; | 
| 36 | import ly.warp.sdk.io.models.CouponList; | 37 | import ly.warp.sdk.io.models.CouponList; | 
| 37 | import ly.warp.sdk.utils.managers.WarplyManager; | 38 | import ly.warp.sdk.utils.managers.WarplyManager; | 
| ... | @@ -52,6 +53,7 @@ public class WarplyManagerHelper { | ... | @@ -52,6 +53,7 @@ public class WarplyManagerHelper { | 
| 52 | 53 | ||
| 53 | private static CouponList mCouponRedeemedList = new CouponList(); | 54 | private static CouponList mCouponRedeemedList = new CouponList(); | 
| 54 | private static ArrayList<Campaign> mCampaignListAll = new ArrayList<Campaign>(); | 55 | private static ArrayList<Campaign> mCampaignListAll = new ArrayList<Campaign>(); | 
| 56 | + private static ArrayList<BannerItem> mBannerListAll = new ArrayList<BannerItem>(); | ||
| 55 | 57 | ||
| 56 | // =========================================================== | 58 | // =========================================================== | 
| 57 | // Methods for/from SuperClass/Interfaces | 59 | // Methods for/from SuperClass/Interfaces | 
| ... | @@ -70,6 +72,15 @@ public class WarplyManagerHelper { | ... | @@ -70,6 +72,15 @@ public class WarplyManagerHelper { | 
| 70 | return mCampaignListAll; | 72 | return mCampaignListAll; | 
| 71 | } | 73 | } | 
| 72 | 74 | ||
| 75 | + public static void setBannerList(ArrayList<BannerItem> bannerList) { | ||
| 76 | + mBannerListAll.clear(); | ||
| 77 | + mBannerListAll.addAll(bannerList); | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public static ArrayList<BannerItem> getBannerList() { | ||
| 81 | + return mBannerListAll; | ||
| 82 | + } | ||
| 83 | + | ||
| 73 | public static void setCouponRedeemedList(CouponList couponRedeemedList) { | 84 | public static void setCouponRedeemedList(CouponList couponRedeemedList) { | 
| 74 | mCouponRedeemedList.clear(); | 85 | mCouponRedeemedList.clear(); | 
| 75 | mCouponRedeemedList.addAll(couponRedeemedList); | 86 | mCouponRedeemedList.addAll(couponRedeemedList); | ... | ... | 
| ... | @@ -27,7 +27,6 @@ package ly.warp.sdk.utils.managers; | ... | @@ -27,7 +27,6 @@ package ly.warp.sdk.utils.managers; | 
| 27 | 27 | ||
| 28 | import android.os.Handler; | 28 | import android.os.Handler; | 
| 29 | import android.os.Looper; | 29 | import android.os.Looper; | 
| 30 | -import android.text.TextUtils; | ||
| 31 | import android.text.format.DateFormat; | 30 | import android.text.format.DateFormat; | 
| 32 | import android.util.ArrayMap; | 31 | import android.util.ArrayMap; | 
| 33 | 32 | ||
| ... | @@ -56,7 +55,9 @@ import java.util.concurrent.Executors; | ... | @@ -56,7 +55,9 @@ import java.util.concurrent.Executors; | 
| 56 | import ly.warp.sdk.Warply; | 55 | import ly.warp.sdk.Warply; | 
| 57 | import ly.warp.sdk.db.WarplyDBHelper; | 56 | import ly.warp.sdk.db.WarplyDBHelper; | 
| 58 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 57 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 
| 58 | +import ly.warp.sdk.io.models.BannerItem; | ||
| 59 | import ly.warp.sdk.io.models.Campaign; | 59 | import ly.warp.sdk.io.models.Campaign; | 
| 60 | +import ly.warp.sdk.io.models.Content; | ||
| 60 | import ly.warp.sdk.io.models.Coupon; | 61 | import ly.warp.sdk.io.models.Coupon; | 
| 61 | import ly.warp.sdk.io.models.CouponList; | 62 | import ly.warp.sdk.io.models.CouponList; | 
| 62 | import ly.warp.sdk.io.models.NewCampaign; | 63 | import ly.warp.sdk.io.models.NewCampaign; | 
| ... | @@ -64,7 +65,6 @@ import ly.warp.sdk.io.models.RedeemedSMHistoryModel; | ... | @@ -64,7 +65,6 @@ import ly.warp.sdk.io.models.RedeemedSMHistoryModel; | 
| 64 | import ly.warp.sdk.io.request.WarplyRefreshTokenRequest; | 65 | import ly.warp.sdk.io.request.WarplyRefreshTokenRequest; | 
| 65 | import ly.warp.sdk.io.volley.ApiClient; | 66 | import ly.warp.sdk.io.volley.ApiClient; | 
| 66 | import ly.warp.sdk.io.volley.ApiService; | 67 | import ly.warp.sdk.io.volley.ApiService; | 
| 67 | -import ly.warp.sdk.utils.WarpJSONParser; | ||
| 68 | import ly.warp.sdk.utils.WarpUtils; | 68 | import ly.warp.sdk.utils.WarpUtils; | 
| 69 | import ly.warp.sdk.utils.WarplyDeviceInfoCollector; | 69 | import ly.warp.sdk.utils.WarplyDeviceInfoCollector; | 
| 70 | import ly.warp.sdk.utils.WarplyManagerHelper; | 70 | import ly.warp.sdk.utils.WarplyManagerHelper; | 
| ... | @@ -353,25 +353,6 @@ public class WarplyManager { | ... | @@ -353,25 +353,6 @@ public class WarplyManager { | 
| 353 | }); | 353 | }); | 
| 354 | } | 354 | } | 
| 355 | 355 | ||
| 356 | - private static ArrayList<Campaign> mergeCampaignResults(ArrayList<Campaign> resultCampaigns, ArrayList<Campaign> resultPersonalizedCampaigns) { | ||
| 357 | - ArrayList<Campaign> newCampaignList = new ArrayList<Campaign>(); | ||
| 358 | - ArrayList<Campaign> campaignLoyaltyList = new ArrayList<>(); | ||
| 359 | - if (resultCampaigns != null && !resultCampaigns.isEmpty()) | ||
| 360 | - newCampaignList.addAll(resultCampaigns); | ||
| 361 | - if (resultPersonalizedCampaigns != null && !resultPersonalizedCampaigns.isEmpty()) | ||
| 362 | - newCampaignList.addAll(resultPersonalizedCampaigns); | ||
| 363 | - | ||
| 364 | - if (newCampaignList != null && !newCampaignList.isEmpty()) { | ||
| 365 | - newCampaignList.sort((obj1, obj2) -> Integer.compare(obj1.getSorting(), obj2.getSorting())); | ||
| 366 | - | ||
| 367 | - Set<Campaign> set = new LinkedHashSet<>(newCampaignList); | ||
| 368 | - campaignLoyaltyList.addAll(set); | ||
| 369 | - WarplyManagerHelper.setCampaignList(campaignLoyaltyList); | ||
| 370 | - } | ||
| 371 | - | ||
| 372 | - return campaignLoyaltyList; | ||
| 373 | - } | ||
| 374 | - | ||
| 375 | public static void getUserCouponsWithCouponsets(final CallbackReceiver<CouponList> receiver) { | 356 | public static void getUserCouponsWithCouponsets(final CallbackReceiver<CouponList> receiver) { | 
| 376 | WarpUtils.log("************* WARPLY User Coupons Request ********************"); | 357 | WarpUtils.log("************* WARPLY User Coupons Request ********************"); | 
| 377 | WarpUtils.log("[WARP Trace] WARPLY User Coupons Request is active"); | 358 | WarpUtils.log("[WARP Trace] WARPLY User Coupons Request is active"); | 
| ... | @@ -404,7 +385,43 @@ public class WarplyManager { | ... | @@ -404,7 +385,43 @@ public class WarplyManager { | 
| 404 | }, executorService); | 385 | }, executorService); | 
| 405 | } | 386 | } | 
| 406 | 387 | ||
| 407 | - public static void getCampaigns(final CallbackReceiver<ArrayList<Campaign>> receiver) { | 388 | + private static ArrayList<BannerItem> mergeCampaignResults(ArrayList<Campaign> resultCampaigns, ArrayList<Campaign> resultPersonalizedCampaigns, ArrayList<Content> resultArticles) { | 
| 389 | + ArrayList<BannerItem> allItems = new ArrayList<>(); | ||
| 390 | + | ||
| 391 | + ArrayList<Campaign> newCampaignList = new ArrayList<Campaign>(); | ||
| 392 | + ArrayList<Campaign> campaignLoyaltyList = new ArrayList<>(); | ||
| 393 | + if (resultCampaigns != null && !resultCampaigns.isEmpty()) | ||
| 394 | + newCampaignList.addAll(resultCampaigns); | ||
| 395 | + if (resultPersonalizedCampaigns != null && !resultPersonalizedCampaigns.isEmpty()) | ||
| 396 | + newCampaignList.addAll(resultPersonalizedCampaigns); | ||
| 397 | + | ||
| 398 | + if (newCampaignList != null && !newCampaignList.isEmpty()) { | ||
| 399 | + newCampaignList.stream().filter((item) -> item.getType().equals("contest") || item.getOfferCategory().equals("contest")); | ||
| 400 | + newCampaignList.sort((obj1, obj2) -> Integer.compare(obj1.getSorting(), obj2.getSorting())); | ||
| 401 | + | ||
| 402 | + Set<Campaign> set = new LinkedHashSet<>(newCampaignList); | ||
| 403 | + campaignLoyaltyList.addAll(set); | ||
| 404 | + } | ||
| 405 | + | ||
| 406 | + if (campaignLoyaltyList != null && !campaignLoyaltyList.isEmpty()) { | ||
| 407 | + // Add campaigns | ||
| 408 | + for (Campaign campaign : campaignLoyaltyList) { | ||
| 409 | + allItems.add(new BannerItem(campaign)); | ||
| 410 | + } | ||
| 411 | + } | ||
| 412 | + | ||
| 413 | + if (resultArticles != null && !resultArticles.isEmpty()) { | ||
| 414 | + // Add articles | ||
| 415 | + for (Content content : resultArticles) { | ||
| 416 | + allItems.add(new BannerItem(content)); | ||
| 417 | + } | ||
| 418 | + } | ||
| 419 | + | ||
| 420 | + WarplyManagerHelper.setBannerList(allItems); | ||
| 421 | + return allItems; | ||
| 422 | + } | ||
| 423 | + | ||
| 424 | + public static void getCampaigns(final CallbackReceiver<ArrayList<BannerItem>> receiver) { | ||
| 408 | WarpUtils.log("************* WARPLY Get Campaigns Request ********************"); | 425 | WarpUtils.log("************* WARPLY Get Campaigns Request ********************"); | 
| 409 | WarpUtils.log("[WARP Trace] WARPLY Get Campaigns Request is active"); | 426 | WarpUtils.log("[WARP Trace] WARPLY Get Campaigns Request is active"); | 
| 410 | WarpUtils.log("**************************************************"); | 427 | WarpUtils.log("**************************************************"); | 
| ... | @@ -413,19 +430,20 @@ public class WarplyManager { | ... | @@ -413,19 +430,20 @@ public class WarplyManager { | 
| 413 | ListeningExecutorService executorService = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(3)); | 430 | ListeningExecutorService executorService = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(3)); | 
| 414 | 431 | ||
| 415 | ListenableFuture<ArrayList<Campaign>> futureCampaigns = getCampaignsRetro(service); | 432 | ListenableFuture<ArrayList<Campaign>> futureCampaigns = getCampaignsRetro(service); | 
| 416 | - SettableFuture<ArrayList<Campaign>> futurePersonalized = SettableFuture.create(); | 433 | + ListenableFuture<ArrayList<Campaign>> futurePersonalizedCampaigns = getCampaignsPersonalizedRetro(service, 0); | 
| 417 | - ListenableFuture<ArrayList<Campaign>> futurePersonalizedCampaigns = getCampaignsPersonalizedRetro(service, 0, futurePersonalized); | 434 | + ListenableFuture<ArrayList<Content>> futureArticles = getArticlesRetro(service, new JSONArray().put("Carousel")); | 
| 418 | 435 | ||
| 419 | - ListenableFuture<List<Object>> allResultsFuture = Futures.allAsList(futureCampaigns, futurePersonalizedCampaigns); | 436 | + ListenableFuture<List<Object>> allResultsFuture = Futures.allAsList(futureCampaigns, futurePersonalizedCampaigns, futureArticles); | 
| 420 | - ListenableFuture<ArrayList<Campaign>> mergedResultFuture = Futures.transformAsync(allResultsFuture, results -> { | 437 | + ListenableFuture<ArrayList<BannerItem>> mergedResultFuture = Futures.transformAsync(allResultsFuture, results -> { | 
| 421 | ArrayList<Campaign> resultCampaigns = (ArrayList<Campaign>) results.get(0); | 438 | ArrayList<Campaign> resultCampaigns = (ArrayList<Campaign>) results.get(0); | 
| 422 | ArrayList<Campaign> resultPersonalizedCampaigns = (ArrayList<Campaign>) results.get(1); | 439 | ArrayList<Campaign> resultPersonalizedCampaigns = (ArrayList<Campaign>) results.get(1); | 
| 423 | - return executorService.submit(() -> mergeCampaignResults(resultCampaigns, resultPersonalizedCampaigns)); | 440 | + ArrayList<Content> resultArticles = (ArrayList<Content>) results.get(2); | 
| 441 | + return executorService.submit(() -> mergeCampaignResults(resultCampaigns, resultPersonalizedCampaigns, resultArticles)); | ||
| 424 | }, executorService); | 442 | }, executorService); | 
| 425 | 443 | ||
| 426 | - Futures.addCallback(mergedResultFuture, new FutureCallback<ArrayList<Campaign>>() { | 444 | + Futures.addCallback(mergedResultFuture, new FutureCallback<ArrayList<BannerItem>>() { | 
| 427 | @Override | 445 | @Override | 
| 428 | - public void onSuccess(ArrayList<Campaign> mergedResult) { | 446 | + public void onSuccess(ArrayList<BannerItem> mergedResult) { | 
| 429 | executorService.shutdownNow(); | 447 | executorService.shutdownNow(); | 
| 430 | new Handler(Looper.getMainLooper()).post(() -> receiver.onSuccess(mergedResult)); | 448 | new Handler(Looper.getMainLooper()).post(() -> receiver.onSuccess(mergedResult)); | 
| 431 | } | 449 | } | 
| ... | @@ -476,66 +494,31 @@ public class WarplyManager { | ... | @@ -476,66 +494,31 @@ public class WarplyManager { | 
| 476 | } | 494 | } | 
| 477 | 495 | ||
| 478 | if (jCampaignsBody != null) { | 496 | if (jCampaignsBody != null) { | 
| 479 | - ArrayList<NewCampaign> tempCampaigns = new ArrayList<>(); | ||
| 480 | ArrayList<Campaign> mCampaignsList = new ArrayList<>(); | 497 | ArrayList<Campaign> mCampaignsList = new ArrayList<>(); | 
| 481 | 498 | ||
| 482 | final ExecutorService executorCampaigns = Executors.newFixedThreadPool(1); | 499 | final ExecutorService executorCampaigns = Executors.newFixedThreadPool(1); | 
| 483 | JSONArray finalCampaignsJBody = jCampaignsBody; | 500 | JSONArray finalCampaignsJBody = jCampaignsBody; | 
| 484 | executorCampaigns.submit(() -> { | 501 | executorCampaigns.submit(() -> { | 
| 485 | for (int i = 0; i < finalCampaignsJBody.length(); ++i) { | 502 | for (int i = 0; i < finalCampaignsJBody.length(); ++i) { | 
| 486 | - tempCampaigns.add(new NewCampaign(finalCampaignsJBody.optJSONObject(i))); | ||
| 487 | - } | ||
| 488 | - for (NewCampaign newCamp : tempCampaigns) { | ||
| 489 | Campaign camp = new Campaign(); | 503 | Campaign camp = new Campaign(); | 
| 490 | - camp.setIndexUrl(newCamp.getIndexUrl()); | 504 | + NewCampaign tempNewCampaign = new NewCampaign(finalCampaignsJBody.optJSONObject(i)); | 
| 491 | - camp.setLogoUrl(newCamp.getLogoUrl()); | 505 | + | 
| 492 | - camp.setMessage(newCamp.getMessage()); | 506 | + camp.setIndexUrl(tempNewCampaign.getIndexUrl()); | 
| 493 | - camp.setOfferCategory(newCamp.getCommunicationCategory()); | 507 | + camp.setLogoUrl(tempNewCampaign.getLogoUrl()); | 
| 494 | - camp.setSessionUUID(newCamp.getCommunicationUUID()); | 508 | + camp.setMessage(tempNewCampaign.getMessage()); | 
| 495 | - camp.setTitle(newCamp.getTitle()); | 509 | + camp.setOfferCategory(tempNewCampaign.getCommunicationCategory()); | 
| 496 | - camp.setSubtitle(newCamp.getSubtitle()); | 510 | + camp.setSessionUUID(tempNewCampaign.getCommunicationUUID()); | 
| 497 | - camp.setSorting(newCamp.getSorting()); | 511 | + camp.setTitle(tempNewCampaign.getTitle()); | 
| 498 | - camp.setNew(newCamp.getIsNew()); | 512 | + camp.setSubtitle(tempNewCampaign.getSubtitle()); | 
| 499 | - camp.setType(newCamp.getCampaignType()); | 513 | + camp.setSorting(tempNewCampaign.getSorting()); | 
| 500 | - camp.setEndDate(newCamp.getEndDate()); | 514 | + camp.setNew(tempNewCampaign.getIsNew()); | 
| 501 | - camp.setStartDate(newCamp.getStartDate()); | 515 | + camp.setType(tempNewCampaign.getCampaignType()); | 
| 502 | - camp.setShowExpiration(newCamp.isShowExpiration()); | 516 | + camp.setEndDate(tempNewCampaign.getEndDate()); | 
| 503 | - camp.setCouponImg(newCamp.getCouponImg()); | 517 | + camp.setStartDate(tempNewCampaign.getStartDate()); | 
| 504 | - camp.setFilter(newCamp.getFilter()); | 518 | + camp.setShowExpiration(tempNewCampaign.isShowExpiration()); | 
| 505 | - try { | 519 | + camp.setCouponImg(tempNewCampaign.getCouponImg()); | 
| 506 | - camp.setExtraFields(newCamp.getExtraFields().toString()); | 520 | + camp.setFilter(tempNewCampaign.getFilter()); | 
| 507 | - if (!TextUtils.isEmpty(newCamp.getExtraFields().toString())) { | ||
| 508 | - JSONObject extraFieldsResp = WarpJSONParser.getJSONFromString(newCamp.getExtraFields().toString()); | ||
| 509 | - if (extraFieldsResp != null) { | ||
| 510 | - if (extraFieldsResp.has("Banner_title")) { | ||
| 511 | - camp.setBannerTitle(extraFieldsResp.optString("Banner_title", "")); | ||
| 512 | - } | ||
| 513 | - if (extraFieldsResp.has("Banner_img")) { | ||
| 514 | - camp.setBannerImage(extraFieldsResp.optString("Banner_img", "")); | ||
| 515 | - } | ||
| 516 | - if (extraFieldsResp.has("category_id")) { | ||
| 517 | - camp.setCategoryId(extraFieldsResp.optString("category_id", "")); | ||
| 518 | - } | ||
| 519 | - } | ||
| 520 | - } else { | ||
| 521 | - camp.setBannerImage(""); | ||
| 522 | - camp.setBannerTitle(""); | ||
| 523 | - camp.setCategoryId(""); | ||
| 524 | - } | ||
| 525 | - } catch (NullPointerException e) { | ||
| 526 | - camp.setExtraFields(""); | ||
| 527 | - camp.setBannerImage(""); | ||
| 528 | - camp.setBannerTitle(""); | ||
| 529 | - camp.setCategoryId(""); | ||
| 530 | - e.printStackTrace(); | ||
| 531 | - } | ||
| 532 | 521 | ||
| 533 | - try { | ||
| 534 | - camp.setCampaignTypeSettings(newCamp.getSettings().toString()); | ||
| 535 | - } catch (NullPointerException e) { | ||
| 536 | - camp.setCampaignTypeSettings(""); | ||
| 537 | - e.printStackTrace(); | ||
| 538 | - } | ||
| 539 | mCampaignsList.add(camp); | 522 | mCampaignsList.add(camp); | 
| 540 | } | 523 | } | 
| 541 | 524 | ||
| ... | @@ -548,6 +531,8 @@ public class WarplyManager { | ... | @@ -548,6 +531,8 @@ public class WarplyManager { | 
| 548 | // receiver.onFailure(2); | 531 | // receiver.onFailure(2); | 
| 549 | future.set(new ArrayList<Campaign>()); | 532 | future.set(new ArrayList<Campaign>()); | 
| 550 | } | 533 | } | 
| 534 | + } else if (String.valueOf(response.code()).startsWith("5")) { | ||
| 535 | + future.set(new ArrayList<Campaign>()); | ||
| 551 | } else { | 536 | } else { | 
| 552 | // receiver.onFailure(response.code()); | 537 | // receiver.onFailure(response.code()); | 
| 553 | // future.set(new ArrayList<Campaign>()); | 538 | // future.set(new ArrayList<Campaign>()); | 
| ... | @@ -566,7 +551,9 @@ public class WarplyManager { | ... | @@ -566,7 +551,9 @@ public class WarplyManager { | 
| 566 | return future; | 551 | return future; | 
| 567 | } | 552 | } | 
| 568 | 553 | ||
| 569 | - private static /*void*/ ListenableFuture<ArrayList<Campaign>> getCampaignsPersonalizedRetro(ApiService service, int tries/*, final CallbackReceiver<ArrayList<Campaign>> receiver*/, SettableFuture<ArrayList<Campaign>> future) { | 554 | + private static /*void*/ ListenableFuture<ArrayList<Campaign>> getCampaignsPersonalizedRetro(ApiService service, int tries/*, final CallbackReceiver<ArrayList<Campaign>> receiver*/) { | 
| 555 | + SettableFuture<ArrayList<Campaign>> future = SettableFuture.create(); | ||
| 556 | + | ||
| 570 | String timeStamp = DateFormat.format("yyyy-MM-dd hh:mm:ss", System.currentTimeMillis()).toString(); | 557 | String timeStamp = DateFormat.format("yyyy-MM-dd hh:mm:ss", System.currentTimeMillis()).toString(); | 
| 571 | String apiKey = WarpUtils.getApiKey(Warply.getWarplyContext()); | 558 | String apiKey = WarpUtils.getApiKey(Warply.getWarplyContext()); | 
| 572 | String webId = WarpUtils.getWebId(Warply.getWarplyContext()); | 559 | String webId = WarpUtils.getWebId(Warply.getWarplyContext()); | 
| ... | @@ -602,66 +589,31 @@ public class WarplyManager { | ... | @@ -602,66 +589,31 @@ public class WarplyManager { | 
| 602 | } | 589 | } | 
| 603 | 590 | ||
| 604 | if (jCampaignsBody != null) { | 591 | if (jCampaignsBody != null) { | 
| 605 | - ArrayList<NewCampaign> tempCampaigns = new ArrayList<>(); | ||
| 606 | ArrayList<Campaign> mCampaignsList = new ArrayList<>(); | 592 | ArrayList<Campaign> mCampaignsList = new ArrayList<>(); | 
| 607 | 593 | ||
| 608 | final ExecutorService executorPersonalizedCampaigns = Executors.newFixedThreadPool(1); | 594 | final ExecutorService executorPersonalizedCampaigns = Executors.newFixedThreadPool(1); | 
| 609 | JSONArray finalCampaignsJBody = jCampaignsBody; | 595 | JSONArray finalCampaignsJBody = jCampaignsBody; | 
| 610 | executorPersonalizedCampaigns.submit(() -> { | 596 | executorPersonalizedCampaigns.submit(() -> { | 
| 611 | for (int i = 0; i < finalCampaignsJBody.length(); ++i) { | 597 | for (int i = 0; i < finalCampaignsJBody.length(); ++i) { | 
| 612 | - tempCampaigns.add(new NewCampaign(finalCampaignsJBody.optJSONObject(i))); | ||
| 613 | - } | ||
| 614 | - for (NewCampaign newCamp : tempCampaigns) { | ||
| 615 | Campaign camp = new Campaign(); | 598 | Campaign camp = new Campaign(); | 
| 616 | - camp.setIndexUrl(newCamp.getIndexUrl()); | 599 | + NewCampaign tempNewCampaign = new NewCampaign(finalCampaignsJBody.optJSONObject(i)); | 
| 617 | - camp.setLogoUrl(newCamp.getLogoUrl()); | 600 | + | 
| 618 | - camp.setMessage(newCamp.getMessage()); | 601 | + camp.setIndexUrl(tempNewCampaign.getIndexUrl()); | 
| 619 | - camp.setOfferCategory(newCamp.getCommunicationCategory()); | 602 | + camp.setLogoUrl(tempNewCampaign.getLogoUrl()); | 
| 620 | - camp.setSessionUUID(newCamp.getCommunicationUUID()); | 603 | + camp.setMessage(tempNewCampaign.getMessage()); | 
| 621 | - camp.setTitle(newCamp.getTitle()); | 604 | + camp.setOfferCategory(tempNewCampaign.getCommunicationCategory()); | 
| 622 | - camp.setSubtitle(newCamp.getSubtitle()); | 605 | + camp.setSessionUUID(tempNewCampaign.getCommunicationUUID()); | 
| 623 | - camp.setSorting(newCamp.getSorting()); | 606 | + camp.setTitle(tempNewCampaign.getTitle()); | 
| 624 | - camp.setNew(newCamp.getIsNew()); | 607 | + camp.setSubtitle(tempNewCampaign.getSubtitle()); | 
| 625 | - camp.setType(newCamp.getCampaignType()); | 608 | + camp.setSorting(tempNewCampaign.getSorting()); | 
| 626 | - camp.setEndDate(newCamp.getEndDate()); | 609 | + camp.setNew(tempNewCampaign.getIsNew()); | 
| 627 | - camp.setStartDate(newCamp.getStartDate()); | 610 | + camp.setType(tempNewCampaign.getCampaignType()); | 
| 628 | - camp.setShowExpiration(newCamp.isShowExpiration()); | 611 | + camp.setEndDate(tempNewCampaign.getEndDate()); | 
| 629 | - camp.setCouponImg(newCamp.getCouponImg()); | 612 | + camp.setStartDate(tempNewCampaign.getStartDate()); | 
| 630 | - camp.setFilter(newCamp.getFilter()); | 613 | + camp.setShowExpiration(tempNewCampaign.isShowExpiration()); | 
| 631 | - try { | 614 | + camp.setCouponImg(tempNewCampaign.getCouponImg()); | 
| 632 | - camp.setExtraFields(newCamp.getExtraFields().toString()); | 615 | + camp.setFilter(tempNewCampaign.getFilter()); | 
| 633 | - if (!TextUtils.isEmpty(newCamp.getExtraFields().toString())) { | ||
| 634 | - JSONObject extraFieldsResp = WarpJSONParser.getJSONFromString(newCamp.getExtraFields().toString()); | ||
| 635 | - if (extraFieldsResp != null) { | ||
| 636 | - if (extraFieldsResp.has("Banner_title")) { | ||
| 637 | - camp.setBannerTitle(extraFieldsResp.optString("Banner_title", "")); | ||
| 638 | - } | ||
| 639 | - if (extraFieldsResp.has("Banner_img")) { | ||
| 640 | - camp.setBannerImage(extraFieldsResp.optString("Banner_img", "")); | ||
| 641 | - } | ||
| 642 | - if (extraFieldsResp.has("category_id")) { | ||
| 643 | - camp.setCategoryId(extraFieldsResp.optString("category_id", "")); | ||
| 644 | - } | ||
| 645 | - } | ||
| 646 | - } else { | ||
| 647 | - camp.setBannerImage(""); | ||
| 648 | - camp.setBannerTitle(""); | ||
| 649 | - camp.setCategoryId(""); | ||
| 650 | - } | ||
| 651 | - } catch (NullPointerException e) { | ||
| 652 | - camp.setExtraFields(""); | ||
| 653 | - camp.setBannerImage(""); | ||
| 654 | - camp.setBannerTitle(""); | ||
| 655 | - camp.setCategoryId(""); | ||
| 656 | - e.printStackTrace(); | ||
| 657 | - } | ||
| 658 | 616 | ||
| 659 | - try { | ||
| 660 | - camp.setCampaignTypeSettings(newCamp.getSettings().toString()); | ||
| 661 | - } catch (NullPointerException e) { | ||
| 662 | - camp.setCampaignTypeSettings(""); | ||
| 663 | - e.printStackTrace(); | ||
| 664 | - } | ||
| 665 | mCampaignsList.add(camp); | 617 | mCampaignsList.add(camp); | 
| 666 | } | 618 | } | 
| 667 | 619 | ||
| ... | @@ -680,11 +632,11 @@ public class WarplyManager { | ... | @@ -680,11 +632,11 @@ public class WarplyManager { | 
| 680 | public void onSuccess(JSONObject result) { | 632 | public void onSuccess(JSONObject result) { | 
| 681 | int status = result.optInt("status", 2); | 633 | int status = result.optInt("status", 2); | 
| 682 | if (status == 1) | 634 | if (status == 1) | 
| 683 | - getCampaignsPersonalizedRetro(service, tries/*, receiver*/, future); | 635 | + getCampaignsPersonalizedRetro(service, tries/*, receiver*/); | 
| 684 | else { | 636 | else { | 
| 685 | // receiver.onFailure(status); | 637 | // receiver.onFailure(status); | 
| 686 | if (tries < MAX_RETRIES) { | 638 | if (tries < MAX_RETRIES) { | 
| 687 | - getCampaignsPersonalizedRetro(service, (tries + 1), future); | 639 | + getCampaignsPersonalizedRetro(service, (tries + 1)); | 
| 688 | } else { | 640 | } else { | 
| 689 | // future.set(new ArrayList<Campaign>()); | 641 | // future.set(new ArrayList<Campaign>()); | 
| 690 | future.setException(new Throwable()); | 642 | future.setException(new Throwable()); | 
| ... | @@ -696,14 +648,14 @@ public class WarplyManager { | ... | @@ -696,14 +648,14 @@ public class WarplyManager { | 
| 696 | public void onFailure(int errorCode) { | 648 | public void onFailure(int errorCode) { | 
| 697 | // receiver.onFailure(errorCode); | 649 | // receiver.onFailure(errorCode); | 
| 698 | if (tries < MAX_RETRIES) { | 650 | if (tries < MAX_RETRIES) { | 
| 699 | - getCampaignsPersonalizedRetro(service, (tries + 1), future); | 651 | + getCampaignsPersonalizedRetro(service, (tries + 1)); | 
| 700 | } else { | 652 | } else { | 
| 701 | // future.set(new ArrayList<Campaign>()); | 653 | // future.set(new ArrayList<Campaign>()); | 
| 702 | future.setException(new Throwable()); | 654 | future.setException(new Throwable()); | 
| 703 | } | 655 | } | 
| 704 | } | 656 | } | 
| 705 | }); | 657 | }); | 
| 706 | - } else if (response.code() == 502) { | 658 | + } else if (String.valueOf(response.code()).startsWith("5")) { | 
| 707 | // receiver.onFailure(response.code()); | 659 | // receiver.onFailure(response.code()); | 
| 708 | // future.set(new ArrayList<Campaign>()); | 660 | // future.set(new ArrayList<Campaign>()); | 
| 709 | future.set(new ArrayList<Campaign>()); | 661 | future.set(new ArrayList<Campaign>()); | 
| ... | @@ -725,180 +677,89 @@ public class WarplyManager { | ... | @@ -725,180 +677,89 @@ public class WarplyManager { | 
| 725 | return future; | 677 | return future; | 
| 726 | } | 678 | } | 
| 727 | 679 | ||
| 728 | - private static ListenableFuture<JSONObject> getCampaignAvailability(ApiService service) { | 680 | + private static /*void*/ ListenableFuture<ArrayList<Content>> getArticlesRetro(ApiService service, JSONArray categories/*, final CallbackReceiver<ArrayList<Campaign>> receiver*/) { | 
| 729 | - SettableFuture<JSONObject> future = SettableFuture.create(); | 681 | + SettableFuture<ArrayList<Content>> future = SettableFuture.create(); | 
| 730 | 682 | ||
| 731 | String timeStamp = DateFormat.format("yyyy-MM-dd hh:mm:ss", System.currentTimeMillis()).toString(); | 683 | String timeStamp = DateFormat.format("yyyy-MM-dd hh:mm:ss", System.currentTimeMillis()).toString(); | 
| 732 | String apiKey = WarpUtils.getApiKey(Warply.getWarplyContext()); | 684 | String apiKey = WarpUtils.getApiKey(Warply.getWarplyContext()); | 
| 733 | String webId = WarpUtils.getWebId(Warply.getWarplyContext()); | 685 | String webId = WarpUtils.getWebId(Warply.getWarplyContext()); | 
| 734 | 686 | ||
| 735 | - Map<String, Object> jsonParamsCampaignsAvailability = new ArrayMap<>(); | 687 | + Map<String, Object> jsonParamsArticles = new ArrayMap<>(); | 
| 736 | Map<String, Object> jsonParams = new ArrayMap<>(); | 688 | Map<String, Object> jsonParams = new ArrayMap<>(); | 
| 737 | - jsonParams.put("action", "availability"); | 689 | + jsonParams.put("action", "retrieve_multilingual"); | 
| 738 | - Map<String, Object> jsonParamsFilters = new ArrayMap<>(); | 690 | + if (categories != null && categories.length() > 0) | 
| 739 | - jsonParamsFilters.put("uuids", null); | 691 | + jsonParams.put("category", categories); | 
| 740 | - jsonParamsFilters.put("availability_enabled", true); | ||
| 741 | - jsonParams.put("filters", jsonParamsFilters); | ||
| 742 | - | ||
| 743 | - jsonParamsCampaignsAvailability.put("coupon", jsonParams); | ||
| 744 | - RequestBody campaignsAvailabilityRequest = RequestBody.create(MediaType.get("application/json; charset=utf-8"), (new JSONObject(jsonParamsCampaignsAvailability)).toString()); | ||
| 745 | - | ||
| 746 | - Call<ResponseBody> campaignsAvailabilityCall = service.getCampaignsAvailability(WarplyProperty.getAppUuid(Warply.getWarplyContext()), campaignsAvailabilityRequest, timeStamp, "android:" + Warply.getWarplyContext().getPackageName(), new WarplyDeviceInfoCollector(Warply.getWarplyContext()).getUniqueDeviceId(), "mobile", webId, WarpUtils.produceSignature(apiKey + timeStamp)); | ||
| 747 | - | ||
| 748 | - campaignsAvailabilityCall.enqueue(new Callback<ResponseBody>() { | ||
| 749 | - @Override | ||
| 750 | - public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> response) { | ||
| 751 | - if (response.code() == 200 && response.body() != null) { | ||
| 752 | - JSONObject jobjCampaignsAvailabilityResponse = null; | ||
| 753 | - try { | ||
| 754 | - jobjCampaignsAvailabilityResponse = new JSONObject(response.body().string()); | ||
| 755 | - } catch (Exception e) { | ||
| 756 | - e.printStackTrace(); | ||
| 757 | - } | ||
| 758 | - | ||
| 759 | - if (jobjCampaignsAvailabilityResponse != null && jobjCampaignsAvailabilityResponse.has("status") && jobjCampaignsAvailabilityResponse.optString("status", "2").equals("1")) { | ||
| 760 | - final ExecutorService executorCampaignsAvailability = Executors.newFixedThreadPool(1); | ||
| 761 | - final JSONObject finalJobjCampaignsAvailabilityResponse = jobjCampaignsAvailabilityResponse; | ||
| 762 | - executorCampaignsAvailability.submit(() -> { | ||
| 763 | - JSONObject jCampaignsAvailabilityBody = null; | ||
| 764 | - try { | ||
| 765 | - jCampaignsAvailabilityBody = finalJobjCampaignsAvailabilityResponse.optJSONObject("context").optJSONObject("MAPP_COUPON").optJSONObject("availability"); | ||
| 766 | - } catch (Exception e) { | ||
| 767 | - e.printStackTrace(); | ||
| 768 | - } | ||
| 769 | - | ||
| 770 | - if (jCampaignsAvailabilityBody != null) { | ||
| 771 | - executorCampaignsAvailability.shutdownNow(); | ||
| 772 | - future.set(jCampaignsAvailabilityBody); | ||
| 773 | - } | ||
| 774 | - }); | ||
| 775 | - } else { | ||
| 776 | - future.set(new JSONObject()); | ||
| 777 | - } | ||
| 778 | - } else { | ||
| 779 | -// future.set(new JSONObject()); | ||
| 780 | - future.setException(new Throwable()); | ||
| 781 | - } | ||
| 782 | - } | ||
| 783 | - | ||
| 784 | - @Override | ||
| 785 | - public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) { | ||
| 786 | -// future.set(new JSONObject()); | ||
| 787 | - future.setException(new Throwable()); | ||
| 788 | - } | ||
| 789 | - }); | ||
| 790 | - | ||
| 791 | - return future; | ||
| 792 | - } | ||
| 793 | - | ||
| 794 | - private static ListenableFuture<RedeemedSMHistoryModel> getSMCouponsUniversalRetro(ApiService service, int tries, SettableFuture<RedeemedSMHistoryModel> future) { | ||
| 795 | - String timeStamp = DateFormat.format("yyyy-MM-dd hh:mm:ss", System.currentTimeMillis()).toString(); | ||
| 796 | - String apiKey = WarpUtils.getApiKey(Warply.getWarplyContext()); | ||
| 797 | - String webId = WarpUtils.getWebId(Warply.getWarplyContext()); | ||
| 798 | - | ||
| 799 | - Map<String, Object> jsonParamsCoupons = new ArrayMap<>(); | ||
| 800 | - Map<String, Object> jsonParams = new ArrayMap<>(); | ||
| 801 | - jsonParams.put("action", "user_coupons"); | ||
| 802 | - JSONArray jArr = new JSONArray(); | ||
| 803 | - jArr.put("merchant"); | ||
| 804 | - jArr.put("redemption"); | ||
| 805 | - jsonParams.put("details", jArr); | ||
| 806 | jsonParams.put("language", WarpUtils.getApplicationLocale(Warply.getWarplyContext())); | 692 | jsonParams.put("language", WarpUtils.getApplicationLocale(Warply.getWarplyContext())); | 
| 807 | - jsonParams.put("couponset_types", new JSONArray().put("supermarket")); | ||
| 808 | 693 | ||
| 809 | - jsonParamsCoupons.put("coupon", jsonParams); | 694 | + jsonParamsArticles.put("content", jsonParams); | 
| 810 | - RequestBody couponsRequest = RequestBody.create(MediaType.get("application/json; charset=utf-8"), (new JSONObject(jsonParamsCoupons)).toString()); | 695 | + RequestBody articlesRequest = RequestBody.create(MediaType.get("application/json; charset=utf-8"), (new JSONObject(jsonParamsArticles)).toString()); | 
| 811 | 696 | ||
| 812 | - Call<ResponseBody> couponsCall = service.getUserCoupons(WarplyProperty.getAppUuid(Warply.getWarplyContext()), couponsRequest, timeStamp, "android:" + Warply.getWarplyContext().getPackageName(), new WarplyDeviceInfoCollector(Warply.getWarplyContext()).getUniqueDeviceId(), "mobile", webId, WarpUtils.produceSignature(apiKey + timeStamp), "Bearer " + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")); | 697 | + Call<ResponseBody> articlesCall = service.getArticles( | 
| 698 | + WarplyProperty.getAppUuid(Warply.getWarplyContext()), | ||
| 699 | + articlesRequest, | ||
| 700 | + timeStamp, | ||
| 701 | + "android:" + Warply.getWarplyContext().getPackageName(), | ||
| 702 | + new WarplyDeviceInfoCollector(Warply.getWarplyContext()).getUniqueDeviceId(), | ||
| 703 | + "mobile", | ||
| 704 | + webId, | ||
| 705 | + WarpUtils.produceSignature(apiKey + timeStamp) | ||
| 706 | + ); | ||
| 813 | 707 | ||
| 814 | - couponsCall.enqueue(new Callback<ResponseBody>() { | 708 | + articlesCall.enqueue(new Callback<ResponseBody>() { | 
| 815 | @Override | 709 | @Override | 
| 816 | public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> response) { | 710 | public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> response) { | 
| 817 | if (response.code() == 200 && response.body() != null) { | 711 | if (response.code() == 200 && response.body() != null) { | 
| 818 | - JSONObject jobjCouponsResponse = null; | 712 | + JSONObject jobjArticlesResponse = null; | 
| 819 | try { | 713 | try { | 
| 820 | - jobjCouponsResponse = new JSONObject(response.body().string()); | 714 | + jobjArticlesResponse = new JSONObject(response.body().string()); | 
| 821 | } catch (Exception e) { | 715 | } catch (Exception e) { | 
| 822 | e.printStackTrace(); | 716 | e.printStackTrace(); | 
| 823 | } | 717 | } | 
| 824 | - if (jobjCouponsResponse != null && jobjCouponsResponse.has("status") && jobjCouponsResponse.optString("status", "2").equals("1")) { | 718 | + | 
| 825 | - JSONArray jCouponsBody = null; | 719 | + if (jobjArticlesResponse != null && jobjArticlesResponse.has("status") && jobjArticlesResponse.optString("status", "2").equals("1")) { | 
| 720 | + JSONArray jArticlesBody = null; | ||
| 826 | try { | 721 | try { | 
| 827 | - jCouponsBody = jobjCouponsResponse.optJSONArray("result"); | 722 | + jArticlesBody = jobjArticlesResponse.optJSONObject("context").optJSONArray("CONTENT"); | 
| 828 | } catch (Exception e) { | 723 | } catch (Exception e) { | 
| 829 | e.printStackTrace(); | 724 | e.printStackTrace(); | 
| 830 | } | 725 | } | 
| 831 | - if (jCouponsBody != null) { | ||
| 832 | - RedeemedSMHistoryModel redeemedSMHistoryModel = new RedeemedSMHistoryModel(); | ||
| 833 | - CouponList mCouponRedeemedList = new CouponList(); | ||
| 834 | 726 | ||
| 835 | - final ExecutorService executorCoupons = Executors.newFixedThreadPool(1); | 727 | + if (jArticlesBody != null) { | 
| 836 | - JSONArray finalJCouponsBody = jCouponsBody; | 728 | + ArrayList<Content> mArticlesList = new ArrayList<>(); | 
| 837 | - executorCoupons.submit(() -> { | ||
| 838 | - float couponValue = 0.0f; | ||
| 839 | 729 | ||
| 840 | - for (int i = 0; i < finalJCouponsBody.length(); ++i) { | 730 | + final ExecutorService executorArticles = Executors.newFixedThreadPool(1); | 
| 841 | - Coupon tempCoupon = new Coupon(finalJCouponsBody.optJSONObject(i), true); | 731 | + JSONArray finalArticlesJBody = jArticlesBody; | 
| 842 | - | 732 | + executorArticles.submit(() -> { | 
| 843 | - if (tempCoupon.getStatus() == 0) { | 733 | + for (int i = 0; i < finalArticlesJBody.length(); ++i) { | 
| 844 | - mCouponRedeemedList.add(tempCoupon); | 734 | + mArticlesList.add(new Content(finalArticlesJBody.optJSONObject(i))); | 
| 845 | - couponValue += (float) tempCoupon.getCouponsetDetails().getFinal_price(); | ||
| 846 | - } | ||
| 847 | } | 735 | } | 
| 848 | 736 | ||
| 849 | - Collections.sort(mCouponRedeemedList, (coupon1, coupon2) -> coupon1.getRedeemDate().compareTo(coupon2.getRedeemDate())); | 737 | + executorArticles.shutdownNow(); | 
| 850 | - redeemedSMHistoryModel.setTotalRedeemedValue(couponValue); | 738 | +// receiver.onSuccess(mCampaignsList); | 
| 851 | - redeemedSMHistoryModel.setRedeemedCouponList(mCouponRedeemedList); | 739 | + future.set(mArticlesList); | 
| 852 | - executorCoupons.shutdownNow(); | ||
| 853 | - future.set(redeemedSMHistoryModel); | ||
| 854 | }); | 740 | }); | 
| 855 | - } else { | ||
| 856 | - future.set(new RedeemedSMHistoryModel()); | ||
| 857 | } | 741 | } | 
| 858 | } else { | 742 | } else { | 
| 859 | - future.set(new RedeemedSMHistoryModel()); | 743 | +// receiver.onFailure(2); | 
| 744 | + future.set(new ArrayList<Content>()); | ||
| 860 | } | 745 | } | 
| 861 | - } else if (response.code() == 401) { | 746 | + } else if (String.valueOf(response.code()).startsWith("5")) { | 
| 862 | - refreshToken(new WarplyRefreshTokenRequest(), new CallbackReceiver<JSONObject>() { | 747 | + future.set(new ArrayList<Content>()); | 
| 863 | - @Override | ||
| 864 | - public void onSuccess(JSONObject result) { | ||
| 865 | - int status = result.optInt("status", 2); | ||
| 866 | - if (status == 1) | ||
| 867 | - getSMCouponsUniversalRetro(service, tries/*, receiver*/, future); | ||
| 868 | - else { | ||
| 869 | -// receiver.onFailure(status); | ||
| 870 | - if (tries < MAX_RETRIES) { | ||
| 871 | - getSMCouponsUniversalRetro(service, (tries + 1), future); | ||
| 872 | - } else { | ||
| 873 | -// future.set(new CouponList()); | ||
| 874 | - future.setException(new Throwable()); | ||
| 875 | - } | ||
| 876 | - } | ||
| 877 | - } | ||
| 878 | - | ||
| 879 | - @Override | ||
| 880 | - public void onFailure(int errorCode) { | ||
| 881 | -// receiver.onFailure(errorCode); | ||
| 882 | - if (tries < MAX_RETRIES) { | ||
| 883 | - getSMCouponsUniversalRetro(service, (tries + 1), future); | ||
| 884 | - } else { | ||
| 885 | -// future.set(new CouponList()); | ||
| 886 | - future.setException(new Throwable()); | ||
| 887 | - } | ||
| 888 | - } | ||
| 889 | - }); | ||
| 890 | } else { | 748 | } else { | 
| 891 | -// future.set(new CouponList()); | 749 | +// receiver.onFailure(response.code()); | 
| 750 | +// future.set(new ArrayList<Campaign>()); | ||
| 892 | future.setException(new Throwable()); | 751 | future.setException(new Throwable()); | 
| 893 | } | 752 | } | 
| 894 | } | 753 | } | 
| 895 | 754 | ||
| 896 | @Override | 755 | @Override | 
| 897 | public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) { | 756 | public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) { | 
| 898 | -// future.set(new CouponList()); | 757 | +// receiver.onFailure(2); | 
| 758 | +// future.set(new ArrayList<Campaign>()); | ||
| 899 | future.setException(new Throwable()); | 759 | future.setException(new Throwable()); | 
| 900 | } | 760 | } | 
| 901 | }); | 761 | }); | 
| 762 | + | ||
| 902 | return future; | 763 | return future; | 
| 903 | } | 764 | } | 
| 904 | 765 | ... | ... | 
| ... | @@ -55,6 +55,7 @@ | ... | @@ -55,6 +55,7 @@ | 
| 55 | </LinearLayout> | 55 | </LinearLayout> | 
| 56 | 56 | ||
| 57 | <androidx.constraintlayout.widget.ConstraintLayout | 57 | <androidx.constraintlayout.widget.ConstraintLayout | 
| 58 | + android:id="@+id/cl_viewpager" | ||
| 58 | android:layout_width="match_parent" | 59 | android:layout_width="match_parent" | 
| 59 | android:layout_height="wrap_content"> | 60 | android:layout_height="wrap_content"> | 
| 60 | 61 | ... | ... | 
- 
Please register or login to post a comment
