Dhileep Kumar D 5 年 前
コミット
544ca88176
100 ファイル変更33268 行追加0 行削除
  1. BIN
      Android/.DS_Store
  2. 15 0
      Android/app/.gitignore
  3. 90 0
      Android/app/build.gradle
  4. 39 0
      Android/app/google-services.json
  5. 172 0
      Android/app/gradlew
  6. 84 0
      Android/app/gradlew.bat
  7. 1 0
      Android/app/libs/PLACEHOLDER
  8. BIN
      Android/app/libs/agora-rtc-sdk.jar
  9. BIN
      Android/app/libs/agora-rtm-sdk.jar
  10. 543 0
      Android/app/src/main/AndroidManifest.xml
  11. BIN
      Android/app/src/main/assets/Architex.ttf
  12. BIN
      Android/app/src/main/assets/Roboto-Light.ttf
  13. BIN
      Android/app/src/main/assets/roboto_medium.ttf
  14. BIN
      Android/app/src/main/assets/robotothin.ttf
  15. 8 0
      Android/app/src/main/gen/com/ttiglobal/suzuki/BuildConfig.java
  16. 7 0
      Android/app/src/main/gen/com/ttiglobal/suzuki/Manifest.java
  17. 7 0
      Android/app/src/main/gen/com/ttiglobal/suzuki/R.java
  18. 467 0
      Android/app/src/main/java/com/cygnusa/hyperm/AMAttendanceActivity.java
  19. 1368 0
      Android/app/src/main/java/com/cygnusa/hyperm/AMHomeActivity.java
  20. 463 0
      Android/app/src/main/java/com/cygnusa/hyperm/AMNotificationSummary.java
  21. 301 0
      Android/app/src/main/java/com/cygnusa/hyperm/ASMScheduleViewActivity.java
  22. 83 0
      Android/app/src/main/java/com/cygnusa/hyperm/AboutActivity.java
  23. 318 0
      Android/app/src/main/java/com/cygnusa/hyperm/AcceptTrainingActivity.java
  24. 767 0
      Android/app/src/main/java/com/cygnusa/hyperm/AssessmentActivity.java
  25. 575 0
      Android/app/src/main/java/com/cygnusa/hyperm/AttendanceScheduleActivity.java
  26. 395 0
      Android/app/src/main/java/com/cygnusa/hyperm/AudioViewActivity.java
  27. 318 0
      Android/app/src/main/java/com/cygnusa/hyperm/BulletinActivity.java
  28. 150 0
      Android/app/src/main/java/com/cygnusa/hyperm/BulletinDetails.java
  29. 241 0
      Android/app/src/main/java/com/cygnusa/hyperm/ChangePasswordActivity.java
  30. 129 0
      Android/app/src/main/java/com/cygnusa/hyperm/ClassRoomDSETainingActivity.java
  31. 123 0
      Android/app/src/main/java/com/cygnusa/hyperm/ClassRoomTrainerTainingActivity.java
  32. 394 0
      Android/app/src/main/java/com/cygnusa/hyperm/ContentListActivity.java
  33. 2324 0
      Android/app/src/main/java/com/cygnusa/hyperm/CreateClassRoomActivityNew.java
  34. 180 0
      Android/app/src/main/java/com/cygnusa/hyperm/CropActivity.java
  35. 378 0
      Android/app/src/main/java/com/cygnusa/hyperm/DSEViewFeedbackActivity.java
  36. 28 0
      Android/app/src/main/java/com/cygnusa/hyperm/EMICalculator.java
  37. 129 0
      Android/app/src/main/java/com/cygnusa/hyperm/FaqActivity.java
  38. 483 0
      Android/app/src/main/java/com/cygnusa/hyperm/ForgotPasswordActivity.java
  39. 1444 0
      Android/app/src/main/java/com/cygnusa/hyperm/HomeActivity.java
  40. 627 0
      Android/app/src/main/java/com/cygnusa/hyperm/HyperMEnquiryForm.java
  41. 135 0
      Android/app/src/main/java/com/cygnusa/hyperm/IndroScreen.java
  42. 263 0
      Android/app/src/main/java/com/cygnusa/hyperm/LearningPathActivity.java
  43. 356 0
      Android/app/src/main/java/com/cygnusa/hyperm/LoginActivity.java
  44. 133 0
      Android/app/src/main/java/com/cygnusa/hyperm/MainActivity.java
  45. 884 0
      Android/app/src/main/java/com/cygnusa/hyperm/MainProfileActivity.java
  46. 2627 0
      Android/app/src/main/java/com/cygnusa/hyperm/ModifyClassRoomActivity.java
  47. 446 0
      Android/app/src/main/java/com/cygnusa/hyperm/MyEarnedPoints.java
  48. 900 0
      Android/app/src/main/java/com/cygnusa/hyperm/MyProfileActivity.java
  49. 106 0
      Android/app/src/main/java/com/cygnusa/hyperm/MyTrainingModuleActivity.java
  50. 309 0
      Android/app/src/main/java/com/cygnusa/hyperm/MyWallet.java
  51. 464 0
      Android/app/src/main/java/com/cygnusa/hyperm/NotificationActivity.java
  52. 88 0
      Android/app/src/main/java/com/cygnusa/hyperm/NotificationViewActivity.java
  53. 454 0
      Android/app/src/main/java/com/cygnusa/hyperm/OtpActivity.java
  54. 610 0
      Android/app/src/main/java/com/cygnusa/hyperm/PdfViewActivity.java
  55. 650 0
      Android/app/src/main/java/com/cygnusa/hyperm/ProductExploreDetailsActivity.java
  56. 301 0
      Android/app/src/main/java/com/cygnusa/hyperm/ProductExplorerActivity.java
  57. 352 0
      Android/app/src/main/java/com/cygnusa/hyperm/ProductFeedbackFormActivity.java
  58. 61 0
      Android/app/src/main/java/com/cygnusa/hyperm/ProductHomeActivity.java
  59. 356 0
      Android/app/src/main/java/com/cygnusa/hyperm/ProductVideoViewActivity.java
  60. 249 0
      Android/app/src/main/java/com/cygnusa/hyperm/ProductWelcomeScreenActivity.java
  61. 165 0
      Android/app/src/main/java/com/cygnusa/hyperm/RedeemPointsCategoryActivity.java
  62. 510 0
      Android/app/src/main/java/com/cygnusa/hyperm/RedeemProductDetailsActivity.java
  63. 219 0
      Android/app/src/main/java/com/cygnusa/hyperm/RedeemProductListActivity.java
  64. 218 0
      Android/app/src/main/java/com/cygnusa/hyperm/ResetPasswordActivity.java
  65. 256 0
      Android/app/src/main/java/com/cygnusa/hyperm/ReviewActivity.java
  66. 1407 0
      Android/app/src/main/java/com/cygnusa/hyperm/SEHomeActivity.java
  67. 36 0
      Android/app/src/main/java/com/cygnusa/hyperm/SendQuestionsModel.java
  68. 239 0
      Android/app/src/main/java/com/cygnusa/hyperm/SetNewPasswordActivity.java
  69. 300 0
      Android/app/src/main/java/com/cygnusa/hyperm/SettingsActivity.java
  70. 131 0
      Android/app/src/main/java/com/cygnusa/hyperm/ShowQrCodeClass.java
  71. 586 0
      Android/app/src/main/java/com/cygnusa/hyperm/SignUpActivity.java
  72. 252 0
      Android/app/src/main/java/com/cygnusa/hyperm/SplashScreen.java
  73. 488 0
      Android/app/src/main/java/com/cygnusa/hyperm/SurveyActivity.java
  74. 414 0
      Android/app/src/main/java/com/cygnusa/hyperm/TargetSalesActivity.java
  75. 83 0
      Android/app/src/main/java/com/cygnusa/hyperm/TermsandConditions.java
  76. 304 0
      Android/app/src/main/java/com/cygnusa/hyperm/TopicListActivity.java
  77. 266 0
      Android/app/src/main/java/com/cygnusa/hyperm/TrainerViewFeedbackActivity.java
  78. 763 0
      Android/app/src/main/java/com/cygnusa/hyperm/VideoViewActivity.java
  79. 590 0
      Android/app/src/main/java/com/cygnusa/hyperm/ViewScheduleActivity.java
  80. 377 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/ASMParticipantListAdapter.java
  81. 389 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/AssessmentListAdapter.java
  82. 92 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/AttendanceAdapter.java
  83. 138 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/BulletinAdapter.java
  84. 109 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/CompareComparisionExpandableListAdapter.java
  85. 152 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/ComparisionChildAdapter.java
  86. 122 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/ComparisionExpandableListAdapter.java
  87. 176 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/ComparisionExpandableListAdapterNew.java
  88. 132 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/ComparisonCompareModelLayoutAdapter.java
  89. 193 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/ContentAdapter.java
  90. 4 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/EarningPagerAdapter.java
  91. 249 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/HistoryAdapter.java
  92. 164 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/LeaderBoardListAdapter.java
  93. 163 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/LearningPathAdapter.java
  94. 666 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/NotificationAdapter.java
  95. 177 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/OrderHistoryAdapter.java
  96. 84 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/ProductFeedbackListAdapter.java
  97. 80 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/ProductListAdapter.java
  98. 76 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/ProductVideoAdapter.java
  99. 103 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/QuestionAdapter.java
  100. 0 0
      Android/app/src/main/java/com/cygnusa/hyperm/adapter/RedeemPointListAdapter.java

BIN
Android/.DS_Store


+ 15 - 0
Android/app/.gitignore

@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/local.properties
+/.idea
+/.idea/libraries
+.DS_Store
+/build
+/app/build
+/app/.idea
+/app/gradle
+/app/release
+/app/*.xml
+/captures
+/gradle
+/release

+ 90 - 0
Android/app/build.gradle

@@ -0,0 +1,90 @@
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 29
+
+    lintOptions {
+        checkReleaseBuilds false
+    }
+
+    defaultConfig {
+        applicationId "com.cygnusa.hyperm"
+        targetSdkVersion 29
+        minSdkVersion 21
+        versionCode 81
+        versionName "8.1"
+        multiDexEnabled true
+    }
+
+    repositories {
+        maven {
+            url 'http://dl.bintray.com/amulyakhare/maven'
+
+        }
+        maven {
+            url "https://github.com/omadahealth/omada-nexus/raw/master/release"
+        }
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
+        }
+    }
+    compileOptions {
+        sourceCompatibility = 1.8
+        targetCompatibility = 1.8
+    }
+    buildToolsVersion = '29.0.3'
+}
+dependencies {
+    implementation fileTree(include: ['*.jar'], dir: 'libs')
+    implementation 'com.google.firebase:firebase-messaging:20.2.4'
+    implementation 'androidx.appcompat:appcompat:1.2.0'
+    implementation 'com.google.firebase:firebase-core:17.5.0'
+    implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
+    implementation 'com.google.code.gson:gson:2.8.6'
+    implementation 'com.google.android.material:material:1.2.1'
+    implementation 'com.squareup.retrofit2:retrofit:2.6.2'
+    implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
+    implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'
+    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
+    implementation 'androidx.multidex:multidex:2.0.1'
+    implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
+    implementation 'androidx.cardview:cardview:1.0.0'
+    implementation 'com.github.bumptech.glide:glide:4.10.0'
+    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
+    annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
+    implementation 'com.github.siyamed:android-shape-imageview:0.9.3@aar'
+    implementation 'com.ogaclejapan.smarttablayout:library:2.0.0@aar'
+    implementation 'com.ogaclejapan.smarttablayout:utils-v13:1.7.0@aar'
+    implementation 'androidx.palette:palette:1.0.0'
+    implementation 'jp.wasabeef:recyclerview-animators:2.3.0'
+    implementation 'com.github.barteksc:android-pdf-viewer:3.0.0-beta.5'
+    implementation 'com.github.tylersuehr7:empty-state-recyclerview:1.0.4'
+    implementation "me.leolin:ShortcutBadger:1.1.22@aar"
+    implementation 'io.reactivex.rxjava2:rxjava:2.2.14'
+    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
+    implementation 'com.github.dmytrodanylyk.shadow-layout:library:1.0.3'
+    implementation 'com.budiyev.android:circular-progress-bar:1.1.9'
+    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
+    implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
+    implementation 'com.github.traex.rippleeffect:ripple:1.3.1-OG'
+    implementation 'uk.me.lewisdeane.ldialogs:ldialogs:1.2.0@aar'
+    implementation 'com.intuit.sdp:sdp-android:1.0.6'
+    implementation 'com.github.douglasjunior:android-simple-tooltip:0.2.2'
+    implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
+    implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.2'
+    implementation 'org.jsoup:jsoup:1.11.3'
+    implementation 'com.squareup.okhttp:okhttp:2.7.5'
+    implementation 'com.github.aakira:expandable-layout:1.6.0@aar'
+    implementation 'com.wdullaer:materialdatetimepicker:4.2.3'
+    implementation 'com.github.lzyzsd:circleprogress:1.2.1'
+    implementation 'com.annimon:stream:1.2.1'
+    implementation 'com.yanzhenjie.zbar:camera:1.0.0'
+    implementation 'com.yanzhenjie:permission:2.0.3'
+    implementation 'net.danlew:android.joda:2.10.6.1'
+}
+apply plugin: 'com.google.gms.google-services'

+ 39 - 0
Android/app/google-services.json

@@ -0,0 +1,39 @@
+{
+  "project_info": {
+    "project_number": "1019553768679",
+    "project_id": "cygnusa-product",
+    "storage_bucket": "cygnusa-product.appspot.com"
+  },
+  "client": [
+    {
+      "client_info": {
+        "mobilesdk_app_id": "1:1019553768679:android:3a88fbcf94857eb0c32e42",
+        "android_client_info": {
+          "package_name": "com.cygnusa.hyperm"
+        }
+      },
+      "oauth_client": [
+        {
+          "client_id": "1019553768679-fsq3u7d8hea6rmd802htacpc5ovnh0lm.apps.googleusercontent.com",
+          "client_type": 3
+        }
+      ],
+      "api_key": [
+        {
+          "current_key": "AIzaSyDxOR43ALf-s7oEx4-E9bXdk3byj1Vh0E4"
+        }
+      ],
+      "services": {
+        "appinvite_service": {
+          "other_platform_oauth_client": [
+            {
+              "client_id": "1019553768679-fsq3u7d8hea6rmd802htacpc5ovnh0lm.apps.googleusercontent.com",
+              "client_type": 3
+            }
+          ]
+        }
+      }
+    }
+  ],
+  "configuration_version": "1"
+}

+ 172 - 0
Android/app/gradlew

@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"

+ 84 - 0
Android/app/gradlew.bat

@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 1 - 0
Android/app/libs/PLACEHOLDER

@@ -0,0 +1 @@
+agora-rtc-sdk.jar

BIN
Android/app/libs/agora-rtc-sdk.jar


BIN
Android/app/libs/agora-rtm-sdk.jar


+ 543 - 0
Android/app/src/main/AndroidManifest.xml

@@ -0,0 +1,543 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    package="com.cygnusa.hyperm"
+    android:installLocation="internalOnly"
+    tools:ignore="LockedOrientationActivity">
+
+    <uses-permission android:name="android.permission.INTERNET" />
+
+    <uses-feature android:name="android.hardware.camera" />
+    <uses-feature android:name="android.hardware.camera.autofocus" />
+
+    <uses-permission android:name="android.permission.CAMERA" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.VIBRATE" />
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
+    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.BLUETOOTH" />
+
+    <application
+        android:name="com.cygnusa.hyperm.util.MainApplication"
+        android:hardwareAccelerated="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:largeHeap="true"
+        android:supportsRtl="true"
+        android:theme="@style/AppTheme"
+        tools:ignore="GoogleAppIndexingWarning">
+        <activity android:name="com.cygnusa.hyperm.EMICalculator" />
+        <activity
+            android:name="com.cygnusa.hyperm.training.activities.LiveActivity"
+            android:configChanges="keyboardHidden|orientation|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.ProductVideoViewActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="landscape"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.training.activities.ScheduleListActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.training.activities.ScheduleActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.training.activities.AddParticipantActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.ASMScheduleViewActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustResize" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.ProductFeedbackFormActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="landscape"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.ProductExploreDetailsActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="landscape"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.ProductWelcomeScreenActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="landscape"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.ProductHomeActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="landscape"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.SEHomeActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.HomeActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.screenpinview.AppLockActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.screenpinview.ForgotAppLockActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.OtpActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.screenpinview.ChangeAppLockActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.TermsandConditions"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.RedeemProductDetailsActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.AMHomeActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.SplashScreen"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <activity
+            android:name="com.cygnusa.hyperm.LoginActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.SetNewPasswordActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.ResetPasswordActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.ForgotPasswordActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.MainProfileActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.SignUpActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.NotificationActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.TopicListActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.MyWallet"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.RedeemPointsCategoryActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.RedeemProductListActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.BulletinActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.MyEarnedPoints"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.TargetSalesActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.LearningPathActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.BulletinDetails"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.ContentListActivity"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.PdfViewActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="unspecified"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.VideoViewActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="unspecified"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.AssessmentActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.MyTrainingModuleActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.ShowQrCodeClass"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.AcceptTrainingActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.DSEViewFeedbackActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.AttendanceScheduleActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustResize" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.CreateClassRoomActivityNew"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.AMAttendanceActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.ClassRoomDSETainingActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+
+        <activity
+            android:name="com.cygnusa.hyperm.ClassRoomTrainerTainingActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+
+        <activity
+            android:name="com.cygnusa.hyperm.ViewScheduleActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.ModifyClassRoomActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.ReviewActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.SurveyActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.ChangePasswordActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.SettingsActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.MyProfileActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.AudioViewActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.NotificationViewActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.IndroScreen"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.CropActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.FaqActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.AboutActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.MainActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="landscape"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.HyperMEnquiryForm"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="landscape"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+        <activity
+            android:name="com.cygnusa.hyperm.ProductExplorerActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="landscape"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.AMNotificationSummary"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <activity
+            android:name="com.cygnusa.hyperm.TrainerViewFeedbackActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppFullScreenTheme"
+            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
+
+        <receiver
+            android:name="com.cygnusa.hyperm.service.NetworkUpdateReceiver"
+            android:enabled="true"
+            android:exported="true">
+            <intent-filter>
+                <action
+                    android:name="android.net.conn.CONNECTIVITY_CHANGE"
+                    tools:ignore="BatteryLife" />
+            </intent-filter>
+        </receiver>
+        <receiver
+            android:name="com.cygnusa.hyperm.service.SwitchOnReceiver"
+            android:enabled="true"
+            android:exported="true">
+            <intent-filter>
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
+                <action android:name="android.intent.action.QUICKBOOT_POWERON" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </receiver>
+
+        <service
+            android:name="com.cygnusa.hyperm.pushnotification.FcmMessageService"
+            android:enabled="true"
+            android:exported="false"
+            android:stopWithTask="false">
+            <intent-filter>
+                <action android:name="com.google.firebase.MESSAGING_EVENT" />
+            </intent-filter>
+        </service>
+
+        <provider
+            android:name="androidx.core.content.FileProvider"
+            android:authorities="${applicationId}.provider"
+            android:exported="false"
+            android:grantUriPermissions="true"
+            tools:replace="android:authorities">
+            <meta-data
+                android:name="android.support.FILE_PROVIDER_PATHS"
+                android:resource="@xml/picker_provider_paths" />
+        </provider>
+    </application>
+
+</manifest>

BIN
Android/app/src/main/assets/Architex.ttf


BIN
Android/app/src/main/assets/Roboto-Light.ttf


BIN
Android/app/src/main/assets/roboto_medium.ttf


BIN
Android/app/src/main/assets/robotothin.ttf


+ 8 - 0
Android/app/src/main/gen/com/ttiglobal/suzuki/BuildConfig.java

@@ -0,0 +1,8 @@
+/*___Generated_by_IDEA___*/
+
+package com.cygnusa.hyperm;
+
+/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
+public final class BuildConfig {
+  public final static boolean DEBUG = Boolean.parseBoolean(null);
+}

+ 7 - 0
Android/app/src/main/gen/com/ttiglobal/suzuki/Manifest.java

@@ -0,0 +1,7 @@
+/*___Generated_by_IDEA___*/
+
+package com.cygnusa.hyperm;
+
+/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
+public final class Manifest {
+}

+ 7 - 0
Android/app/src/main/gen/com/ttiglobal/suzuki/R.java

@@ -0,0 +1,7 @@
+/*___Generated_by_IDEA___*/
+
+package com.cygnusa.hyperm;
+
+/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
+public final class R {
+}

+ 467 - 0
Android/app/src/main/java/com/cygnusa/hyperm/AMAttendanceActivity.java

@@ -0,0 +1,467 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.Typeface;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.core.widget.NestedScrollView;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.fragments.AMAttendanceMarkingFragment;
+import com.cygnusa.hyperm.fragments.TrainingScoreCommandFragment;
+import com.cygnusa.hyperm.fragments.TrainingSummaryFragment;
+import com.cygnusa.hyperm.pickimage.bean.PickResult;
+import com.cygnusa.hyperm.pickimage.listeners.IPickResult;
+import com.cygnusa.hyperm.qr_code.ScanCallback;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.SingleAttendance;
+
+import org.joda.time.LocalDate;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import java.io.File;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.RequestBody;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+import static com.cygnusa.hyperm.fragments.AMAttendanceMarkingFragment.aDialog;
+import static com.cygnusa.hyperm.fragments.AMAttendanceMarkingFragment.mPreviewView;
+import static com.cygnusa.hyperm.util.GlobalData.scheduledDataList;
+import static com.cygnusa.hyperm.util.GlobalData.singleDateOneList;
+
+public class AMAttendanceActivity extends AppCompatActivity implements IPickResult {
+    private TextView txtTrainingUID, txtTrainerName, txtSegment, txtTrainingName, txtTrainingStartDate, txtTrainingStartTime, txtTravelInformation,
+            txtTrainingSubmissionDays, txtTrainingDuration, txtTrainingEndDate, txtTrainingEndTime, txtTrainingVenue,
+            txtTrainingTotalPArticipant;
+    private ImageView imgAttendance;
+    String IMAGE_PATH = "";
+    private Button btnAttendance, btnScore, summary;
+    FragmentManager manager;
+    private LinearLayout llout_remaining;
+    private LinearLayout layoutDate;
+    private String id1;
+    private String id2;
+    List<String> eTime = new ArrayList<>();
+    List<String> sTime = new ArrayList<>();
+    ApiService restService;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_attendance_training_schedule);
+
+        initViews();
+
+        btnScore.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                FragmentTransaction transaction = manager.beginTransaction();
+                btnAttendance.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                btnScore.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                summary.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                transaction.replace(R.id.container, new TrainingScoreCommandFragment());
+                transaction.commit();
+            }
+        });
+
+        summary.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                FragmentTransaction transaction = manager.beginTransaction();
+                btnAttendance.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                summary.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                btnScore.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                transaction.replace(R.id.container, new TrainingSummaryFragment());
+                transaction.commit();
+            }
+        });
+
+        btnAttendance.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                FragmentTransaction transaction = manager.beginTransaction();
+                btnAttendance.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                btnScore.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                summary.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                transaction.replace(R.id.container, new AMAttendanceMarkingFragment());
+                transaction.commit();
+            }
+        });
+
+        FragmentTransaction transaction = manager.beginTransaction();
+        transaction.replace(R.id.container, new AMAttendanceMarkingFragment());
+        transaction.commit();
+    }
+
+    private void initViews() {
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+        layoutDate = findViewById(R.id.layoutDate);
+        restService = ((MainApplication) getApplication()).getClient();
+
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        txtTrainingName = findViewById(R.id.txtTrainingName);
+        txtTrainerName = findViewById(R.id.txtTrainerName);
+        txtTrainingUID = findViewById(R.id.txtTrainingUID);
+        txtSegment = findViewById(R.id.txtSegment);
+        txtTrainingStartDate = findViewById(R.id.txtTrainingStartDate);
+        txtTrainingStartTime = findViewById(R.id.txtTrainingStartTime);
+        txtTravelInformation = findViewById(R.id.txtTravelInformation);
+        txtTrainingSubmissionDays = findViewById(R.id.txtTrainingSubmissionDays);
+        txtTrainingDuration = findViewById(R.id.txtTrainingDuration);
+        txtTrainingEndDate = findViewById(R.id.txtTrainingEndDate);
+        txtTrainingEndTime = findViewById(R.id.txtTrainingEndTime);
+        txtTrainingVenue = findViewById(R.id.txtTrainingVenue);
+        txtTrainingTotalPArticipant = findViewById(R.id.txtTrainingTotalPArticipant);
+        btnScore = findViewById(R.id.score);
+        llout_remaining = findViewById(R.id.llout_remaining);
+        btnAttendance = findViewById(R.id.attendance);
+        summary = findViewById(R.id.summary);
+        llout_remaining.setVisibility(View.GONE);
+        TextView txtShowmore = findViewById(R.id.txtShowmore);
+        txtShowmore.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (txtShowmore.getText().toString().equalsIgnoreCase("Show More")) {
+                    txtShowmore.setText(getResources().getText(R.string.showless));
+                    llout_remaining.setVisibility(View.VISIBLE);
+                } else {
+                    txtShowmore.setText(getResources().getText(R.string.showmore));
+                    llout_remaining.setVisibility(View.GONE);
+                }
+            }
+        });
+        manager = getSupportFragmentManager();
+
+
+        NestedScrollView scrollView = (NestedScrollView) findViewById(R.id.scrollView);
+        scrollView.setFillViewport(true);
+
+        if (GlobalData.scheduledDataList != null && GlobalData.scheduledDataList.size() > 0) {
+            txtTrainingName.setText(GlobalData.scheduledDataList.get(0).getTitle());
+            txtTrainingUID.setText(scheduledDataList.get(0).getTraining_id());
+            txtTrainerName.setText(scheduledDataList.get(0).getOrganizerName());
+
+            txtSegment.setText(scheduledDataList.get(0).getSegmentName());
+
+            String endDate = GlobalData.scheduledDataList.get(0).getEndDate();
+            String startDate = GlobalData.scheduledDataList.get(0).getStartDate();
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startDateString = "", endDateString = "";
+            try {
+                startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+                endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            String endTime = GlobalData.scheduledDataList.get(0).getEndDate();
+            String startTime = GlobalData.scheduledDataList.get(0).getStartDate();
+
+            SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startTimeString = "", endTimeString = "";
+            Date date1, date2;
+            long difference = 0;
+            try {
+                date1 = timeFormat.parse(startTime);
+                date2 = timeFormat.parse(endTime);
+                startTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(startTime)));
+                endTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(endTime)));
+                difference = date1.getTime() - date2.getTime();
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            int days = (int) (difference / (1000 * 60 * 60 * 24));
+            int hours = (int) ((difference - (1000 * 60 * 60 * 24 * days)) / (1000 * 60 * 60));
+            int min = (int) (difference - (1000 * 60 * 60 * 24 * days) - (1000 * 60 * 60 * hours)) / (1000 * 60);
+
+            min = (hours < 0 ? -min : min);
+            Log.i("======= min", " :: " + min);
+
+            txtTrainingStartDate.setText(startDateString);
+            txtTrainingEndDate.setText(endDateString);
+            txtTrainingStartTime.setText(startTimeString);
+            txtTrainingEndTime.setText(endTimeString);
+            if (GlobalData.scheduledDataList.get(0).getScheduleName() != null && !GlobalData.scheduledDataList.get(0).getScheduleName().isEmpty())
+                txtTravelInformation.setText(GlobalData.scheduledDataList.get(0).getScheduleName());
+            else {
+                txtTravelInformation.setText("N/A");
+            }
+            txtTrainingSubmissionDays.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getTrainingDays()));
+            txtTrainingDuration.setText(min + " Minutes");
+            txtTrainingVenue.setText(GlobalData.scheduledDataList.get(0).getVenueAddress());
+            if (GlobalData.scheduledDataList.get(0).getParticipant() != null && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0) {
+                txtTrainingTotalPArticipant.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getParticipant().size()));
+            }
+        }
+
+        String s = GlobalData.scheduledDataList.get(0).getStartdate();
+        String e = GlobalData.scheduledDataList.get(0).getEnddate();
+
+        LocalDate start = LocalDate.parse(s);
+        LocalDate end = LocalDate.parse(e);
+        List<LocalDate> totalDates = new ArrayList<>();
+        while (!start.isAfter(end)) {
+            totalDates.add(start);
+
+            start = start.plusDays(1);
+        }
+
+        String startTime = GlobalData.scheduledDataList.get(0).getStarttime();
+        String endTime = GlobalData.scheduledDataList.get(0).getEndtime();
+
+        try {
+            JSONArray arrayFromTime = new JSONArray(startTime);
+            for (int i = 0; i < arrayFromTime.length(); i++) {
+                id1 = (String) arrayFromTime.get(i);
+                sTime.add(id1);
+            }
+            JSONArray arrayToTime = new JSONArray(endTime);
+            for (int i = 0; i < arrayToTime.length(); i++) {
+                id2 = (String) arrayToTime.get(i);
+                eTime.add(id2);
+            }
+        } catch (JSONException e1) {
+            sTime.add(startTime);
+            eTime.add(endTime);
+            e1.printStackTrace();
+        }
+
+        int trainingDays = Integer.parseInt(GlobalData.scheduledDataList.get(0).getTrainingDays());
+
+        for (int i = 0; i < trainingDays; i++) {
+            TextView txtDays = new TextView(this);
+            txtDays.setTextSize(15);
+            txtDays.setTextColor(Color.parseColor("#00344C"));
+            txtDays.setPadding(0, 0, 0, 0);
+            if (sTime.size() - 1 >= i && eTime.size() - 1 >= i)
+                txtDays.setText("Day " + (i + 1) + " : " + totalDates.get(i) + " " + sTime.get(i) + " - " + eTime.get(i));
+            txtDays.setTypeface(Typeface.DEFAULT_BOLD);
+            layoutDate.addView(txtDays);
+        }
+        imgAttendance = findViewById(R.id.imgAttendance);
+        if (scheduledDataList.get(0).getTrainingGroupImage() != null && !scheduledDataList.get(0).getTrainingGroupImage().equalsIgnoreCase("")) {
+
+
+            Glide.with(AMAttendanceActivity.this).load(Objects.requireNonNull(getApplicationContext())).load(scheduledDataList.get(0).getTrainingGroupImage())
+                    .thumbnail(Glide.with(AMAttendanceActivity.this).load(R.drawable.camera))
+                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                            .placeholder(R.drawable.camera)).into(imgAttendance);
+        }
+
+
+        imgAttendance.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+//                PickImageDialog.build(new PickSetup().setButtonOrientation(LinearLayout.HORIZONTAL)).setOnPickCancel(new IPickCancel() {
+//                    @Override
+//                    public void onCancelClick() {
+//
+//                    }
+//                }).show(AMAttendanceActivity.this);
+            }
+        });
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == RESULT_OK && requestCode == 2276) {
+            IMAGE_PATH = data.getStringExtra("IMAGE_PATH");
+            if (GlobalData.IMAGECLICKPOS == -1) {
+                Glide.with(this).load(new File(IMAGE_PATH))
+                        .thumbnail(Glide.with(this).load(R.drawable.gif_loader))
+                        .into(imgAttendance);
+                sendImageToServer(IMAGE_PATH);
+            } else {
+
+                setUploadPhoto(GlobalData.IMAGECLICKPOS, IMAGE_PATH);
+
+                AMAttendanceMarkingFragment.isUpdates();
+            }
+
+        } else if (resultCode == RESULT_CANCELED && requestCode == 2276) {
+            IMAGE_PATH = "";
+        }
+    }
+
+    private void sendImageToServer(String IMAGE_PATH) {
+        File file = new File(IMAGE_PATH);
+        RequestBody reqFile = RequestBody.create(MediaType.parse("image/*"), file);
+        MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getAbsolutePath(), reqFile);
+        RequestBody requestEmail =
+                RequestBody.create(
+                        MediaType.parse("multipart/form-data"), singleDateOneList.getScheduleId());
+        restService.postGroupCheckImage(requestEmail, body).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+                    if (response.body().getResponse().equalsIgnoreCase("Success")) {
+                        GlobalData.toast(AMAttendanceActivity.this, "Upload successfully");
+                    } else {
+                        GlobalData.toast(AMAttendanceActivity.this, response.body().getResponseText());
+                    }
+
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+
+            }
+        });
+    }
+
+    private void setUploadPhoto(int position, String reason) {
+
+        if (singleDateOneList.getSingleParticipantList().get(position).getSingleAttendance() != null)
+            singleDateOneList.getSingleParticipantList().get(position).getSingleAttendance().setImage(reason);
+        else {
+            SingleAttendance attendance = new SingleAttendance();
+            attendance.setIspresent("");
+            attendance.setImage(reason);
+            attendance.setManualAttendanceReason("");
+            attendance.setAbsenceReason("");
+            attendance.setDay("");
+        }
+
+    }
+
+    @Override
+    public void onPickResult(PickResult result) {
+        if (result.getError() == null) {
+            IMAGE_PATH = result.getPath();
+            if (IMAGE_PATH != null && !IMAGE_PATH.trim().isEmpty()) {
+                Intent intent = new Intent(AMAttendanceActivity.this, CropActivity.class);
+                CropActivity.mSourceUri = result.getUri();
+                startActivityForResult(intent, 2276);
+            } else {
+                imgAttendance.setImageBitmap(result.getBitmap());
+            }
+
+        } else {
+            GlobalData.showToast(this, result.getError().getMessage(), Toast.LENGTH_LONG).show();
+        }
+    }
+
+
+    public static ScanCallback resultCallback = new ScanCallback() {
+        @Override
+        public void onScanResult(String result, Context context) {
+            stopScan();
+            Log.e("ScanResult", result);
+            if (!result.isEmpty() && result.equalsIgnoreCase(GlobalData.QRCODEVALUE)) {
+                setPresentValue(GlobalData.SCANCLICKPOS, "1");
+                AMAttendanceMarkingFragment.isUpdates();
+            } else {
+                // GlobalData.toast();
+            }
+
+            if (aDialog != null)
+                aDialog.dismiss();
+
+        }
+
+    };
+
+    public static void setPresentValue(int position, String reason) {
+        if (singleDateOneList.getSingleParticipantList().get(position).getSingleAttendance() != null)
+            singleDateOneList.getSingleParticipantList().get(position).getSingleAttendance().setIspresent(reason);
+        else {
+            SingleAttendance attendance = new SingleAttendance();
+            attendance.setIspresent(reason);
+            attendance.setImage("");
+            attendance.setManualAttendanceReason("");
+            attendance.setAbsenceReason("");
+            attendance.setDay("");
+        }
+
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+    }
+
+    private static void stopScan() {
+        //mScanAnimator.cancel();
+        mPreviewView.stop();
+
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            onBackPressed();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+}

ファイルの差分が大きいため隠しています
+ 1368 - 0
Android/app/src/main/java/com/cygnusa/hyperm/AMHomeActivity.java


+ 463 - 0
Android/app/src/main/java/com/cygnusa/hyperm/AMNotificationSummary.java

@@ -0,0 +1,463 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.AlertDialog;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ImageButton;
+import android.widget.RadioButton;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.github.siyamed.shapeimageview.CircularImageView;
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.GetCancelOrRescheduleList;
+import com.cygnusa.hyperm.wrappers.NotificationSummary;
+import com.cygnusa.hyperm.wrappers.NotificationSummaryResponse;
+import com.cygnusa.hyperm.wrappers.Reasons;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class AMNotificationSummary extends AppCompatActivity {
+
+    Button btnModify;
+    private TextView txtDate, txtTime, txtLocation, txtDetails;
+    RadioButton radioCancel, radioReschdule;
+    private ApiService restService;
+    private RelativeLayout rloutReschedule, rloutCancel;
+    private List<Reasons> REASONS = new ArrayList<>();
+    private String[] reasonName = {"None"};
+    private String[] reasonId = {"None"};
+    private TextView txtReasonReschdule, txtReasonCancel;
+    private ImageButton imgReschedule, imgCancel;
+    private String reasonIdString = "";
+    private Button btnSubmit, btnCancel, btnList;
+    ParticipantListAdapter dateAdapter;
+
+    private TextView txtTrainingName, txtTrainingStartDate, txtTrainingStartTime, txtTrainingLevel, txtRegion,
+            txtTrainingSubmissionDays, txtTrainingEndDate, txtTrainingEndTime, txtTrainingVenue, txtTrainerName, txtTrainingDuration;
+    private Button accept, decline;
+
+    String scheduleId = "";
+    private TransparentProgressDialog progressDialog;
+    NotificationSummary notificationSummary;
+
+    ApiService apiService;
+
+    public static String btnStatus = "0";
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.amnotification);
+
+        restService = ((MainApplication) getApplication()).getClient();
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+
+        accept = findViewById(R.id.accept);
+        decline = findViewById(R.id.decline);
+        btnList = findViewById(R.id.btnList);
+
+        txtReasonCancel = findViewById(R.id.txtReasonCancel);
+        txtTrainingLevel = findViewById(R.id.txtTrainingLevel);
+        txtTrainingStartDate = findViewById(R.id.txtTrainingStartDate);
+        txtTrainingStartTime = findViewById(R.id.txtTrainingStartTime);
+        txtTrainingSubmissionDays = findViewById(R.id.txtTrainingSubmissionDays);
+        txtTrainingEndDate = findViewById(R.id.txtTrainingEndDate);
+        txtTrainingEndTime = findViewById(R.id.txtTrainingEndTime);
+        txtTrainingVenue = findViewById(R.id.txtTrainingVenue);
+        txtTrainingDuration = findViewById(R.id.txtTrainingDuration);
+        accept = findViewById(R.id.accept);
+        decline = findViewById(R.id.decline);
+        txtTrainingName = findViewById(R.id.txtTrainingName);
+        txtTrainerName = findViewById(R.id.txtTrainerName);
+        txtRegion = findViewById(R.id.txtRegion);
+
+        if (GlobalData.user.getData().getRole().equalsIgnoreCase("4") ||
+                GlobalData.user.getData().getRole().equalsIgnoreCase("6")) {
+            decline.setVisibility(View.GONE);
+            accept.setVisibility(View.GONE);
+        }
+
+        scheduleId = GlobalData.scheduledDataList.get(0).getScheduleId();
+
+
+        if (btnStatus.equalsIgnoreCase("0")) {
+            decline.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+
+                    if (txtReasonCancel.getText().toString().isEmpty()) {
+                        GlobalData.toast(AMNotificationSummary.this, "Choose Reason for decline");
+                    } else {
+//                    sendAcceptorDeclineStatus("2");
+                        btnStatus = "1";
+                        onBackPressed();
+                    }
+
+                }
+            });
+
+            accept.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+//                sendAcceptorDeclineStatus("1");
+                    btnStatus = "1";
+                    GlobalData.toast(AMNotificationSummary.this, "success");
+                    onBackPressed();
+                }
+            });
+
+        } else {
+            accept.setBackgroundColor(getResources().getColor(R.color.bg_grey0));
+            decline.setBackgroundColor(getResources().getColor(R.color.bg_grey0));
+        }
+
+
+//        txtReasonReschdule = findViewById(R.id.txtReasonReschdule);
+//        imgReschedule = findViewById(R.id.imgReschedule);
+        imgCancel = findViewById(R.id.imgCancel);
+
+
+        txtReasonCancel.setOnClickListener(view -> {
+            setCanceltitleSelction();
+        });
+
+        imgCancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                setCanceltitleSelction();
+            }
+        });
+
+       /* if (GlobalData.mSingleDataLists != null) {
+            txtDate.setText(GlobalData.mSingleDataLists.getScheduleName());
+
+
+            String endDate = GlobalData.mSingleDataLists.getEndDate();
+            String startDate = GlobalData.mSingleDataLists.getStartDate();
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startDateString = "", endDateString = "";
+            try {
+                startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+                endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+
+            txtTime.setText(startDateString + " To " + endDateString);
+            txtDetails.setText(GlobalData.mSingleDataLists.getScheduleName());
+            txtLocation.setText(GlobalData.mSingleDataLists.getVenueAddress());
+        }*/
+
+        getReasons();
+        getNotificationSummary();
+
+
+    }
+
+    public void SetNotification() {
+
+
+        txtTrainingName.setText(GlobalData.notificationSummary.getScheduleName());
+
+
+        String endDate = GlobalData.notificationSummary.getEndDate();
+        String startDate = GlobalData.notificationSummary.getStartDate();
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+        String startDateString = "", endDateString = "";
+        try {
+            startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+            endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        String endTime = GlobalData.notificationSummary.getEndtime();
+        String startTime = GlobalData.notificationSummary.getStarttime();
+
+        SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+        String startTimeString = "", endTimeString = "";
+        Date date1, date2;
+        long difference = 0;
+        try {
+            date1 = timeFormat.parse(startTime);
+            date2 = timeFormat.parse(endTime);
+            startTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(startTime)));
+            endTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(endTime)));
+            difference = date1.getTime() - date2.getTime();
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        int days = (int) (difference / (1000 * 60 * 60 * 24));
+        int hours = (int) ((difference - (1000 * 60 * 60 * 24 * days)) / (1000 * 60 * 60));
+        int min = (int) (difference - (1000 * 60 * 60 * 24 * days) - (1000 * 60 * 60 * hours)) / (1000 * 60);
+
+        min = (min < 0 ? -min : min);
+        Log.i("======= min", " :: " + min);
+
+        txtTrainingLevel.setText(GlobalData.notificationSummary.getTitle());
+        txtTrainerName.setText(GlobalData.notificationSummary.getOrganizerName());
+        txtTrainingStartDate.setText(startDateString);
+        txtTrainingEndDate.setText(endDateString);
+        txtTrainingStartTime.setText(startTimeString);
+        txtTrainingEndTime.setText(endTimeString);
+        txtRegion.setText(GlobalData.notificationSummary.getVenueAm());
+        txtTrainingDuration.setText(hours + " Hours");
+
+
+    }
+
+    private void sendAcceptorDeclineStatus(String status) {
+
+        progressDialog = new TransparentProgressDialog(AMNotificationSummary.this);
+        progressDialog.show();
+
+        apiService.sendAcceptOrDecline(scheduleId, GlobalData.user.getData().getEmp_code(), status).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                if (response.body() != null) {
+                    GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+            }
+        });
+    }
+
+    private void getNotificationSummary() {
+
+        progressDialog = new TransparentProgressDialog(AMNotificationSummary.this);
+        progressDialog.show();
+
+        apiService.getAMNotificationSummary(GlobalData.scheduledDataList.get(0).getScheduleId()).enqueue(new Callback<NotificationSummaryResponse>() {
+            @Override
+            public void onResponse(Call<NotificationSummaryResponse> call, Response<NotificationSummaryResponse> response) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                if (response.body() != null && response.body().getStatus() == 200) {
+
+                    notificationSummary = response.body().getData();
+                    SetNotification();
+
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<NotificationSummaryResponse> call, Throwable t) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+            }
+        });
+    }
+
+    private void getReasons() {
+        if (new UtilService().isNetworkAvailable(Objects.requireNonNull(AMNotificationSummary.this))) {
+            try {
+                restService.getCancelOrReschedule().enqueue(new Callback<GetCancelOrRescheduleList>() {
+                    @Override
+                    public void onResponse(Call<GetCancelOrRescheduleList> call, Response<GetCancelOrRescheduleList> response) {
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            if (response.body().getReasonsList() != null && response.body().getReasonsList().size() > 0) {
+                                REASONS = response.body().getReasonsList();
+                                reasonName = new String[REASONS.size()];
+                                reasonId = new String[REASONS.size()];
+                                for (int i = 0; i < response.body().getReasonsList().size(); i++) {
+                                    reasonName[i] = REASONS.get(i).getName();
+                                    reasonId[i] = REASONS.get(i).getId();
+                                }
+                            }
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<GetCancelOrRescheduleList> call, Throwable t) {
+                    }
+                });
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private void setCanceltitleSelction() {
+        int selection = 0;
+        if (!txtReasonCancel.getText().toString().isEmpty()) {
+            selection = Arrays.asList(reasonName).indexOf(txtReasonCancel.getText().toString().trim());
+        }
+        new AlertDialog.Builder(AMNotificationSummary.this).setTitle("Reason for decline")
+                .setSingleChoiceItems(reasonName, selection, null)
+                .setNegativeButton("Cancel", null)
+                .setPositiveButton("Ok", (dialog, whichButton) -> {
+                    dialog.dismiss();
+                    int selectedPosition = ((AlertDialog) dialog).getListView().getCheckedItemPosition();
+                    txtReasonCancel.setText(reasonName[selectedPosition]);
+                    reasonIdString = reasonId[selectedPosition];
+                })
+                .show();
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            onBackPressed();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private class ParticipantListAdapter extends RecyclerView.Adapter<AMNotificationSummary.ParticipantViewHolder> {
+
+        @NonNull
+        @Override
+        public ParticipantViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+            View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.participant_view_holder, parent, false);
+            return new ParticipantViewHolder(v);
+        }
+
+        @Override
+        public void onBindViewHolder(@NonNull ParticipantViewHolder holder, int position) {
+            if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getName() == null || GlobalData.scheduledDataList.get(0).getParticipant().get(position).getName().isEmpty()) {
+                holder.txtName.setText("No Name");
+            } else {
+                holder.txtName.setText(GlobalData.scheduledDataList.get(0).getParticipant().get(position).getName());
+            }
+            if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getProfilePhoto() != null || !GlobalData.scheduledDataList.get(0).getParticipant().get(position).getProfilePhoto().isEmpty()) {
+                Glide.with(AMNotificationSummary.this).load(GlobalData.scheduledDataList.get(0).getParticipant().get(position).getProfilePhoto())
+                        .thumbnail(Glide.with(AMNotificationSummary.this).load(R.drawable.gif_loader))
+                        .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                                .placeholder(R.drawable.placeholder)).into(holder.img);
+            } else {
+                Glide.with(AMNotificationSummary.this).load(R.drawable.placeholder)
+                        .thumbnail(Glide.with(AMNotificationSummary.this).load(R.drawable.gif_loader))
+                        .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                                .placeholder(R.drawable.placeholder)).into(holder.img);
+            }
+        }
+
+
+        @Override
+        public int getItemCount() {
+            return GlobalData.scheduledDataList.get(0).getParticipant().size();
+        }
+
+    }
+
+    private static class ParticipantViewHolder extends RecyclerView.ViewHolder {
+
+        TextView txtName;
+        CircularImageView img;
+
+        public ParticipantViewHolder(@NonNull View itemView) {
+            super(itemView);
+
+            txtName = itemView.findViewById(R.id.txt_Name);
+            img = itemView.findViewById(R.id.imgPic);
+        }
+
+    }
+}

+ 301 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ASMScheduleViewActivity.java

@@ -0,0 +1,301 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.Typeface;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.recyclerview.widget.LinearLayoutManager;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.adapter.ASMParticipantListAdapter;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.ViewScheduleListResponse;
+import com.tylersuehr.esr.EmptyStateRecyclerView;
+
+import net.danlew.android.joda.JodaTimeAndroid;
+
+import org.joda.time.LocalDate;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class ASMScheduleViewActivity extends AppCompatActivity {
+
+    private TextView txtTrainingUID, txtTrainingName, txtTrainerName, txtBusinessSegment, txtTotalParticipant;
+    private TextView txtSubmissionDays, txtTrainingStartDate, txtTrainingEndDate, txtTrainingVenue;
+    private LinearLayout layoutDate, layoutTrainingDetails, layoutTraining;
+    private TransparentProgressDialog progressDialog;
+    private EmptyStateRecyclerView participantList;
+    LinearLayoutManager linearLayoutManager;
+    ASMParticipantListAdapter adapter;
+    ApiService apiService;
+    Boolean clickLike = true;
+    private ImageView imgDown;
+    private String businessSegment;
+    private static String layoutVisible = "0";
+
+    private String id1;
+    private String id2;
+    List<String> eTime = new ArrayList<>();
+    private TextView txtNoDataFound;
+    List<String> sTime = new ArrayList<>();
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        JodaTimeAndroid.init(this);
+        setContentView(R.layout.asm_schedule_view);
+        initView();
+    }
+
+    private void initView() {
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        apiService = ((MainApplication) getApplication()).getClient();
+
+
+        layoutTrainingDetails = findViewById(R.id.layoutTrainingDetails);
+        layoutTraining = findViewById(R.id.layoutTraining);
+        txtNoDataFound = findViewById(R.id.txtNoDataFound);
+        layoutDate = findViewById(R.id.layoutDate);
+
+        participantList = findViewById(R.id.participantList);
+        linearLayoutManager = new LinearLayoutManager(this);
+        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
+        participantList.setLayoutManager(linearLayoutManager);
+
+
+        txtTrainingUID = findViewById(R.id.txtTrainingUID);
+        txtTrainingName = findViewById(R.id.txtTrainingName);
+        txtTrainerName = findViewById(R.id.txtTrainerName);
+        txtBusinessSegment = findViewById(R.id.txtBusinessSegment);
+        txtTotalParticipant = findViewById(R.id.txtTotalParticipant);
+        txtSubmissionDays = findViewById(R.id.txtSubmissionDays);
+        txtTrainingStartDate = findViewById(R.id.txtTrainingStartDate);
+        txtTrainingEndDate = findViewById(R.id.txtTrainingEndDate);
+        txtTrainingVenue = findViewById(R.id.txtTrainingVenue);
+
+        imgDown = findViewById(R.id.imgDown);
+
+
+        if (layoutVisible.equalsIgnoreCase("0")) {
+            layoutTrainingDetails.setVisibility(View.GONE);
+        } else {
+            layoutTrainingDetails.setVisibility(View.VISIBLE);
+
+        }
+
+        layoutTraining.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (clickLike) {
+                    clickLike = false;
+                    layoutTrainingDetails.setVisibility(View.GONE);
+                    imgDown.setImageResource(R.mipmap.down_arrow_3);
+                } else {
+                    clickLike = true;
+                    layoutTrainingDetails.setVisibility(View.VISIBLE);
+                    imgDown.setImageResource(R.mipmap.up_arrow_3);
+                }
+            }
+        });
+
+        imgDown.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (clickLike) {
+                    clickLike = false;
+                    layoutTrainingDetails.setVisibility(View.GONE);
+                    imgDown.setImageResource(R.mipmap.down_arrow_3);
+                } else {
+                    clickLike = true;
+                    layoutTrainingDetails.setVisibility(View.VISIBLE);
+                    imgDown.setImageResource(R.mipmap.up_arrow_3);
+                }
+            }
+        });
+
+        getScheduledList();
+
+
+        String startDate = GlobalData.scheduledDataList.get(0).getStartDate();
+        String endDate = GlobalData.scheduledDataList.get(0).getEndDate();
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+        String startDateString = "", endDateString = "";
+        try {
+            startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+            endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+
+        String s = GlobalData.scheduledDataList.get(0).getStartdate();
+        String e = GlobalData.scheduledDataList.get(0).getEnddate();
+
+        LocalDate start = LocalDate.parse(s);
+        LocalDate end = LocalDate.parse(e);
+        List<LocalDate> totalDates = new ArrayList<>();
+        while (!start.isAfter(end)) {
+            totalDates.add(start);
+
+            start = start.plusDays(1);
+        }
+
+        String startTime = GlobalData.scheduledDataList.get(0).getStarttime();
+        String endTime = GlobalData.scheduledDataList.get(0).getEndtime();
+
+        try {
+            JSONArray arrayFromTime = new JSONArray(startTime);
+            for (int i = 0; i < arrayFromTime.length(); i++) {
+                id1 = (String) arrayFromTime.get(i);
+                sTime.add(id1);
+            }
+            JSONArray arrayToTime = new JSONArray(endTime);
+            for (int i = 0; i < arrayToTime.length(); i++) {
+                id2 = (String) arrayToTime.get(i);
+                eTime.add(id2);
+            }
+        } catch (JSONException e1) {
+            sTime.add(startTime);
+            eTime.add(endTime);
+            e1.printStackTrace();
+        }
+
+        int trainingDays = Integer.parseInt(GlobalData.scheduledDataList.get(0).getTrainingDays());
+
+        for (int i = 0; i < trainingDays; i++) {
+            TextView txtDays = new TextView(this);
+            txtDays.setTextSize(15);
+            txtDays.setTextColor(Color.parseColor("#00344C"));
+            txtDays.setPadding(150, 0, 0, 0);
+            if (sTime.size() - 1 >= i && eTime.size() - 1 >= i)
+                txtDays.setText("Day " + (i + 1) + " : " + totalDates.get(i) + " " + sTime.get(i) + " - " + eTime.get(i));
+            txtDays.setTypeface(Typeface.DEFAULT_BOLD);
+            layoutDate.addView(txtDays);
+        }
+
+        if (GlobalData.scheduledDataList.get(0).getBusinessSegment().equalsIgnoreCase("1")) {
+            businessSegment = "Scooter";
+        } else if (GlobalData.scheduledDataList.get(0).getBusinessSegment().equalsIgnoreCase("2")) {
+            businessSegment = "Motorcycle";
+        } else if (GlobalData.scheduledDataList.get(0).getBusinessSegment().equalsIgnoreCase("3")) {
+            businessSegment = "Scooter & Motorcycle";
+        }
+
+        txtTrainingName.setText(GlobalData.scheduledDataList.get(0).getTitle());
+        txtTrainerName.setText(GlobalData.scheduledDataList.get(0).getOrganizerName());
+        txtBusinessSegment.setText(businessSegment);
+        if (GlobalData.scheduledDataList.get(0).getParticipant() != null && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0)
+            txtTotalParticipant.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getParticipant().size()));
+        txtSubmissionDays.setText(GlobalData.scheduledDataList.get(0).getTrainingDays() + " Days");
+        txtTrainingStartDate.setText(startDateString);
+        txtTrainingEndDate.setText(endDateString);
+        txtTrainingVenue.setText(GlobalData.scheduledDataList.get(0).getVenueAddress());
+        txtTrainingUID.setText(GlobalData.scheduledDataList.get(0).getTraining_id());
+//        txtTrainingUID.setText(GlobalData.scheduledDataList.get(0).getTrainerId());
+    }
+
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            onBackPressed();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void getScheduledList() {
+        String scheduleID = Objects.requireNonNull(getIntent().getExtras()).getString("SCHEDULE_ID", "");
+        apiService.getScheduledList(scheduleID).enqueue(new Callback<ViewScheduleListResponse>() {
+            @Override
+            public void onResponse(Call<ViewScheduleListResponse> call, Response<ViewScheduleListResponse> response) {
+                if (response.body() != null) {
+                    if (response.body().getData() != null) {
+                        GlobalData.scheduledDataList = new ArrayList<>();
+                        GlobalData.scheduledDataList = response.body().getData();
+                        if (adapter == null) {
+                            GlobalData.scheduledDataList = response.body().getData();
+                            if (response.body().getData().get(0).getParticipant() != null && response.body().getData().get(0).getParticipant().size() > 0) {
+                                participantList.setVisibility(View.VISIBLE);
+                                txtNoDataFound.setVisibility(View.GONE);
+                                adapter = new ASMParticipantListAdapter(ASMScheduleViewActivity.this, GlobalData.scheduledDataList, apiService);
+                                participantList.setAdapter(adapter);
+                            } else {
+                                participantList.setVisibility(View.GONE);
+                                txtNoDataFound.setVisibility(View.VISIBLE);
+                            }
+                        } else {
+                            GlobalData.scheduledDataList.addAll(response.body().getData());
+                            adapter.notifyDataSetChanged();
+                        }
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<ViewScheduleListResponse> call, Throwable t) {
+                Log.e("rr", t.getMessage());
+            }
+        });
+    }
+}

ファイルの差分が大きいため隠しています
+ 83 - 0
Android/app/src/main/java/com/cygnusa/hyperm/AboutActivity.java


+ 318 - 0
Android/app/src/main/java/com/cygnusa/hyperm/AcceptTrainingActivity.java

@@ -0,0 +1,318 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.content.res.ColorStateList;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.Typeface;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.MenuItem;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.core.content.ContextCompat;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.SingleDataList;
+
+import org.joda.time.LocalDate;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class AcceptTrainingActivity extends AppCompatActivity {
+
+    private TextView txtTrainingUID, txtTrainingName, txtTrainerName, txtBusinessSegment, txtTotalParticipant;
+    private TextView txtSubmissionDays, txtTrainingStartDate, txtTrainingEndDate, txtTrainingVenue;
+    private Button btnAcknowledge;
+    private LinearLayout layoutDate;
+    private TransparentProgressDialog progressDialog;
+    ApiService apiService;
+    String scheduleId = "";
+    private static String btnStatus;
+    private String businessSegment;
+
+    private String id1;
+    private String id2;
+    List<String> eTime = new ArrayList<>();
+    List<String> sTime = new ArrayList<>();
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        //JodaTimeAndroid.init(this);
+        setContentView(R.layout.fragment_accept_training);
+        initView();
+    }
+
+    private void initView() {
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        apiService = ((MainApplication) getApplication()).getClient();
+
+        txtTrainingUID = findViewById(R.id.txtTrainingUID);
+        txtTrainingName = findViewById(R.id.txtTrainingName);
+        txtTrainerName = findViewById(R.id.txtTrainerName);
+        txtBusinessSegment = findViewById(R.id.txtBusinessSegment);
+        txtTotalParticipant = findViewById(R.id.txtTotalParticipant);
+        txtSubmissionDays = findViewById(R.id.txtSubmissionDays);
+        txtTrainingStartDate = findViewById(R.id.txtTrainingStartDate);
+        txtTrainingEndDate = findViewById(R.id.txtTrainingEndDate);
+        txtTrainingVenue = findViewById(R.id.txtTrainingVenue);
+
+        btnAcknowledge = findViewById(R.id.btnAcknowledge);
+        layoutDate = findViewById(R.id.layoutDate);
+
+        if (GlobalData.scheduledDataList != null && GlobalData.scheduledDataList.size() > 0) {
+            String userID = GlobalData.scheduledDataList.get(0).getUserid();
+
+            if (GlobalData.scheduledDataList.get(0).getParticipant() != null && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0)
+                for (int i = 0; i < GlobalData.scheduledDataList.get(0).getParticipant().size(); i++) {
+                    if (GlobalData.scheduledDataList.get(0).getParticipant().get(i).getUserid().equalsIgnoreCase(userID)) {
+                        btnStatus = GlobalData.scheduledDataList.get(0).getParticipant().get(i).getStatus();
+                    }
+                }
+
+            String startDate = GlobalData.scheduledDataList.get(0).getStartDate();
+            String endDate = GlobalData.scheduledDataList.get(0).getEndDate();
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startDateString = "", endDateString = "";
+            try {
+                startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+                endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+
+            String s = GlobalData.scheduledDataList.get(0).getStartdate();
+            String e = GlobalData.scheduledDataList.get(0).getEnddate();
+
+            LocalDate start = LocalDate.parse(s);
+            LocalDate end = LocalDate.parse(e);
+            List<LocalDate> totalDates = new ArrayList<>();
+            while (!start.isAfter(end)) {
+                totalDates.add(start);
+
+                start = start.plusDays(1);
+            }
+
+            String startTime = GlobalData.scheduledDataList.get(0).getStarttime();
+            String endTime = GlobalData.scheduledDataList.get(0).getEndtime();
+
+            try {
+                JSONArray arrayFromTime = new JSONArray(startTime);
+                for (int i = 0; i < arrayFromTime.length(); i++) {
+                    id1 = (String) arrayFromTime.get(i);
+                    sTime.add(id1);
+                }
+                JSONArray arrayToTime = new JSONArray(endTime);
+                for (int i = 0; i < arrayToTime.length(); i++) {
+                    id2 = (String) arrayToTime.get(i);
+                    eTime.add(id2);
+                }
+            } catch (JSONException e1) {
+                sTime.add(startTime);
+                eTime.add(endTime);
+                e1.printStackTrace();
+            }
+
+            int trainingDays = Integer.parseInt(GlobalData.scheduledDataList.get(0).getTrainingDays());
+
+            for (int i = 0; i < trainingDays; i++) {
+                TextView txtDays = new TextView(this);
+                txtDays.setTextSize(15);
+                txtDays.setTextColor(Color.parseColor("#00344C"));
+                txtDays.setPadding(150, 0, 0, 0);
+                if (sTime.size() - 1 >= i && eTime.size() - 1 >= i)
+                    txtDays.setText("Day " + (i + 1) + " : " + totalDates.get(i) + " " + sTime.get(i) + " - " + eTime.get(i));
+                txtDays.setTypeface(Typeface.DEFAULT_BOLD);
+                layoutDate.addView(txtDays);
+            }
+            if (GlobalData.scheduledDataList.get(0).getBusinessSegment().equalsIgnoreCase("1")) {
+                businessSegment = "Scooter";
+            } else if (GlobalData.scheduledDataList.get(0).getBusinessSegment().equalsIgnoreCase("2")) {
+                businessSegment = "Motorcycle";
+            } else if (GlobalData.scheduledDataList.get(0).getBusinessSegment().equalsIgnoreCase("3")) {
+                businessSegment = "Scooter & Motorcycle";
+            }
+            txtTrainingName.setText(GlobalData.scheduledDataList.get(0).getTitle());
+            txtTrainerName.setText(GlobalData.scheduledDataList.get(0).getOrganizerName());
+            txtBusinessSegment.setText(businessSegment);
+            if (GlobalData.scheduledDataList.get(0).getParticipant() != null && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0)
+                txtTotalParticipant.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getParticipant().size()));
+            txtSubmissionDays.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getTrainingDays() + " Days"));
+            txtTrainingStartDate.setText(startDateString);
+            txtTrainingEndDate.setText(endDateString);
+            txtTrainingVenue.setText(GlobalData.scheduledDataList.get(0).getVenueAddress());
+            txtTrainingUID.setText(GlobalData.scheduledDataList.get(0).getTraining_id());
+        }
+
+        btnAcknowledge.setOnClickListener(v -> {
+            if (btnStatus.equalsIgnoreCase("0")) {
+                GlobalData.scheduledDataList.get(0).getParticipant().get(0).setAcknowledge_by("2");
+                sendAcknowledge("1");
+            }
+        });
+
+        if (btnStatus.equalsIgnoreCase("1")) {
+            if (GlobalData.scheduledDataList.get(0).getParticipant().get(0).getAcknowledge_by() != null)
+                if (GlobalData.scheduledDataList.get(0).getParticipant().get(0).getAcknowledge_by().equalsIgnoreCase("1")) {
+                    btnAcknowledge.setText("Acknowledged by AM");
+                } else if (GlobalData.scheduledDataList.get(0).getParticipant().get(0).getAcknowledge_by().equalsIgnoreCase("2")) {
+                    btnAcknowledge.setText("Acknowledged by DSE");
+                }
+            ColorStateList colorStateList = ContextCompat.getColorStateList(this, R.color.btn_green);
+            btnAcknowledge.setBackgroundTintList(colorStateList);
+        } else if (btnStatus.equalsIgnoreCase("2")) {
+            btnAcknowledge.setText("Declined");
+            ColorStateList colorStateList = ContextCompat.getColorStateList(this, R.color.btn_red);
+            btnAcknowledge.setBackgroundTintList(colorStateList);
+        }
+
+
+    }
+
+    private void sendAcknowledge(String status) {
+
+        progressDialog = new TransparentProgressDialog(AcceptTrainingActivity.this);
+        progressDialog.show();
+
+
+        HashMap<String, String> map = new HashMap<>();
+        map.put("schedule_id", GlobalData.scheduledDataList.get(0).getScheduleId());
+        map.put("userid", GlobalData.scheduledDataList.get(0).getUserid());
+        map.put("status", status);
+        map.put("acknowledge_by", "2");
+        map.put("decline_reason", "");
+        map.put("decline_reason_desc", "");
+
+        apiService.sendAcknowledge(map).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                if (response.body() != null) {
+                    GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    onBackPressed();
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+            }
+        });
+    }
+
+    private void setAllDataDSELogin(SingleDataList singleDataList) {
+
+        if (singleDataList != null) {
+            txtTrainingName.setText(singleDataList.getTitle());
+
+            scheduleId = singleDataList.getScheduleId();
+
+            String endDate = singleDataList.getEndDate();
+            String startDate = singleDataList.getStartDate();
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startDateString = "", endDateString = "";
+            try {
+                startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+                endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            String endTime = singleDataList.getEndDate();
+            String startTime = singleDataList.getStartDate();
+
+            SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startTimeString = "", endTimeString = "";
+            Date date1, date2;
+            long difference = 0;
+            try {
+                date1 = timeFormat.parse(startTime);
+                date2 = timeFormat.parse(endTime);
+                startTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(startTime)));
+                endTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(endTime)));
+                difference = date1.getTime() - date2.getTime();
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            int days = (int) (difference / (1000 * 60 * 60 * 24));
+            int hours = (int) ((difference - (1000 * 60 * 60 * 24 * days)) / (1000 * 60 * 60));
+            int min = (int) (difference - (1000 * 60 * 60 * 24 * days) - (1000 * 60 * 60 * hours)) / (1000 * 60);
+
+            min = (min < 0 ? -min : min);
+            Log.i("======= min", " :: " + min);
+
+        }
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            onBackPressed();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+}

+ 767 - 0
Android/app/src/main/java/com/cygnusa/hyperm/AssessmentActivity.java

@@ -0,0 +1,767 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.database.Cursor;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.Handler;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.animation.AlphaAnimation;
+import android.view.animation.Animation;
+import android.widget.Button;
+import android.widget.ImageButton;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentStatePagerAdapter;
+import androidx.viewpager.widget.ViewPager;
+
+import com.google.firebase.analytics.FirebaseAnalytics;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.ogaclejapan.smarttablayout.SmartTabLayout;
+import com.cygnusa.hyperm.fancyshowcase.FancyShowCaseView;
+import com.cygnusa.hyperm.fancyshowcase.FocusShape;
+import com.cygnusa.hyperm.fragments.QuestionFragment;
+import com.cygnusa.hyperm.roundcornerprogressbar.RoundCornerProgressBar;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.CustomViewPager;
+import com.cygnusa.hyperm.util.DepthPageTransformerNew;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.AnswerResponse;
+import com.cygnusa.hyperm.wrappers.AssessmentAnswer;
+import com.cygnusa.hyperm.wrappers.AssessmentList;
+import com.cygnusa.hyperm.wrappers.AssessmentQuestion;
+import com.cygnusa.hyperm.wrappers.AssessmentQuestionResponse;
+import com.cygnusa.hyperm.wrappers.AssessmentScore;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.HitCountModel;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.concurrent.TimeUnit;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class AssessmentActivity extends AppCompatActivity {
+    public static AssessmentList ASSESSMENT = new AssessmentList();
+    public static String TRAINING_ID = "";
+    public static String CATEGORY_ID = "";
+    public static boolean isOffline = false;
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    TextView title;
+    ArrayList<AssessmentQuestion> ASSESSMENT_QUESTIONS = new ArrayList<>();
+    CustomViewPager viewPager;
+    SmartTabLayout indicatorTab;
+    ImageButton previous, next;
+    RoundCornerProgressBar linearTimerView;
+    TextView time;
+    Button submitButton;
+    String START_TIME = "";
+    String END_TIME = "";
+    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    AlertDialog.Builder alertDialogBuilder;
+    AlertDialog alertDialog;
+    Bundle bundle;
+    Handler handler = new Handler();
+    private boolean isBlinking = false;
+    String fromTime, toTime, finalTime;
+    Calendar c;
+    SimpleDateFormat df;
+    Runnable runnable = new Runnable() {
+        @Override
+        public void run() {
+            if (linearTimerView.getProgress() == 0) {
+                onSubmitAnswer(true);
+                time.setText("TIME LEFT");
+            } else {
+                linearTimerView.setProgress(linearTimerView.getProgress() - 1);
+                long millis = (long) (linearTimerView.getProgress() * 1000);
+                String formattedTime = String.format("%02d:%02d",
+                        TimeUnit.MILLISECONDS.toMinutes(millis) % TimeUnit.HOURS.toMinutes(1),
+                        TimeUnit.MILLISECONDS.toSeconds(millis) % TimeUnit.MINUTES.toSeconds(1));
+                time.setText(formattedTime);
+                updateProgressColor();
+                handler.postDelayed(runnable, 1000);
+            }
+        }
+    };
+    private FirebaseAnalytics firebaseAnalytics;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_assessment);
+        setupWindowAnimations();
+        restService = ((MainApplication) getApplication()).getClient();
+        viewPager = findViewById(R.id.viewPager);
+        title = findViewById(R.id.title);
+        indicatorTab = findViewById(R.id.indicatorTab);
+        submitButton = findViewById(R.id.submitButton);
+        submitButton.setVisibility(View.GONE);
+        linearTimerView = findViewById(R.id.linearTimerView);
+
+        previous = findViewById(R.id.previous);
+        next = findViewById(R.id.next);
+        time = findViewById(R.id.time);
+
+        time.setVisibility(View.VISIBLE);
+        linearTimerView.setVisibility(View.GONE);
+
+        firebaseAnalytics = FirebaseAnalytics.getInstance(this);
+        FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(true);
+
+        bundle = new Bundle();
+        bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "1");
+        bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "Assessment Activity");
+        firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        title.setText(ASSESSMENT.getAssessmentname() + "");
+        title.setSelected(true);
+
+        if (ASSESSMENT.getAssessmenttimetype().trim().equalsIgnoreCase("0")) {
+            time.setVisibility(View.INVISIBLE);
+            linearTimerView.setVisibility(View.INVISIBLE);
+        }
+
+
+        viewPager.post(new Runnable() {
+            @Override
+            public void run() {
+                getAssesmentQuistion();
+            }
+        });
+
+        previous.setEnabled(false);
+        next.setEnabled(false);
+
+        viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            @Override
+            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+
+            }
+
+            @Override
+            public void onPageSelected(int position) {
+                if (position == 0) {
+                    previous.setEnabled(false);
+                    next.setEnabled(true);
+                    if (ASSESSMENT_QUESTIONS.size() == 1) {
+                        submitButton.setVisibility(View.VISIBLE);
+                    }
+                } else if (position == ASSESSMENT_QUESTIONS.size() - 1) {
+                    previous.setEnabled(true);
+                    next.setEnabled(false);
+                    submitButton.setVisibility(View.VISIBLE);
+                } else {
+                    previous.setEnabled(true);
+                    next.setEnabled(true);
+                }
+            }
+
+            @Override
+            public void onPageScrollStateChanged(int state) {
+
+            }
+        });
+
+        previous.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (viewPager.getCurrentItem() > 0) {
+                    viewPager.setCurrentItem(viewPager.getCurrentItem() - 1, true);
+                }
+            }
+        });
+
+        next.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (viewPager.getCurrentItem() < ASSESSMENT_QUESTIONS.size() - 1) {
+                    viewPager.setCurrentItem(viewPager.getCurrentItem() + 1, true);
+                }
+            }
+        });
+
+        submitButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getToTime();
+                onSubmitAnswer(false);
+            }
+        });
+
+        findViewById(R.id.helpIcon).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showHelpScreen();
+            }
+        });
+
+        getCurrentTime();
+
+
+    }
+
+
+    private void getCurrentTime() {
+        c = Calendar.getInstance();
+        System.out.println("fromTime " + c.getTime());
+
+        df = new SimpleDateFormat("HH:mm:ss");
+        fromTime = df.format(c.getTime());
+        Log.e("fromTime", fromTime);
+    }
+
+    private void sendHitCountToServer() {
+        restService.sendAllHitCount(buildConfigData()).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+
+                } else {
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+                if (t.getMessage() != null) {
+                    Log.e("responeHit", t.getMessage());
+                }
+            }
+        });
+    }
+
+    private HitCountModel buildConfigData() {
+        HitCountModel hitCountModel = new HitCountModel();
+        hitCountModel.setPage("Assessment");
+        hitCountModel.setViewtime("0");
+        return hitCountModel;
+    }
+
+
+    private void onSubmitAnswer(boolean isAutoSubmit) {
+        if (ASSESSMENT_QUESTIONS != null && ASSESSMENT_QUESTIONS.size() > 0) {
+            ArrayList<AssessmentAnswer> answers = new ArrayList<>();
+            END_TIME = format.format(new Date());
+            for (AssessmentQuestion question : ASSESSMENT_QUESTIONS) {
+                AssessmentAnswer answer = new AssessmentAnswer();
+                answer.setAqid(question.getAqid());
+                answer.setQid(question.getQid());
+                if (isAutoSubmit) {
+                    answer.setOptions(question.getAnswer());
+                } else {
+                    if (question.getIs_mandatory().trim().equalsIgnoreCase("1")) {
+                        if (!question.isAnswered()) {
+                            viewPager.setCurrentItem(ASSESSMENT_QUESTIONS.indexOf(question));
+                            GlobalData.showToast(AssessmentActivity.this, "Please answer all mandatory questions", Toast.LENGTH_SHORT).show();
+                            return;
+                        } else {
+                            answer.setOptions(question.getAnswer());
+                        }
+                    } else {
+                        answer.setOptions(question.getAnswer());
+                    }
+                }
+                answers.add(answer);
+            }
+
+            Gson gson = new Gson();
+            JsonElement jsonElement = gson.toJsonTree(
+                    answers, new TypeToken<ArrayList<AssessmentAnswer>>() {
+                    }.getType());
+
+            HashMap<String, String> map = new HashMap<>();
+            map.put("ans_arr", jsonElement.toString());
+            map.put("startdatetime", START_TIME);
+            map.put("enddatetime", END_TIME);
+
+            if (new UtilService().isNetworkAvailable(AssessmentActivity.this)) {
+
+                progressDialog = new TransparentProgressDialog(AssessmentActivity.this);
+                progressDialog.show();
+
+                restService.postAssessment(ASSESSMENT.getAssessmentid(), map).enqueue(new Callback<AnswerResponse>() {
+                    @Override
+                    public void onResponse(Call<AnswerResponse> call, Response<AnswerResponse> response) {
+
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            try {
+                                int d = (int) Math.round(Double.parseDouble(response.body().getData().getPercentage_score()));
+                                showPopup(response.body().getData(), String.valueOf(d), response.body().getAssessment_msg());
+                                GlobalData.showToast(getBaseContext(), response.body().getAssessment_msg(), Toast.LENGTH_LONG).show();
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            try {
+                                handler.removeCallbacksAndMessages(null);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                            finish();
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                try {
+                                    handler.removeCallbacksAndMessages(null);
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
+                                finish();
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<AnswerResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+            } else {
+                Cursor cursor = GlobalData.sdb.rawQuery("select * from assessment_question where category_id='"
+                        + CATEGORY_ID + "' and training_id='" + TRAINING_ID + "'", null);
+
+                if (isOffline || cursor.getCount() > 0) {
+                    GlobalData.sdb.execSQL("delete from assessment_answer where assessment_id='"
+                            + ASSESSMENT.getAssessmentid()
+                            + "' and category_id='" + CATEGORY_ID + "' and training_id='" + TRAINING_ID + "'");
+                    JsonElement jsonElement1 = gson.toJsonTree(
+                            map, new TypeToken<HashMap<String, String>>() {
+                            }.getType());
+                    ContentValues values = new ContentValues();
+                    values.put("assessment_answer", jsonElement1.toString());
+                    values.put("training_id", TRAINING_ID);
+                    values.put("category_id", CATEGORY_ID);
+                    values.put("assessment_id", ASSESSMENT.getAssessmentid());
+                    GlobalData.sdb.insert("assessment_answer", null, values);
+                    GlobalData.showToast(getBaseContext(), "Assessment saved on local, will sync to server when online", Toast.LENGTH_LONG).show();
+                    try {
+                        handler.removeCallbacksAndMessages(null);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    finish();
+                    AssessmentActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                            R.anim.animation_f_leave);
+                } else {
+                    GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+                }
+            }
+
+        }
+    }
+
+    private void showPopup(final AssessmentScore assessmentScore, String s, String msg) {
+        View view = LayoutInflater.from(AssessmentActivity.this).inflate(
+                R.layout.assessment_popup, null);
+        view.findViewById(R.id.continueButton).setOnClickListener(
+                new View.OnClickListener() {
+
+                    @Override
+                    public void onClick(View v) {
+                        alertDialog.dismiss();
+                        try {
+                            handler.removeCallbacksAndMessages(null);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        finish();
+                        AssessmentActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                                R.anim.animation_f_leave);
+                    }
+                });
+
+        view.findViewById(R.id.reviewButton).setOnClickListener(
+                new View.OnClickListener() {
+
+                    @Override
+                    public void onClick(View v) {
+                        alertDialog.dismiss();
+                        ReviewActivity.ASSESSMENT = ASSESSMENT;
+                        ReviewActivity.ASSESSMENT_SCORE = assessmentScore;
+                        startActivity(new Intent(AssessmentActivity.this, ReviewActivity.class));
+                        try {
+                            handler.removeCallbacksAndMessages(null);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        finish();
+                    }
+                });
+
+        TextView linkView = view.findViewById(R.id.score);
+        TextView assesmentName = view.findViewById(R.id.assesmentName);
+        if (Integer.parseInt(s) < 80) {
+            linkView.setTextColor(getColor(R.color.red));
+        } else {
+            linkView.setTextColor(getColor(R.color.green));
+        }
+        linkView.setText(s);
+
+        TextView assesmentMessage = view.findViewById(R.id.assesmentMessage);
+        assesmentMessage.setText(msg);
+
+        assesmentName.setText("For " + ASSESSMENT.getAssessmentname());
+        alertDialogBuilder = new AlertDialog.Builder(AssessmentActivity.this);
+        alertDialogBuilder.setCancelable(false);
+        alertDialogBuilder.setView(view);
+        alertDialog = alertDialogBuilder.create();
+        alertDialog.show();
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            confirmClose();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void confirmClose() {
+        new AlertDialog.Builder(AssessmentActivity.this)
+                .setMessage("Are you sure you want to exit the assessment?")
+                .setPositiveButton("Yes",
+                        new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(
+                                    DialogInterface dialog,
+                                    int which) {
+                                try {
+                                    handler.removeCallbacksAndMessages(null);
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
+
+                                getToTime();
+
+                                finish();
+                                AssessmentActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                                        R.anim.animation_f_leave);
+                            }
+                        }).setNegativeButton("No", null).show();
+    }
+
+    private void getToTime() {
+
+        c = Calendar.getInstance();
+        System.out.println("toTime " + c.getTime());
+
+        df = new SimpleDateFormat("HH:mm:ss");
+        toTime = df.format(c.getTime());
+        Log.e("toTime", toTime);
+
+        finalTime = UtilService.getTimeInterval(this, df, fromTime, toTime);
+
+        if (GlobalData.user.getData().getRole().equalsIgnoreCase("9"))
+            sendHitCountToServer();
+
+    }
+
+    @Override
+    public void onBackPressed() {
+
+        confirmClose();
+    }
+
+    @SuppressLint("StaticFieldLeak")
+    private void getAssesmentQuistion() {
+        progressDialog = new TransparentProgressDialog(AssessmentActivity.this);
+        progressDialog.show();
+
+        if (new UtilService().isNetworkAvailable(AssessmentActivity.this)) {
+            restService.getAssesmentQuistion(ASSESSMENT.getAssessmentid()).enqueue(new Callback<AssessmentQuestionResponse>() {
+                @Override
+                public void onResponse(Call<AssessmentQuestionResponse> call, Response<AssessmentQuestionResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    ASSESSMENT_QUESTIONS = new ArrayList<>();
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        ASSESSMENT_QUESTIONS = response.body().getData();
+                        bundle = new Bundle();
+                        bundle.putString("Assessment_questions", "Get All Assessment Questions");
+                        firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
+
+                        Cursor cursor = GlobalData.sdb.rawQuery("select * from assessment_question where assessment_id='"
+                                + ASSESSMENT.getAssessmentid()
+                                + "' and category_id='" + CATEGORY_ID + "' and training_id='" + TRAINING_ID + "'", null);
+                        if (cursor.getCount() > 0) {
+                            GlobalData.sdb.execSQL("delete from assessment_question where assessment_id='"
+                                    + ASSESSMENT.getAssessmentid()
+                                    + "' and category_id='" + CATEGORY_ID + "' and training_id='" + TRAINING_ID + "'");
+                            Gson gson = new Gson();
+                            JsonElement jsonElement = gson.toJsonTree(
+                                    ASSESSMENT_QUESTIONS, new TypeToken<ArrayList<AssessmentQuestion>>() {
+                                    }.getType());
+                            ContentValues values = new ContentValues();
+                            values.put("assessment_question", jsonElement.toString());
+                            values.put("training_id", TRAINING_ID);
+                            values.put("category_id", CATEGORY_ID);
+                            values.put("assessment_id", ASSESSMENT.getAssessmentid());
+                            GlobalData.sdb.insert("assessment_question", null, values);
+                        }
+
+                        setAssesmentQuistion();
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        try {
+                            handler.removeCallbacksAndMessages(null);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            try {
+                                handler.removeCallbacksAndMessages(null);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                            finish();
+                        }
+                    }
+                }
+
+                @Override
+                public void onFailure(Call<AssessmentQuestionResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            new AsyncTask<Void, Void, String>() {
+                @Override
+                protected String doInBackground(Void... params) {
+                    try {
+                        Cursor cursor = GlobalData.sdb.rawQuery("select * from assessment_question where category_id='"
+                                + CATEGORY_ID + "' and training_id='" + TRAINING_ID + "' and assessment_id='"
+                                + ASSESSMENT.getAssessmentid() + "'", null);
+                        ASSESSMENT_QUESTIONS = new ArrayList<>();
+                        if (cursor.getCount() != 0) {
+                            cursor.moveToFirst();
+                            Gson gson = new Gson();
+                            ASSESSMENT_QUESTIONS = gson.fromJson(
+                                    cursor.getString(cursor.getColumnIndex("assessment_question")),
+                                    new TypeToken<ArrayList<AssessmentQuestion>>() {
+                                    }.getType());
+                        }
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return null;
+                }
+
+                @Override
+                protected void onPostExecute(String s) {
+                    super.onPostExecute(s);
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    if (ASSESSMENT_QUESTIONS.size() == 0) {
+                        GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+                    }
+                    setAssesmentQuistion();
+                }
+            }.execute();
+        }
+    }
+
+    private void setAssesmentQuistion() {
+        viewPager.setPageTransformer(true, new DepthPageTransformerNew());
+        if (ASSESSMENT_QUESTIONS != null && ASSESSMENT_QUESTIONS.size() > 0) {
+            viewPager.setAdapter(new AssesmentQuistionAdapter(getSupportFragmentManager()));
+            indicatorTab.setViewPager(viewPager);
+            viewPager.setPagingEnabled(true);
+        } else {
+            GlobalData.showToast(AssessmentActivity.this, "No Assessment Found", Toast.LENGTH_LONG).show();
+           // onBackPressed();
+            finish();
+        }
+        if (ASSESSMENT_QUESTIONS != null && ASSESSMENT_QUESTIONS.size() > 0) {
+            previous.setEnabled(false);
+            next.setEnabled(true);
+            if (ASSESSMENT_QUESTIONS.size() == 1) {
+                submitButton.setVisibility(View.VISIBLE);
+            }
+        }
+        if (ASSESSMENT_QUESTIONS != null && ASSESSMENT_QUESTIONS.size() > 0) {
+            viewPager.setOffscreenPageLimit(ASSESSMENT_QUESTIONS.size());
+        }
+
+        if (ASSESSMENT.getAssessmenttimetype().trim().equalsIgnoreCase("1")) {
+            if (!ASSESSMENT.getAssessmenttime().trim().isEmpty()) {
+                int seconds = Integer.parseInt(ASSESSMENT.getAssessmenttime().trim()) * 60;
+//                seconds = 60;
+                linearTimerView.setMax(seconds);
+                linearTimerView.setProgress(seconds);
+                handler.post(runnable);
+            }
+        }
+
+        START_TIME = format.format(new Date());
+
+        new Handler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                if (getPreferences(MODE_PRIVATE).getBoolean("AssessmentActivity", true)) {
+                    showHelpScreen();
+                    getPreferences(MODE_PRIVATE).edit().putBoolean("AssessmentActivity", false).apply();
+                }
+            }
+        }, 1000);
+    }
+
+    private void manageBlinkEffect() {
+        if (isBlinking) {
+            return;
+        }
+
+        isBlinking = true;
+        Animation anim = new AlphaAnimation(0.0f, 1.0f);
+        anim.setDuration(1000);
+        anim.setStartOffset(20);
+        anim.setRepeatMode(Animation.REVERSE);
+        anim.setRepeatCount(Animation.INFINITE);
+        time.startAnimation(anim);
+    }
+
+    private void updateProgressColor() {
+        float progress = linearTimerView.getProgress() / linearTimerView.getMax() * 100;
+        if (progress < 60) {
+            time.setTextColor(Color.parseColor("#F44336"));
+            linearTimerView.setProgressColor(Color.parseColor("#F44336"));
+            manageBlinkEffect();
+        } else {
+            linearTimerView.setProgressColor(Color.parseColor("#00344c"));
+            time.setTextColor(Color.parseColor("#00344c"));
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (GlobalData.canLogout) {
+            try {
+                handler.removeCallbacksAndMessages(null);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            finish();
+        }
+    }
+
+    private void showHelpScreen() {
+        bundle = new Bundle();
+        bundle.putString("Assessment_help_screen", "Assessment Help Screen");
+        firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
+
+        try {
+            new FancyShowCaseView.Builder(this)
+                    .focusOn((View) indicatorTab.getParent())
+                    .title("Tap on the arrows to navigate next or previous questions")
+                    .titleSize(22, 1)
+                    .closeOnTouch(true)
+                    .fitSystemWindows(false)
+                    .focusShape(FocusShape.CIRCLE)
+                    .backgroundColor(Color.parseColor("#99000000"))
+                    .build()
+                    .show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public class AssesmentQuistionAdapter extends FragmentStatePagerAdapter {
+
+        private AssesmentQuistionAdapter(FragmentManager fm) {
+            super(fm);
+        }
+
+        @Override
+        public Fragment getItem(int position) {
+            QuestionFragment fragment = new QuestionFragment();
+            fragment.setTrainingId(TRAINING_ID);
+            fragment.setAssessmentQuestion(ASSESSMENT_QUESTIONS.get(position));
+            fragment.setQuestionNo(String.valueOf((position + 1)));
+            return fragment;
+        }
+
+        @Override
+        public int getCount() {
+            return ASSESSMENT_QUESTIONS.size();
+        }
+
+
+        @Override
+        public CharSequence getPageTitle(int position) {
+            return String.valueOf((position + 1));
+        }
+    }
+}

+ 575 - 0
Android/app/src/main/java/com/cygnusa/hyperm/AttendanceScheduleActivity.java

@@ -0,0 +1,575 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.Typeface;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+import android.os.Bundle;
+import android.provider.MediaStore;
+import android.util.Base64;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.core.widget.NestedScrollView;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.fragments.TrainingAttendanceMarkingFragment;
+import com.cygnusa.hyperm.fragments.TrainingScoreCommandFragment;
+import com.cygnusa.hyperm.fragments.TrainingSummaryFragment;
+import com.cygnusa.hyperm.qr_code.ScanCallback;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.SingleAttendance;
+
+import org.joda.time.LocalDate;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.RequestBody;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+import static com.cygnusa.hyperm.fragments.TrainingAttendanceMarkingFragment.aDialog;
+import static com.cygnusa.hyperm.fragments.TrainingAttendanceMarkingFragment.mPreviewView;
+import static com.cygnusa.hyperm.fragments.TrainingAttendanceMarkingFragment.mScanAnimator;
+import static com.cygnusa.hyperm.util.GlobalData.scheduledDataList;
+import static com.cygnusa.hyperm.util.GlobalData.singleDateOneList;
+
+public class AttendanceScheduleActivity extends AppCompatActivity {
+    private TextView txtTrainingUID, txtTrainerName, txtSegment, txtTrainingName, txtTrainingStartDate, txtTrainingStartTime, txtTravelInformation,
+            txtTrainingSubmissionDays, txtTrainingDuration, txtTrainingEndDate, txtTrainingEndTime, txtTrainingVenue,
+            txtTrainingTotalPArticipant;
+    private ImageView imgAttendance;
+    String IMAGE_PATH = "";
+    private LinearLayout layoutDate;
+    private Button btnAttendance, btnScore, summary;
+    FragmentManager manager;
+    private LinearLayout llout_remaining;
+    ApiService restService;
+    private String id1;
+    private String id2;
+    List<String> eTime = new ArrayList<>();
+    List<String> sTime = new ArrayList<>();
+    private static final int CAMERA_REQUEST = 1888;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_attendance_training_schedule);
+
+        initViews();
+
+        btnScore.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                FragmentTransaction transaction = manager.beginTransaction();
+                btnAttendance.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                btnScore.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                summary.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                transaction.replace(R.id.container, new TrainingScoreCommandFragment());
+                transaction.commit();
+            }
+        });
+
+        summary.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                FragmentTransaction transaction = manager.beginTransaction();
+                btnAttendance.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                summary.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                btnScore.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                transaction.replace(R.id.container, new TrainingSummaryFragment());
+                transaction.commit();
+            }
+        });
+
+        btnAttendance.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                FragmentTransaction transaction = manager.beginTransaction();
+                btnAttendance.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                btnScore.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                summary.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                transaction.replace(R.id.container, new TrainingAttendanceMarkingFragment());
+                transaction.commit();
+            }
+        });
+
+        FragmentTransaction transaction = manager.beginTransaction();
+        transaction.replace(R.id.container, new TrainingAttendanceMarkingFragment());
+        transaction.commit();
+    }
+
+    private void initViews() {
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+        restService = ((MainApplication) getApplication()).getClient();
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        txtTrainingName = findViewById(R.id.txtTrainingName);
+        txtTrainerName = findViewById(R.id.txtTrainerName);
+        txtTrainingUID = findViewById(R.id.txtTrainingUID);
+        txtSegment = findViewById(R.id.txtSegment);
+        layoutDate = findViewById(R.id.layoutDate);
+        txtTrainingStartDate = findViewById(R.id.txtTrainingStartDate);
+        txtTrainingStartTime = findViewById(R.id.txtTrainingStartTime);
+        txtTravelInformation = findViewById(R.id.txtTravelInformation);
+        txtTrainingSubmissionDays = findViewById(R.id.txtTrainingSubmissionDays);
+        txtTrainingDuration = findViewById(R.id.txtTrainingDuration);
+        txtTrainingEndDate = findViewById(R.id.txtTrainingEndDate);
+        txtTrainingEndTime = findViewById(R.id.txtTrainingEndTime);
+        txtTrainingVenue = findViewById(R.id.txtTrainingVenue);
+        txtTrainingTotalPArticipant = findViewById(R.id.txtTrainingTotalPArticipant);
+        btnScore = findViewById(R.id.score);
+        llout_remaining = findViewById(R.id.llout_remaining);
+        btnAttendance = findViewById(R.id.attendance);
+        summary = findViewById(R.id.summary);
+        llout_remaining.setVisibility(View.GONE);
+        TextView txtShowmore = findViewById(R.id.txtShowmore);
+        txtShowmore.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (txtShowmore.getText().toString().equalsIgnoreCase("Show More")) {
+                    txtShowmore.setText(getResources().getText(R.string.showless));
+                    llout_remaining.setVisibility(View.VISIBLE);
+                } else {
+                    txtShowmore.setText(getResources().getText(R.string.showmore));
+                    llout_remaining.setVisibility(View.GONE);
+                }
+            }
+        });
+        manager = getSupportFragmentManager();
+
+
+        NestedScrollView scrollView = (NestedScrollView) findViewById(R.id.scrollView);
+        scrollView.setFillViewport(true);
+
+        if (GlobalData.scheduledDataList != null && GlobalData.scheduledDataList.size() > 0) {
+            txtTrainingName.setText(GlobalData.scheduledDataList.get(0).getTitle());
+            txtTrainingUID.setText(scheduledDataList.get(0).getTraining_id());
+            txtTrainerName.setText(scheduledDataList.get(0).getOrganizerName());
+
+            txtSegment.setText(scheduledDataList.get(0).getSegmentName());
+
+            String endDate = GlobalData.scheduledDataList.get(0).getEndDate();
+            String startDate = GlobalData.scheduledDataList.get(0).getStartDate();
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startDateString = "", endDateString = "";
+            try {
+                startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+                endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            String endTime = GlobalData.scheduledDataList.get(0).getEndDate();
+            String startTime = GlobalData.scheduledDataList.get(0).getStartDate();
+
+            SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startTimeString = "", endTimeString = "";
+            Date date1, date2;
+            long difference = 0;
+            try {
+                date1 = timeFormat.parse(startTime);
+                date2 = timeFormat.parse(endTime);
+                startTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(startTime)));
+                endTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(endTime)));
+                difference = date1.getTime() - date2.getTime();
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            int days = (int) (difference / (1000 * 60 * 60 * 24));
+            int hours = (int) ((difference - (1000 * 60 * 60 * 24 * days)) / (1000 * 60 * 60));
+            int min = (int) (difference - (1000 * 60 * 60 * 24 * days) - (1000 * 60 * 60 * hours)) / (1000 * 60);
+
+            min = (hours < 0 ? -min : min);
+            Log.i("======= min", " :: " + min);
+
+            txtTrainingStartDate.setText(startDateString);
+            txtTrainingEndDate.setText(endDateString);
+            txtTrainingStartTime.setText(startTimeString);
+            txtTrainingEndTime.setText(endTimeString);
+            if (GlobalData.scheduledDataList.get(0).getScheduleName() != null && !GlobalData.scheduledDataList.get(0).getScheduleName().isEmpty())
+                txtTravelInformation.setText(GlobalData.scheduledDataList.get(0).getScheduleName());
+            else {
+                txtTravelInformation.setText("N/A");
+            }
+            txtTrainingSubmissionDays.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getTrainingDays()));
+            txtTrainingDuration.setText(min + " Minutes");
+            txtTrainingVenue.setText(GlobalData.scheduledDataList.get(0).getVenueAddress());
+            if (GlobalData.scheduledDataList.get(0).getParticipant() != null && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0) {
+                txtTrainingTotalPArticipant.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getParticipant().size()));
+            }
+        }
+
+        String s = GlobalData.scheduledDataList.get(0).getStartdate();
+        String e = GlobalData.scheduledDataList.get(0).getEnddate();
+
+        LocalDate start = LocalDate.parse(s);
+        LocalDate end = LocalDate.parse(e);
+        List<LocalDate> totalDates = new ArrayList<>();
+        while (!start.isAfter(end)) {
+            totalDates.add(start);
+
+            start = start.plusDays(1);
+        }
+
+        String startTime = GlobalData.scheduledDataList.get(0).getStarttime();
+        String endTime = GlobalData.scheduledDataList.get(0).getEndtime();
+
+        try {
+            JSONArray arrayFromTime = new JSONArray(startTime);
+            for (int i = 0; i < arrayFromTime.length(); i++) {
+                id1 = (String) arrayFromTime.get(i);
+                sTime.add(id1);
+            }
+            JSONArray arrayToTime = new JSONArray(endTime);
+            for (int i = 0; i < arrayToTime.length(); i++) {
+                id2 = (String) arrayToTime.get(i);
+                eTime.add(id2);
+            }
+        } catch (JSONException e1) {
+            sTime.add(startTime);
+            eTime.add(endTime);
+            e1.printStackTrace();
+        }
+
+        int trainingDays = Integer.parseInt(GlobalData.scheduledDataList.get(0).getTrainingDays());
+
+        for (int i = 0; i < trainingDays; i++) {
+            TextView txtDays = new TextView(this);
+            txtDays.setTextSize(15);
+            txtDays.setTextColor(Color.parseColor("#00344C"));
+            txtDays.setPadding(0, 0, 0, 0);
+            if (sTime.size() - 1 >= i && eTime.size() - 1 >= i)
+                txtDays.setText("Day " + (i + 1) + " : " + totalDates.get(i) + " " + sTime.get(i) + " - " + eTime.get(i));
+            txtDays.setTypeface(Typeface.DEFAULT_BOLD);
+            layoutDate.addView(txtDays);
+        }
+
+        imgAttendance = findViewById(R.id.imgAttendance);
+
+        if (scheduledDataList.get(0).getTrainingGroupImage() != null && !scheduledDataList.get(0).getTrainingGroupImage().equalsIgnoreCase("")) {
+
+
+            Glide.with(AttendanceScheduleActivity.this).load(Objects.requireNonNull(getApplicationContext())).load(scheduledDataList.get(0).getTrainingGroupImage())
+                    .thumbnail(Glide.with(AttendanceScheduleActivity.this).load(R.drawable.camera))
+                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                            .placeholder(R.drawable.camera)).into(imgAttendance);
+
+        }
+
+        imgAttendance.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
+                startActivityForResult(intent, CAMERA_REQUEST);
+            }
+        });
+
+    }
+
+
+    public Uri getImageUri(Context inContext, Bitmap inImage) {
+        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+        inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
+        String path = MediaStore.Images.Media.insertImage(inContext.getContentResolver(), inImage, "Title", null);
+        return Uri.parse(path);
+    }
+
+    public String getRealPathFromURI(Uri uri) {
+        String path = "";
+        if (getContentResolver() != null) {
+            Cursor cursor = getContentResolver().query(uri, null, null, null, null);
+            if (cursor != null) {
+                cursor.moveToFirst();
+                int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
+                path = cursor.getString(idx);
+                cursor.close();
+            }
+        }
+        return path;
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+
+        Bitmap photo;
+        if (resultCode == Activity.RESULT_OK) {
+            photo = (Bitmap) data.getExtras().get("data");
+
+            Uri tempUri = getImageUri(getApplicationContext(), photo);
+            // CALL THIS METHOD TO GET THE ACTUAL PATH
+            IMAGE_PATH = getRealPathFromURI(tempUri);
+            if (GlobalData.IMAGECLICKPOS == -1) {
+                imgAttendance.setImageBitmap(photo);
+                sendImageToServer(IMAGE_PATH);
+            } else {
+                setUploadPhoto(GlobalData.IMAGECLICKPOS, IMAGE_PATH);
+                try {
+                    setBitmapPhoto(GlobalData.IMAGECLICKPOS, getEnodeString(photo));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                TrainingAttendanceMarkingFragment.isUpdates();
+            }
+
+        }
+
+
+//        if (resultCode == RESULT_OK && requestCode == 2276) {
+//            IMAGE_PATH = data.getStringExtra("IMAGE_PATH");
+//            if (GlobalData.IMAGECLICKPOS == -1) {
+//                Glide.with(this).load(new File(IMAGE_PATH))
+//                        .thumbnail(Glide.with(this).load(R.drawable.gif_loader))
+//                        .into(imgAttendance);
+//
+//                sendImageToServer(IMAGE_PATH);
+//            } else {
+//
+//                setUploadPhoto(GlobalData.IMAGECLICKPOS, IMAGE_PATH);
+//
+//                Bitmap bitmap = null;
+//                try {
+//                    File f = new File(IMAGE_PATH);
+//                    BitmapFactory.Options options = new BitmapFactory.Options();
+//                    options.inPreferredConfig = Bitmap.Config.ARGB_8888;
+//                    bitmap = BitmapFactory.decodeStream(new FileInputStream(f), null, options);
+//
+//                    getEnodeString(bitmap);
+//
+//                    setBitmapPhoto(GlobalData.IMAGECLICKPOS, getEnodeString(bitmap));
+//                } catch (Exception e) {
+//                    e.printStackTrace();
+//                }
+//
+//
+//                TrainingAttendanceMarkingFragment.isUpdates();
+//            }
+//
+//        } else if (resultCode == RESULT_CANCELED && requestCode == 2276) {
+//            IMAGE_PATH = "";
+//        }
+    }
+
+    private String getEnodeString(Bitmap bitmapImage) {
+
+        String encodedDigitalSign = "";
+        if (bitmapImage != null) {
+            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+            bitmapImage.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
+            byte[] byteArray = byteArrayOutputStream.toByteArray();
+            encodedDigitalSign = Base64.encodeToString(byteArray, Base64.DEFAULT);
+        }
+        return "data:image/jpeg;base64," + encodedDigitalSign;
+    }
+
+    private void sendImageToServer(String IMAGE_PATH) {
+        File file = new File(IMAGE_PATH);
+        RequestBody reqFile = RequestBody.create(MediaType.parse("image/*"), file);
+        MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getAbsolutePath(), reqFile);
+        RequestBody requestEmail =
+                RequestBody.create(
+                        MediaType.parse("multipart/form-data"), singleDateOneList.getScheduleId());
+        restService.postGroupCheckImage(requestEmail, body).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+                    if (response.body().getResponse().equalsIgnoreCase("Success")) {
+                        GlobalData.toast(AttendanceScheduleActivity.this, "Upload successfully");
+                    } else {
+                        GlobalData.toast(AttendanceScheduleActivity.this, response.body().getResponseText());
+                    }
+
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+
+            }
+        });
+    }
+
+    private void setUploadPhoto(int position, String reason) {
+        if (singleDateOneList.getSingleParticipantList().get(position).getSingleAttendance() != null)
+            singleDateOneList.getSingleParticipantList().get(position).getSingleAttendance().setImage(reason);
+        else {
+            SingleAttendance attendance = new SingleAttendance();
+            attendance.setIspresent("");
+            attendance.setImage(reason);
+            attendance.setManualAttendanceReason("");
+            attendance.setAbsenceReason("");
+            attendance.setDay("");
+            singleDateOneList.getSingleParticipantList().get(position).setSingleAttendance(attendance);
+        }
+
+    }
+
+
+    private void setBitmapPhoto(int position, String reason) {
+
+        if (singleDateOneList.getSingleParticipantList().get(position).getSingleAttendance() != null)
+            singleDateOneList.getSingleParticipantList().get(position).getSingleAttendance().setBitmapImage(reason);
+        else {
+            SingleAttendance attendance = new SingleAttendance();
+            attendance.setIspresent("");
+            attendance.setImage("");
+            attendance.setManualAttendanceReason("");
+            attendance.setAbsenceReason("");
+            attendance.setDay("");
+            singleDateOneList.getSingleParticipantList().get(position).setSingleAttendance(attendance);
+        }
+
+    }
+
+//    @Override
+//    public void onPickResult(PickResult result) {
+//        if (result.getError() == null) {
+//            IMAGE_PATH = result.getPath();
+//            if (IMAGE_PATH != null && !IMAGE_PATH.trim().isEmpty()) {
+//                Intent intent = new Intent(AttendanceScheduleActivity.this, CropActivity.class);
+//                CropActivity.mSourceUri = result.getUri();
+//                startActivityForResult(intent, 2276);
+//            } else {
+//                imgAttendance.setImageBitmap(result.getBitmap());
+//            }
+//        } else if (result.getPath() != null) {
+//            IMAGE_PATH = result.getPath();
+//            if (IMAGE_PATH != null && !IMAGE_PATH.trim().isEmpty()) {
+//                Intent intent = new Intent(AttendanceScheduleActivity.this, CropActivity.class);
+//                CropActivity.mSourceUri = result.getUri();
+//                startActivityForResult(intent, 2276);
+//            } else {
+//                imgAttendance.setImageBitmap(result.getBitmap());
+//            }
+//        } else {
+//            GlobalData.showToast(this, result.getError().getMessage(), Toast.LENGTH_LONG).show();
+//        }
+//    }
+
+
+    public static ScanCallback resultCallback = new ScanCallback() {
+        @Override
+        public void onScanResult(String result, Context context) {
+            stopScan();
+            Log.e("ScanResult", result);
+            if (!result.isEmpty() && result.equalsIgnoreCase(GlobalData.QRCODEVALUE)) {
+                setPresentValue(GlobalData.SCANCLICKPOS, "1");
+                TrainingAttendanceMarkingFragment.isUpdates();
+            } else {
+                GlobalData.toast(context, "Invalid QR Code");
+            }
+
+            if (TrainingAttendanceMarkingFragment.aDialog != null)
+                aDialog.dismiss();
+
+        }
+
+    };
+
+    public static void setPresentValue(int position, String reason) {
+        if (singleDateOneList.getSingleParticipantList().get(position).getSingleAttendance() != null)
+            singleDateOneList.getSingleParticipantList().get(position).getSingleAttendance().setIspresent(reason);
+        else {
+            SingleAttendance attendance = new SingleAttendance();
+            attendance.setIspresent(reason);
+            attendance.setImage("");
+            attendance.setManualAttendanceReason("");
+            attendance.setAbsenceReason("");
+            attendance.setDay("");
+            singleDateOneList.getSingleParticipantList().get(position).setSingleAttendance(attendance);
+        }
+
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+    }
+
+    private static void stopScan() {
+        mScanAnimator.cancel();
+        mPreviewView.stop();
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        startActivity(new Intent(AttendanceScheduleActivity.this, ClassRoomTrainerTainingActivity.class));
+        finish();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+
+            startActivity(new Intent(AttendanceScheduleActivity.this, ClassRoomTrainerTainingActivity.class));
+            finish();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+}

+ 395 - 0
Android/app/src/main/java/com/cygnusa/hyperm/AudioViewActivity.java

@@ -0,0 +1,395 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.media.MediaPlayer;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.StrictMode;
+import com.google.android.material.appbar.AppBarLayout;
+import com.google.android.material.appbar.CollapsingToolbarLayout;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.AppCompatSeekBar;
+import androidx.appcompat.widget.Toolbar;
+import android.text.method.ScrollingMovementMethod;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ImageButton;
+import android.widget.ProgressBar;
+import android.widget.SeekBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.MyCallback;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.MyContent;
+import com.cygnusa.hyperm.wrappers.MyTopic;
+
+import java.util.HashMap;
+
+import retrofit2.Call;
+import retrofit2.Response;
+
+
+public class AudioViewActivity extends AppCompatActivity implements MediaPlayer.OnCompletionListener,
+        MediaPlayer.OnBufferingUpdateListener {
+    TextView contentTitle, contentDescription;
+    public static MyContent CONTENT = new MyContent();
+    public static MyTopic TOPIC = new MyTopic();
+    ApiService restService;
+
+    ImageButton toolPlayIcon, stopButton;
+    AppBarLayout appBarLayout;
+    Toolbar toolbar;
+    FloatingActionButton playButton;
+    CollapsingToolbarLayout collapsingToolbar;
+    private MediaPlayer mediaPlayer;
+    private int mediaFileLengthInMilliseconds;
+    private Handler handler = new Handler();
+    ProgressBar progressBar;
+    private AppCompatSeekBar seekBar;
+    TextView seekValue;
+    private int mDurationSecondsMax = 0;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_audio_view);
+        setupWindowAnimations();
+        restService = ((MainApplication) getApplication()).getClient();
+
+        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
+        StrictMode.setThreadPolicy(policy);
+
+        contentTitle = findViewById(R.id.contentTitle);
+        contentTitle.setText(CONTENT.getTitle());
+        contentDescription = findViewById(R.id.contentDescription);
+        contentDescription.setText(CONTENT.getDescription());
+        contentDescription.setMovementMethod(new ScrollingMovementMethod());
+        toolPlayIcon = findViewById(R.id.toolPlayIcon);
+        appBarLayout = findViewById(R.id.appBarLayout);
+        toolbar = findViewById(R.id.toolbar);
+        seekBar = findViewById(R.id.seekBar);
+        seekValue = findViewById(R.id.seekValue);
+        stopButton = findViewById(R.id.stopButton);
+        progressBar = findViewById(R.id.progressBar);
+        progressBar.setVisibility(View.GONE);
+
+        stopButton.setEnabled(false);
+        seekBar.setEnabled(false);
+
+        setSupportActionBar(toolbar);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        collapsingToolbar = findViewById(R.id.collapsing_toolbar);
+
+        appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
+            @Override
+            public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
+                if (Math.abs(verticalOffset) - appBarLayout.getTotalScrollRange() == 0) {
+                    toolbar.setBackgroundColor(Color.parseColor("#2f6aac"));
+                    toolPlayIcon.setVisibility(View.VISIBLE);
+                } else {
+                    toolbar.setBackgroundColor(Color.TRANSPARENT);
+                    toolPlayIcon.setVisibility(View.GONE);
+                }
+            }
+        });
+
+        playButton = findViewById(R.id.playButton);
+
+        playButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (mediaPlayer != null && !mediaPlayer.isPlaying()) {
+                    progressBar.setVisibility(View.VISIBLE);
+                    playButton.setImageResource(R.mipmap.pause_icon);
+                    toolPlayIcon.setImageResource(R.mipmap.pause_icon_white);
+                    new Handler().post(new Runnable() {
+                        @Override
+                        public void run() {
+                            try {
+
+                                mediaPlayer.setDataSource(CONTENT.getContent_files().get(0).getFile_url().trim());
+                                mediaPlayer.prepare();
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                            mediaFileLengthInMilliseconds = mediaPlayer.getDuration();
+                            seekBar.setMax(mediaFileLengthInMilliseconds / 1000);
+                            mDurationSecondsMax = mediaFileLengthInMilliseconds / 1000;
+                            seekValue.setText(secondsToTime(seekBar.getProgress()));
+
+                            if (seekBar.getProgress() == 0 && !CONTENT.getStatus().trim().equalsIgnoreCase("1")
+                                    && !CONTENT.getStatus().trim().equalsIgnoreCase("2")) {
+                                updateStatus("1");
+                            }
+                            seekBar.setEnabled(true);
+                            stopButton.setEnabled(true);
+                            mediaPlayer.start();
+                            progressBar.setVisibility(View.GONE);
+                            primarySeekBarProgressUpdater();
+                        }
+                    });
+                } else {
+                    mediaPlayer.pause();
+                    playButton.setImageResource(R.mipmap.play_icon);
+                    toolPlayIcon.setImageResource(R.mipmap.play_icon_white);
+                    primarySeekBarProgressUpdater();
+                }
+            }
+        });
+        Log.e("ee",CONTENT.getContent_files().get(0).getFile_url().trim());
+
+        toolPlayIcon.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (mediaPlayer != null && !mediaPlayer.isPlaying()) {
+                    progressBar.setVisibility(View.VISIBLE);
+                    playButton.setImageResource(R.mipmap.pause_icon);
+                    toolPlayIcon.setImageResource(R.mipmap.pause_icon_white);
+                    new Handler().post(new Runnable() {
+                        @Override
+                        public void run() {
+                            try {
+                                mediaPlayer.setDataSource(CONTENT.getContent_files().get(0).getFile_url().trim());
+                                mediaPlayer.prepare();
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                            mediaFileLengthInMilliseconds = mediaPlayer.getDuration();
+                            seekBar.setMax(mediaFileLengthInMilliseconds / 1000);
+                            mDurationSecondsMax = mediaFileLengthInMilliseconds / 1000;
+                            seekValue.setText(secondsToTime(seekBar.getProgress()));
+
+                            if (seekBar.getProgress() == 0 && !CONTENT.getStatus().trim().equalsIgnoreCase("1")
+                                    && !CONTENT.getStatus().trim().equalsIgnoreCase("2")) {
+                                updateStatus("1");
+                            }
+                            seekBar.setEnabled(true);
+                            stopButton.setEnabled(true);
+                            mediaPlayer.start();
+                            progressBar.setVisibility(View.GONE);
+                            primarySeekBarProgressUpdater();
+                        }
+                    });
+                } else {
+                    mediaPlayer.pause();
+                    playButton.setImageResource(R.mipmap.play_icon);
+                    toolPlayIcon.setImageResource(R.mipmap.play_icon_white);
+                    primarySeekBarProgressUpdater();
+                }
+            }
+        });
+
+        collapsingToolbar.setTitle(TOPIC.getTopicname());
+
+        mediaPlayer = new MediaPlayer();
+        mediaPlayer.setOnBufferingUpdateListener(this);
+        mediaPlayer.setOnCompletionListener(this);
+
+        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+            @Override
+            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+                seekValue.setText(secondsToTime(progress));
+            }
+
+            @Override
+            public void onStartTrackingTouch(SeekBar seekBar) {
+
+            }
+
+            @Override
+            public void onStopTrackingTouch(SeekBar seekBar) {
+                if (mediaPlayer.isPlaying()) {
+                    int playPositionInMillisecconds = seekBar.getProgress() * 1000;
+                    mediaPlayer.seekTo(playPositionInMillisecconds);
+                }
+            }
+        });
+
+        stopButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                try {
+                    mediaPlayer.stop();
+                    mediaPlayer.release();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                handler.removeCallbacksAndMessages(null);
+                seekBar.setProgress(0);
+                seekBar.setEnabled(false);
+                stopButton.setEnabled(false);
+                playButton.setImageResource(R.mipmap.play_icon);
+                toolPlayIcon.setImageResource(R.mipmap.play_icon_white);
+                seekValue.setText("00:00/00:00");
+                mediaPlayer = new MediaPlayer();
+            }
+        });
+    }
+
+    private void primarySeekBarProgressUpdater() {
+        try {
+            seekBar.setProgress(mediaPlayer.getCurrentPosition() / 1000);
+            if (mediaPlayer.isPlaying()) {
+                Runnable notification = new Runnable() {
+                    public void run() {
+                        primarySeekBarProgressUpdater();
+                    }
+                };
+                handler.postDelayed(notification, 1000);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private String secondsToTime(int seconds) {
+        String time;
+
+        String minutesText = String.valueOf(seconds / 60);
+        if (minutesText.length() == 1)
+            minutesText = "0" + minutesText;
+
+        String secondsText = String.valueOf(seconds % 60);
+        if (secondsText.length() == 1)
+            secondsText = "0" + secondsText;
+
+        String time1 = "";
+
+        String minutesText1 = String.valueOf(mDurationSecondsMax / 60);
+        if (minutesText1.length() == 1)
+            minutesText1 = "0" + minutesText1;
+
+        String secondsText1 = String.valueOf(mDurationSecondsMax % 60);
+        if (secondsText1.length() == 1)
+            secondsText1 = "0" + secondsText1;
+
+        time = minutesText + ":" + secondsText + "/" + minutesText1 + ":" + secondsText1;
+
+        return time;
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            if (mediaPlayer != null && mediaPlayer.isPlaying()) {
+                mediaPlayer.stop();
+            }
+            finish();
+            this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        if (mediaPlayer != null && mediaPlayer.isPlaying()) {
+            mediaPlayer.stop();
+        }
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void updateStatus(String status) {
+        CONTENT.setStatus(status);
+        if (new UtilService().isNetworkAvailable(AudioViewActivity.this)) {
+            try {
+                HashMap<String, String> map = new HashMap<>();
+                map.put("contentid", CONTENT.getContentid());
+                map.put("assettopicid", CONTENT.getAssettopicid());
+                map.put("status", status);
+
+                restService.updateContentStaus(map).enqueue(new MyCallback<ErrorResponse>(status) {
+                    @Override
+                    public void onResponse(Call<ErrorResponse> call, Response<ErrorResponse> response) {
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            CONTENT.setStatus(ids);
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<ErrorResponse> call, Throwable t) {
+
+                    }
+                });
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    @Override
+    public void onBufferingUpdate(MediaPlayer mp, int percent) {
+        seekBar.setSecondaryProgress(percent);
+    }
+
+    @Override
+    public void onCompletion(MediaPlayer mp) {
+        if (!CONTENT.getStatus().trim().equalsIgnoreCase("2")) {
+            updateStatus("2");
+        }
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        if (mediaPlayer != null && mediaPlayer.isPlaying()) {
+            playButton.performClick();
+        }
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        if (mediaPlayer != null && mediaPlayer.isPlaying()) {
+            mediaPlayer.stop();
+        }
+    }
+
+}

+ 318 - 0
Android/app/src/main/java/com/cygnusa/hyperm/BulletinActivity.java

@@ -0,0 +1,318 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.google.firebase.analytics.FirebaseAnalytics;
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.adapter.BulletinAdapter;
+import com.cygnusa.hyperm.fancyshowcase.FancyShowCaseView;
+import com.cygnusa.hyperm.fancyshowcase.FocusShape;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.Bulletin;
+import com.cygnusa.hyperm.wrappers.BulletinResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.tylersuehr.esr.EmptyStateRecyclerView;
+import com.tylersuehr.esr.TextStateDisplay;
+
+import java.util.ArrayList;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class BulletinActivity extends AppCompatActivity {
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    EmptyStateRecyclerView bulletinList;
+    TextView title;
+    ProgressBar progressBar;
+    LinearLayoutManager linearLayoutManager;
+    BulletinAdapter adapter = null;
+    int TOTAL_RECORD = 0;
+    int PAGE = 0;
+    public static boolean isFromAMHome = false;
+    int LIMIT = 10;
+    ArrayList<Bulletin> MY_CONTENTS = new ArrayList<>();
+    public Bulletin Bulletin = new Bulletin();
+    private FirebaseAnalytics firebaseAnalytics;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_bulletin);
+        setupWindowAnimations();
+        setupUI(findViewById(R.id.bgLayout));
+        firebaseAnalytics = FirebaseAnalytics.getInstance(this);
+        restService = ((MainApplication) getApplication()).getClient();
+        title = findViewById(R.id.title);
+        bulletinList = findViewById(R.id.topicList);
+        bulletinList.setHasFixedSize(true);
+        bulletinList.setItemAnimator(new SlideInLeftAnimator());
+        linearLayoutManager = new LinearLayoutManager(getBaseContext());
+        bulletinList.setLayoutManager(linearLayoutManager);
+        bulletinList.setStateDisplay(EmptyStateRecyclerView.STATE_EMPTY,
+                new TextStateDisplay(this, "No data available", ""));
+        title.setText("Bulletin");
+        bulletinList.addOnScrollListener(recyclerViewOnScrollListener);
+        progressBar = findViewById(R.id.progressBar);
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setNavigationIcon(R.mipmap.back);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        bulletinList.post(new Runnable() {
+            @Override
+            public void run() {
+                getBulletinContents(true);
+            }
+        });
+
+        findViewById(R.id.helpIcon).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                //  showHelpScreen();
+            }
+        });
+        Bundle bundle = new Bundle();
+        /*bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "1");
+        bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "BulletinActivity");
+        //bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
+        firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);*/
+
+    }
+
+    private RecyclerView.OnScrollListener recyclerViewOnScrollListener = new RecyclerView.OnScrollListener() {
+        @Override
+        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
+            super.onScrollStateChanged(recyclerView, newState);
+        }
+
+        @Override
+        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+            super.onScrolled(recyclerView, dx, dy);
+            int visibleItemCount = linearLayoutManager.getChildCount();
+            int totalItemCount = linearLayoutManager.getItemCount();
+            int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition();
+
+            if (progressBar.getVisibility() != View.VISIBLE) {
+                if ((visibleItemCount + firstVisibleItemPosition) >= totalItemCount
+                        && firstVisibleItemPosition >= 0
+                        && totalItemCount < TOTAL_RECORD && MY_CONTENTS.size() < TOTAL_RECORD) {
+                    PAGE++;
+                    getBulletinContents(false);
+                }
+            }
+        }
+    };
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(BulletinActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    activity.getCurrentFocus().getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        if (isFromAMHome) {
+            startActivity(new Intent(BulletinActivity.this, AMHomeActivity.class));
+            finish();
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (adapter != null) {
+            adapter.notifyDataSetChanged();
+        }
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    private void showHelpScreen() {
+        try {
+            View view;
+            if (adapter != null && adapter.getItemCount() > 0) {
+                view = bulletinList.findViewHolderForAdapterPosition(linearLayoutManager.findFirstVisibleItemPosition()).itemView;
+            } else {
+                view = bulletinList;
+            }
+            new FancyShowCaseView.Builder(this)
+                    .focusOn(view)
+                    .title("Tap here to view the PDF or Video")
+                    .titleSize(22, 1)
+                    .closeOnTouch(true)
+                    .fitSystemWindows(false)
+                    .focusShape(FocusShape.ROUNDED_RECTANGLE)
+                    .backgroundColor(Color.parseColor("#99000000"))
+                    .build()
+                    .show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            confirmClose();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void confirmClose() {
+        if (isFromAMHome) {
+            startActivity(new Intent(BulletinActivity.this, AMHomeActivity.class));
+        }
+        finish();
+        BulletinActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void getBulletinContents(boolean canLoadProgress) {
+        if (new UtilService().isNetworkAvailable(BulletinActivity.this)) {
+            if (canLoadProgress) {
+                progressDialog = new TransparentProgressDialog(BulletinActivity.this);
+                progressDialog.show();
+                progressBar.setVisibility(View.GONE);
+            } else {
+                progressBar.setVisibility(View.VISIBLE);
+            }
+
+            restService.getBulletinContents(PAGE, LIMIT).enqueue(new Callback<BulletinResponse>() {
+                @Override
+                public void onResponse(Call<BulletinResponse> call, Response<BulletinResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    progressBar.setVisibility(View.GONE);
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        TOTAL_RECORD = Integer.parseInt(response.body().getTotal());
+                        if (adapter == null) {
+                            MY_CONTENTS = response.body().getData();
+                            adapter = new BulletinAdapter(BulletinActivity.this, MY_CONTENTS);
+                            bulletinList.setAdapter(adapter);
+                        } else {
+                            MY_CONTENTS.addAll(response.body().getData());
+
+                        }
+
+                        if (MY_CONTENTS.size() == 0) {
+                            bulletinList.invokeState(EmptyStateRecyclerView.STATE_EMPTY);
+                        } else {
+                            bulletinList.invokeState(EmptyStateRecyclerView.STATE_OK);
+                        }
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        }
+                    }
+
+                    new Handler().postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            if (getPreferences(MODE_PRIVATE).getBoolean("ContentListActivity", true)) {
+                                // showHelpScreen();
+                                getPreferences(MODE_PRIVATE).edit().putBoolean("ContentListActivity", false).apply();
+                            }
+                        }
+                    }, 1000);
+                }
+
+                @Override
+                public void onFailure(Call<BulletinResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    progressBar.setVisibility(View.GONE);
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+}

+ 150 - 0
Android/app/src/main/java/com/cygnusa/hyperm/BulletinDetails.java

@@ -0,0 +1,150 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.wrappers.Bulletin;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class BulletinDetails extends AppCompatActivity {
+    public static Bulletin CONTENT = new Bulletin();
+    TextView title, desc, publishedDate, headtitle;
+    ImageView image;
+    private String bulletinId;
+
+    private ApiService apiService;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_bulletin_details);
+        setupWindowAnimations();
+
+        headtitle = findViewById(R.id.title);
+        title = findViewById(R.id.bulletinTitle);
+        desc = findViewById(R.id.bulletinDescription);
+        publishedDate = findViewById(R.id.publishedDate);
+        image = findViewById(R.id.myImage);
+        //  mImageLangSelection = findViewById(R.id.imgLanguage);
+        publishedDate.setText("Published On: " + dateFormate(CONTENT.getPublished_date()));
+        title.setText(CONTENT.getBulletin_title());
+        headtitle.setText("Bulletin");
+        desc.setText(CONTENT.getBulletin_desc());
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setNavigationIcon(R.mipmap.back);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        apiService = ((MainApplication) getApplication()).getClient();
+
+        Bundle bundle = getIntent().getExtras();
+        if (bundle != null) {
+            bulletinId = bundle.getString("bulletinId");
+        }
+
+        sendBulletinIdUpdate();
+
+        findViewById(R.id.helpIcon).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+            }
+        });
+        Glide.with(this).load(CONTENT.getImage_url())
+                .thumbnail(Glide.with(this).load(R.drawable.gif_loader))
+                .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.ALL).centerCrop()
+                        .placeholder(R.drawable.placeholder)).into(image);
+    }
+
+    private void sendBulletinIdUpdate() {
+        apiService.sendBulletinUpdate(bulletinId).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+                    Log.e("BulletinResponse", response.body().getMessage());
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+                if (t.getMessage() != null)
+                    Log.e("BulletinFailedResponse", t.getMessage());
+            }
+        });
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            confirmClose();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void confirmClose() {
+        finish();
+        BulletinDetails.this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    public String dateFormate(String dte) {
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date newDate = null;
+        try {
+            newDate = format.parse(dte);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        format = new SimpleDateFormat("dd-MMM-yyyy");
+        String date = format.format(newDate);
+
+
+        return date;
+    }
+
+}

+ 241 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ChangePasswordActivity.java

@@ -0,0 +1,241 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import androidx.appcompat.app.AppCompatActivity;
+import android.text.TextUtils;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+
+import java.util.HashMap;
+import java.util.regex.Pattern;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class ChangePasswordActivity extends AppCompatActivity {
+    EditText newPassword, confirmPassword, oldPassword;
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    String PASSWORD_PATTERN = "((?=.*\\d)(?=.*[a-z,A-Z]).{8,30})";
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_change_password);
+        GlobalData.openDatabase(ChangePasswordActivity.this);
+        setupWindowAnimations();
+        setupUI(findViewById(R.id.bgLayout));
+
+        restService = ((MainApplication) getApplication()).getClient();
+        newPassword = findViewById(R.id.newPassword);
+        confirmPassword = findViewById(R.id.confirmPassword);
+        oldPassword = findViewById(R.id.oldPassword);
+
+        findViewById(R.id.continueButton).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                attemptLogin();
+            }
+        });
+
+//        Toolbar toolbar = findViewById(R.id.toolbar);
+//        setSupportActionBar(toolbar);
+//        toolbar.setTitle("");
+//        getSupportActionBar().setTitle("");
+//        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+//        getSupportActionBar().setDisplayShowHomeEnabled(true);
+       @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+//        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        ImageView imageView = findViewById(R.id.back_btn);
+        imageView.setImageDrawable(backArrow);
+        imageView.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                finish();
+                overridePendingTransition(R.anim.animation_f_enter,
+                        R.anim.animation_f_leave);
+            }
+        });
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        finish();
+        overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void attemptLogin() {
+        String nPassword = newPassword.getText().toString().trim();
+        String cPassword = confirmPassword.getText().toString().trim();
+        String oPassword = oldPassword.getText().toString().trim();
+
+        boolean cancel = false;
+        View focusView = null;
+        if (TextUtils.isEmpty(oPassword) && TextUtils.isEmpty(nPassword) && TextUtils.isEmpty(cPassword)) {
+            GlobalData.showToast(getBaseContext(), "Please fill in all necessary fields.", Toast.LENGTH_SHORT).show();
+            focusView = oldPassword;
+            cancel = true;
+        } else if (TextUtils.isEmpty(oPassword)) {
+            GlobalData.showToast(getBaseContext(), "Please enter the old password", Toast.LENGTH_SHORT).show();
+            focusView = oldPassword;
+            cancel = true;
+        } else if (TextUtils.isEmpty(nPassword)) {
+            GlobalData.showToast(getBaseContext(), "Please enter the new password", Toast.LENGTH_SHORT).show();
+            focusView = newPassword;
+            cancel = true;
+        } else if (TextUtils.isEmpty(cPassword)) {
+            GlobalData.showToast(getBaseContext(), "Please enter the confirm password", Toast.LENGTH_SHORT).show();
+            focusView = confirmPassword;
+            cancel = true;
+        } else if (!nPassword.equals(cPassword)) {
+            GlobalData.showToast(getBaseContext(), "Password not matching", Toast.LENGTH_SHORT).show();
+            focusView = confirmPassword;
+            cancel = true;
+        } else if (!Pattern.compile(PASSWORD_PATTERN).matcher(cPassword).matches()) {
+            GlobalData.showToast(getBaseContext(), "The password must have at least 8 characters and its alphanumeric", Toast.LENGTH_LONG).show();
+            focusView = confirmPassword;
+            cancel = true;
+        }
+
+        if (cancel) {
+            focusView.requestFocus();
+        } else {
+            if (new UtilService().isNetworkAvailable(ChangePasswordActivity.this)) {
+                progressDialog = new TransparentProgressDialog(ChangePasswordActivity.this);
+                progressDialog.show();
+
+                try {
+                    HashMap<String, String> map = new HashMap<>();
+                    map.put("new_password", nPassword);
+                    map.put("current_password", oPassword);
+                    map.put("type", "old");
+
+                    restService.changePassword(map).enqueue(new Callback<ErrorResponse>() {
+                        @Override
+                        public void onResponse(Call<ErrorResponse> call, Response<ErrorResponse> response) {
+
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+
+                            if (response.body() != null && response.body().getStatus() == 200) {
+                                GlobalData.showToast(getBaseContext(), "Password changed successfully", Toast.LENGTH_SHORT).show();
+                                finish();
+                                ChangePasswordActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                                        R.anim.animation_f_leave);
+                            } else if (response.body() != null && response.body().getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            } else if (response.body() != null) {
+                                GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                            } else if (response.errorBody() != null) {
+                                Gson gson = new Gson();
+                                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                                if (message.getStatus() == 401) {
+                                    GlobalData.canLogout = true;
+                                    finish();
+                                }
+                            }
+                        }
+
+                        @Override
+                        public void onFailure(Call<ErrorResponse> call, Throwable t) {
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+                            GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                        }
+                    });
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            } else {
+                GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+            }
+        }
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(ChangePasswordActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    protected void onResume() {
+        super.onResume();
+
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    activity.getCurrentFocus().getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
+

+ 129 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ClassRoomDSETainingActivity.java

@@ -0,0 +1,129 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.view.MenuItem;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import com.ogaclejapan.smarttablayout.SmartTabLayout;
+import com.cygnusa.hyperm.fragments.ClassRoomTainingActivity;
+import com.cygnusa.hyperm.fragments.DSEFeedBackFragment;
+import com.cygnusa.hyperm.fragments.DSEResultScoreFragment;
+import com.cygnusa.hyperm.util.DepthPageTransformerNew;
+import com.cygnusa.hyperm.util.NonSwipeableViewPager;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.wrappers.FragmentItem;
+
+import java.util.ArrayList;
+import java.util.Objects;
+
+public class ClassRoomDSETainingActivity extends AppCompatActivity {
+    TransparentProgressDialog progressDialog;
+    NonSwipeableViewPager dseClassRoomPager;
+    SmartTabLayout dseClassRoomTab;
+    ArrayList<String> arrEarnedPoints = new ArrayList<>();
+    DSEClassRoomAdapter adapter;
+    ArrayList<FragmentItem> fragments = new ArrayList<>();
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.fragment_dse_training);
+        initView();
+    }
+
+    private void initView() {
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+
+        dseClassRoomPager = findViewById(R.id.myDsePager);
+        dseClassRoomTab = findViewById(R.id.myDsePagerTab);
+
+        arrEarnedPoints.clear();
+        arrEarnedPoints.add("Calender");
+        arrEarnedPoints.add("Feedback");
+        arrEarnedPoints.add("Result & Score");
+
+        dseClassRoomPager.setPageTransformer(true, new DepthPageTransformerNew());
+        adapter = new DSEClassRoomAdapter(getSupportFragmentManager(),
+                arrEarnedPoints);
+        dseClassRoomPager.setAdapter(adapter);
+        dseClassRoomTab.setViewPager(dseClassRoomPager);
+
+        if (getIntent().getExtras() != null) {
+            Bundle bundle = getIntent().getExtras();
+            if (bundle != null) {
+                String message = bundle.getString("type");
+                if (message != null) {
+                    if (message.equalsIgnoreCase("11")) {
+                        dseClassRoomPager.setCurrentItem(2);
+                    } else if (message.equalsIgnoreCase("12")) {
+                        dseClassRoomPager.setCurrentItem(3);
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            ClassRoomDSETainingActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private class DSEClassRoomAdapter extends FragmentPagerAdapter {
+        ArrayList<String> categories;
+
+        public DSEClassRoomAdapter(androidx.fragment.app.FragmentManager supportFragmentManager, ArrayList<String> list) {
+            super(supportFragmentManager);
+            categories = list;
+            fragments = new ArrayList<>();
+        }
+
+        @Override
+        public int getCount() {
+            return 3;
+        }
+
+        @NonNull
+        @Override
+        public Fragment getItem(int position) {
+            switch (position) {
+                case 0:
+                    return new ClassRoomTainingActivity(); //ChildFragment1 at position 0
+                case 1:
+                    return new DSEFeedBackFragment(); //ChildFragment2 at position 1
+                case 2:
+                    return new DSEResultScoreFragment(); //ChildFragment3 at position 2
+            }
+            return null;
+        }
+
+        @Override
+        public CharSequence getPageTitle(int position) {
+            return categories.get(position);
+        }
+    }
+}

+ 123 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ClassRoomTrainerTainingActivity.java

@@ -0,0 +1,123 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.view.MenuItem;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+import com.ogaclejapan.smarttablayout.SmartTabLayout;
+import com.cygnusa.hyperm.fragments.ClassRoomTainingActivity;
+import com.cygnusa.hyperm.fragments.TrainerFeedBackFragment;
+import com.cygnusa.hyperm.util.DepthPageTransformerNew;
+import com.cygnusa.hyperm.util.NonSwipeableViewPager;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.wrappers.FragmentItem;
+
+import java.util.ArrayList;
+import java.util.Objects;
+
+public class ClassRoomTrainerTainingActivity extends AppCompatActivity {
+    TransparentProgressDialog progressDialog;
+    NonSwipeableViewPager dseClassRoomPager;
+    SmartTabLayout dseClassRoomTab;
+    ArrayList<String> arrEarnedPoints = new ArrayList<>();
+    DSEClassRoomAdapter adapter;
+    ArrayList<FragmentItem> fragments = new ArrayList<>();
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.fragment_dse_training);
+        initView();
+    }
+
+    private void initView() {
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+
+        dseClassRoomPager = findViewById(R.id.myDsePager);
+        dseClassRoomTab = findViewById(R.id.myDsePagerTab);
+
+        arrEarnedPoints.clear();
+        arrEarnedPoints.add("Calender");
+        arrEarnedPoints.add("Feedback");
+
+        dseClassRoomPager.setPageTransformer(true, new DepthPageTransformerNew());
+        adapter = new DSEClassRoomAdapter(getSupportFragmentManager(),
+                arrEarnedPoints);
+        dseClassRoomPager.setAdapter(adapter);
+        dseClassRoomTab.setViewPager(dseClassRoomPager);
+
+        if (getIntent().getExtras() != null) {
+            Bundle bundle = getIntent().getExtras();
+            if (bundle != null) {
+                String message = bundle.getString("type");
+                if (message != null) {
+                    if (message.equalsIgnoreCase("11")) {
+                        dseClassRoomPager.setCurrentItem(2);
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            ClassRoomTrainerTainingActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private class DSEClassRoomAdapter extends FragmentPagerAdapter {
+        ArrayList<String> categories;
+
+        public DSEClassRoomAdapter(androidx.fragment.app.FragmentManager supportFragmentManager, ArrayList<String> list) {
+            super(supportFragmentManager);
+            categories = list;
+            fragments = new ArrayList<>();
+        }
+
+        @Override
+        public int getCount() {
+            return 2;
+        }
+
+        @NonNull
+        @Override
+        public Fragment getItem(int position) {
+            switch (position) {
+                case 0:
+                    return new ClassRoomTainingActivity(); //ChildFragment1 at position 0
+                case 1:
+                    return new TrainerFeedBackFragment();
+            }
+            return null;
+        }
+
+        @Override
+        public CharSequence getPageTitle(int position) {
+            return categories.get(position);
+        }
+    }
+}

+ 394 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ContentListActivity.java

@@ -0,0 +1,394 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.database.Cursor;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Handler;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.appcompat.widget.Toolbar;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.adapter.ContentAdapter;
+import com.cygnusa.hyperm.fancyshowcase.FancyShowCaseView;
+import com.cygnusa.hyperm.fancyshowcase.FocusShape;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ContentResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.HitCountModel;
+import com.cygnusa.hyperm.wrappers.MyContent;
+import com.cygnusa.hyperm.wrappers.MyTopic;
+import com.cygnusa.hyperm.wrappers.TrainingCategory;
+import com.tylersuehr.esr.EmptyStateRecyclerView;
+import com.tylersuehr.esr.TextStateDisplay;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class ContentListActivity extends AppCompatActivity {
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    EmptyStateRecyclerView topicList;
+    TextView title;
+    public static MyTopic TOPIC = new MyTopic();
+    int PAGE = 0;
+    int LIMIT = 10;
+    ContentAdapter adapter = null;
+
+    ArrayList<MyContent> FILTER_CONTENTS = new ArrayList<>();
+
+    LinearLayoutManager linearLayoutManager;
+    int TOTAL_RECORD = 0;
+    ArrayList<MyContent> MY_CONTENTS = new ArrayList<>();
+    ProgressBar progressBar;
+    EditText contentSearch;
+    public static TrainingCategory TRAINING_ID;
+    private StorePreference storePreference;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_content_list);
+        setupWindowAnimations();
+        setupUI(findViewById(R.id.bgLayout));
+        restService = ((MainApplication) getApplication()).getClient();
+        title = findViewById(R.id.title);
+        topicList = findViewById(R.id.topicList);
+        topicList.setHasFixedSize(true);
+        topicList.setItemAnimator(new SlideInLeftAnimator());
+        linearLayoutManager = new LinearLayoutManager(getBaseContext());
+        topicList.setLayoutManager(linearLayoutManager);
+        topicList.setStateDisplay(EmptyStateRecyclerView.STATE_EMPTY,
+                new TextStateDisplay(this, "No data available", ""));
+        topicList.addOnScrollListener(recyclerViewOnScrollListener);
+        title.setText(TOPIC.getTopicname());
+        storePreference = new StorePreference(this);
+        title.setSelected(true);
+        topicList.addOnScrollListener(recyclerViewOnScrollListener);
+        progressBar = findViewById(R.id.progressBar);
+        contentSearch = findViewById(R.id.contentSearch);
+        contentSearch.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+                doFilter();
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+
+            }
+        });
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setNavigationIcon(R.mipmap.back);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        topicList.post(new Runnable() {
+            @Override
+            public void run() {
+                getTopicContents(true);
+            }
+        });
+        findViewById(R.id.helpIcon).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showHelpScreen();
+            }
+        });
+        if (StorePreference.getInstance(this).getBooleanValue(GlobalData.ISDSELOGIN))
+            sendHitCountToServer();
+    }
+
+
+    private void sendHitCountToServer() {
+        restService.sendAllHitCount(buildConfigData()).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+                    Log.e("responeHit", response.body().getMessage());
+                } else {
+                    Log.e("responeHit", response.body().getMessage());
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+                if (t.getMessage() != null) {
+                    Log.e("responeHit", t.getMessage());
+                }
+            }
+        });
+    }
+    private HitCountModel buildConfigData() {
+        Calendar calendar = Calendar.getInstance();
+        HitCountModel hitCountModel = new HitCountModel();
+        hitCountModel.setPage("Learning");
+        hitCountModel.setCateid(Integer.valueOf(TOPIC.getCateid()));
+        hitCountModel.setAssettopicid(Integer.valueOf(TOPIC.getAssettopicid()));
+        hitCountModel.setViewtime("0");
+        return hitCountModel;
+    }
+    private void showHelpScreen() {
+        try {
+            View view;
+            if (adapter != null && adapter.getItemCount() > 0) {
+                view = topicList.findViewHolderForAdapterPosition(linearLayoutManager.findFirstVisibleItemPosition()).itemView;
+            } else {
+                view = topicList;
+            }
+            new FancyShowCaseView.Builder(this)
+                    .focusOn(view)
+                    .title("Tap here to view the PDF or Video")
+                    .titleSize(22, 1)
+                    .closeOnTouch(true)
+                    .fitSystemWindows(false)
+                    .focusShape(FocusShape.ROUNDED_RECTANGLE)
+                    .backgroundColor(Color.parseColor("#99000000"))
+                    .build()
+                    .show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    private void doFilter() {
+        FILTER_CONTENTS.clear();
+        for (int i = 0; i < MY_CONTENTS.size(); i++) {
+            if (MY_CONTENTS.get(i).getTitle().trim().toLowerCase().contains(contentSearch.getText().toString().toLowerCase().trim()) ||
+                    MY_CONTENTS.get(i).getDescription().trim().toLowerCase().contains(contentSearch.getText().toString().trim().toLowerCase()) ||
+                    MY_CONTENTS.get(i).getContent_files().get(0).getFiletype().trim().toLowerCase().contains(contentSearch.getText().toString().trim().toLowerCase()))
+                FILTER_CONTENTS.add(MY_CONTENTS.get(i));
+        }
+        adapter.notifyDataSetChanged();
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (adapter != null) {
+            adapter.notifyDataSetChanged();
+        }
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+    @SuppressLint("StaticFieldLeak")
+    private void getTopicContents(boolean canLoadProgress) {
+        if (new UtilService().isNetworkAvailable(ContentListActivity.this)) {
+            if (canLoadProgress) {
+                progressDialog = new TransparentProgressDialog(ContentListActivity.this);
+                progressDialog.show();
+                progressBar.setVisibility(View.GONE);
+            } else {
+                progressBar.setVisibility(View.VISIBLE);
+            }
+
+            restService.getTopicContents(TOPIC.getAssettopicid(), PAGE, LIMIT).enqueue(new Callback<ContentResponse>() {
+                @Override
+                public void onResponse(Call<ContentResponse> call, Response<ContentResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    progressBar.setVisibility(View.GONE);
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        TOTAL_RECORD = Integer.parseInt(response.body().getTotal());
+                        if (adapter == null) {
+                            MY_CONTENTS = response.body().getData();
+                            setContentList();
+                        } else {
+                            MY_CONTENTS.addAll(response.body().getData());
+                            doFilter();
+                        }
+
+                        if (MY_CONTENTS.size() == 0) {
+                            topicList.invokeState(EmptyStateRecyclerView.STATE_EMPTY);
+                        } else {
+                            topicList.invokeState(EmptyStateRecyclerView.STATE_OK);
+                        }
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        }
+                    }
+
+                    new Handler().postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            if (getPreferences(MODE_PRIVATE).getBoolean("ContentListActivity", true)) {
+                                showHelpScreen();
+                                getPreferences(MODE_PRIVATE).edit().putBoolean("ContentListActivity", false).apply();
+                            }
+                        }
+                    }, 1000);
+                }
+
+                @Override
+                public void onFailure(Call<ContentResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    progressBar.setVisibility(View.GONE);
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+
+            Cursor cursor = GlobalData.sdb.rawQuery("select * from topic_content where" + " category_id='"
+                    + TRAINING_ID.getCateid() +
+                    "' and topic_id='" + TOPIC.getAssettopicid() + "'", null);
+
+            MY_CONTENTS = new ArrayList<>();
+            if (cursor.getCount() > 0) {
+                cursor.moveToFirst();
+                Gson gson = new Gson();
+                for (int i = 0; i < cursor.getCount(); i++) {
+                    MyContent myContent = gson.fromJson(
+                            cursor.getString(cursor.getColumnIndex("topic_content")),
+                            new TypeToken<MyContent>() {
+                            }.getType());
+                    MY_CONTENTS.add(myContent);
+                    cursor.moveToNext();
+                }
+                setContentList();
+            } else {
+                GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+            }
+
+        }
+    }
+
+    private void setContentList() {
+        FILTER_CONTENTS.addAll(MY_CONTENTS);
+        adapter = new ContentAdapter(ContentListActivity.this, FILTER_CONTENTS, TOPIC, TRAINING_ID);
+        topicList.setAdapter(adapter);
+    }
+    private RecyclerView.OnScrollListener recyclerViewOnScrollListener = new RecyclerView.OnScrollListener() {
+        @Override
+        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
+            super.onScrollStateChanged(recyclerView, newState);
+        }
+
+        @Override
+        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+            super.onScrolled(recyclerView, dx, dy);
+            int visibleItemCount = linearLayoutManager.getChildCount();
+            int totalItemCount = linearLayoutManager.getItemCount();
+            int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition();
+
+            if (progressBar.getVisibility() != View.VISIBLE) {
+                if ((visibleItemCount + firstVisibleItemPosition) >= totalItemCount
+                        && firstVisibleItemPosition >= 0
+                        && totalItemCount < TOTAL_RECORD && MY_CONTENTS.size() < TOTAL_RECORD) {
+                    PAGE++;
+                    getTopicContents(false);
+                }
+            }
+        }
+    };
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(ContentListActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    activity.getCurrentFocus().getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

ファイルの差分が大きいため隠しています
+ 2324 - 0
Android/app/src/main/java/com/cygnusa/hyperm/CreateClassRoomActivityNew.java


+ 180 - 0
Android/app/src/main/java/com/cygnusa/hyperm/CropActivity.java

@@ -0,0 +1,180 @@
+package com.cygnusa.hyperm;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.net.Uri;
+import android.os.Bundle;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.Toast;
+
+import com.cygnusa.hyperm.cropview.CropImageView;
+import com.cygnusa.hyperm.cropview.callback.CropCallback;
+import com.cygnusa.hyperm.cropview.callback.LoadCallback;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Objects;
+
+public class CropActivity extends AppCompatActivity {
+
+    public static Uri mSourceUri;
+    CropImageView mCropView;
+    TransparentProgressDialog progressDialog;
+    private Bitmap.CompressFormat mCompressFormat = Bitmap.CompressFormat.JPEG;
+    String IMAGE_PATH;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.crop_image_activity);
+        setupWindowAnimations();
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        mCropView = findViewById(R.id.cropImageView);
+
+        findViewById(R.id.buttonRotateLeft).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                mCropView.rotateImage(CropImageView.RotateDegrees.ROTATE_M90D);
+            }
+        });
+
+        findViewById(R.id.buttonRotateRight).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                mCropView.rotateImage(CropImageView.RotateDegrees.ROTATE_90D);
+            }
+        });
+
+        findViewById(R.id.buttonPickImage).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent result = new Intent();
+                setResult(Activity.RESULT_CANCELED, result);
+                finish();
+            }
+        });
+
+        findViewById(R.id.buttonDone).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                cropImage();
+            }
+        });
+
+        File f = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null), ".HYPERM");
+        if (!f.exists()) {
+            f.mkdirs();
+        }
+
+        File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null) + "/" + ".HYPERM", "Profile");
+        if (!f1.exists()) {
+            f1.mkdirs();
+        }
+
+        mCropView.post(new Runnable() {
+            @Override
+            public void run() {
+                loadImage();
+            }
+        });
+    }
+
+    @Override
+    public void onBackPressed() {
+        Intent result = new Intent();
+        setResult(Activity.RESULT_CANCELED, result);
+        finish();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            Intent result = new Intent();
+            setResult(Activity.RESULT_CANCELED, result);
+            finish();
+            overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void loadImage() {
+        mCropView.load(mSourceUri).execute(new LoadCallback() {
+            @Override
+            public void onSuccess() {
+                mCropView.setCropMode(CropImageView.CropMode.SQUARE);
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                Toast.makeText(CropActivity.this, "Error", Toast.LENGTH_SHORT).show();
+            }
+        });
+    }
+
+    private void cropImage() {
+        showProgress();
+        mCropView.crop(mSourceUri).execute(new CropCallback() {
+            @Override
+            public void onSuccess(Bitmap cropped) {
+                String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
+                String imageFileName = timeStamp + ".jpg";
+                File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null) + "/" + ".HYPERM/Profile", imageFileName);
+                IMAGE_PATH = f1.getAbsolutePath();
+                try {
+                    FileOutputStream out = new FileOutputStream(f1);
+                    cropped.compress(Bitmap.CompressFormat.JPEG, 60, out);
+                    out.flush();
+                    out.close();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                dismissProgress();
+                Intent result = new Intent();
+                result.setData(Uri.fromFile(f1));
+                result.putExtra("IMAGE_PATH", IMAGE_PATH);
+                setResult(Activity.RESULT_OK, result);
+                finish();
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                dismissProgress();
+            }
+        });
+    }
+
+    public void showProgress() {
+        progressDialog = new TransparentProgressDialog(CropActivity.this);
+        progressDialog.show();
+    }
+
+    public void dismissProgress() {
+        if (progressDialog != null && progressDialog.isShowing()) {
+            progressDialog.dismiss();
+        }
+    }
+}

+ 378 - 0
Android/app/src/main/java/com/cygnusa/hyperm/DSEViewFeedbackActivity.java

@@ -0,0 +1,378 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.content.Intent;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.fragments.DSETrainerFeedback;
+import com.cygnusa.hyperm.fragments.DSETrainingFeedback;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.DSEFeedBackAnswer;
+import com.cygnusa.hyperm.wrappers.DSETrainingFeedbackData;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.GetAllDSETrainingFeedbackSummary;
+import com.cygnusa.hyperm.wrappers.SurveyAnswer;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class DSEViewFeedbackActivity extends AppCompatActivity {
+    private TextView txtTrainingName, txtTrainingStartDate, txtTrainingDuration, txtTrainingEndDate, txtTrainingVenue,
+            txtTrainingTotalPArticipant, smpin, participantName, dealerName;
+
+    LinearLayout llout_remaining;
+    private ImageView imgAttendance;
+    private Button trainingFeedback, trainersFeedback, btnsubmit, btncancel;
+    FragmentManager manager;
+    private EditText edtRemarks;
+    ApiService restService;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_dse_feedback_view);
+
+        initViews();
+    }
+
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        startActivity(new Intent(DSEViewFeedbackActivity.this, ClassRoomDSETainingActivity.class));
+        finish();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            startActivity(new Intent(DSEViewFeedbackActivity.this, ClassRoomDSETainingActivity.class));
+            finish();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void initViews() {
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        restService = ((MainApplication) getApplication()).getClient();
+        txtTrainingName = findViewById(R.id.txtTrainingName);
+        txtTrainingStartDate = findViewById(R.id.txtTrainingStartDate);
+        txtTrainingDuration = findViewById(R.id.txtTrainingDuration);
+        txtTrainingEndDate = findViewById(R.id.txtTrainingEndDate);
+        txtTrainingVenue = findViewById(R.id.txtTrainingVenue);
+        txtTrainingTotalPArticipant = findViewById(R.id.txtTrainingTotalPArticipant);
+        llout_remaining = findViewById(R.id.lloutWholeLayout);
+        llout_remaining.setVisibility(View.GONE);
+        TextView txtShowmore = findViewById(R.id.txtShowmore);
+        imgAttendance = findViewById(R.id.imgAttendance);
+        edtRemarks = findViewById(R.id.edtRemarks);
+
+        trainersFeedback = findViewById(R.id.trainers_feedback);
+        trainingFeedback = findViewById(R.id.training_feedback);
+        manager = getSupportFragmentManager();
+
+        btnsubmit = findViewById(R.id.btnsubmit);
+        btncancel = findViewById(R.id.btncancel);
+
+
+        btncancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                onBackPressed();
+            }
+        });
+
+        btnsubmit.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (validate()) {
+                    sendAllTrainingFeedbacktoServer();
+                }
+            }
+        });
+
+        GetAllDSETrainingDetails();
+
+
+        trainersFeedback.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                FragmentTransaction transaction = manager.beginTransaction();
+                trainingFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                trainersFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                transaction.replace(R.id.container, new DSETrainerFeedback());
+                transaction.commit();
+            }
+        });
+
+        trainingFeedback.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                FragmentTransaction transaction = manager.beginTransaction();
+                trainersFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                trainingFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                transaction.replace(R.id.container, new DSETrainingFeedback());
+                transaction.commit();
+            }
+        });
+
+        smpin = findViewById(R.id.smpin);
+        participantName = findViewById(R.id.txtParticipantName);
+        dealerName = findViewById(R.id.txtDealerName);
+        txtTrainingVenue.setSelected(true);
+        dealerName.setSelected(true);
+        txtShowmore.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (txtShowmore.getText().toString().equalsIgnoreCase("Show More")) {
+                    txtShowmore.setText(getResources().getText(R.string.showless));
+                    llout_remaining.setVisibility(View.VISIBLE);
+                } else {
+                    txtShowmore.setText(getResources().getText(R.string.showmore));
+                    llout_remaining.setVisibility(View.GONE);
+                }
+            }
+        });
+
+        setAllData();
+    }
+
+
+    private void sendAllTrainingFeedbacktoServer() {
+
+        HashMap<String, String> sendObj = new HashMap<>();
+
+        sendObj.put("startdatetime", GlobalData.DSEFEEDBACKVIEW.getStartDate());
+        sendObj.put("enddatetime", GlobalData.DSEFEEDBACKVIEW.getEndDate());
+        sendObj.put("remarks", edtRemarks.getText().toString().trim());
+        ArrayList<DSEFeedBackAnswer> answers = new ArrayList<>();
+        DSEFeedBackAnswer answer = new DSEFeedBackAnswer();
+
+        for (int i = 0; i < GlobalData.DSEFeedbackQuestions.getQuestions().size(); i++) {
+            answer = new DSEFeedBackAnswer();
+            answer.setAqid(GlobalData.DSEFeedbackQuestions.getQuestions().get(i).getAqid());
+            answer.setQid(GlobalData.DSEFeedbackQuestions.getQuestions().get(i).getQid());
+            ArrayList<String> strings = new ArrayList<>();
+            strings.add(GlobalData.DSEFeedbackQuestions.getQuestions().get(i).getSelectedOption());
+            answer.setOptions(strings);
+            answers.add(answer);
+
+        }
+
+        Gson gson = new Gson();
+        JsonElement jsonElement = gson.toJsonTree(
+                answers, new TypeToken<ArrayList<SurveyAnswer>>() {
+                }.getType());
+        sendObj.put("ans_arr", jsonElement.toString());
+        restService.dsePostSurvey(GlobalData.DSEFEEDBACKVIEW.getAssessmentid(), sendObj).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+                    if (response.body().getResponse().equalsIgnoreCase("Success")) {
+                        GlobalData.toast(getApplicationContext(), response.body().getMessage());
+                        startActivity(new Intent(DSEViewFeedbackActivity.this, ClassRoomDSETainingActivity.class));
+                        finish();
+                    } else {
+                        GlobalData.toast(getApplicationContext(), response.body().getResponseText());
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getApplicationContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+                if (t.getMessage() != null) {
+                    Log.e("tmess", t.getMessage());
+                }
+            }
+        });
+    }
+
+    private boolean validate() {
+
+        if (edtRemarks.getText().toString().equalsIgnoreCase("")) {
+            Toast.makeText(DSEViewFeedbackActivity.this, "Please Enter Remarks", Toast.LENGTH_SHORT).show();
+            return false;
+        }
+
+        if (edtRemarks.getText().toString().length() < 60) {
+            Toast.makeText(DSEViewFeedbackActivity.this, "Please Enter Remarks min 60 letters", Toast.LENGTH_SHORT).show();
+            return false;
+        }
+
+        if (GlobalData.DSEFeedbackQuestions.getQuestions() != null && GlobalData.DSEFeedbackQuestions.getQuestions().size() > 0) {
+            for (int j = 0; j < GlobalData.DSEFeedbackQuestions.getQuestions().size(); j++) {
+                if (GlobalData.DSEFeedbackQuestions.getQuestions().get(j).getSelectedOption() == null) {
+                    Toast.makeText(DSEViewFeedbackActivity.this, "Please Choose mark for all questions", Toast.LENGTH_SHORT).show();
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
+    private void GetAllDSETrainingDetails() {
+
+        restService.getDSETrainingFeedback(GlobalData.DSEFEEDBACKVIEW.getAssessmentid()).enqueue(new Callback<GetAllDSETrainingFeedbackSummary>() {
+            @Override
+            public void onResponse(Call<GetAllDSETrainingFeedbackSummary> call, Response<GetAllDSETrainingFeedbackSummary> response) {
+                if (response.body() != null) {
+                    if (response.body().getResponse().equalsIgnoreCase("Success")) {
+                        DSETrainingFeedbackData summaryData = response.body().getDseTrainingFeedbackData();
+                        if (summaryData.getQuestions() != null && summaryData.getQuestions().size() > 0) {
+
+                            GlobalData.DSEFeedbackQuestions = summaryData;
+
+                            FragmentTransaction transaction = manager.beginTransaction();
+                            trainersFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                            trainingFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                            transaction.replace(R.id.container, new DSETrainingFeedback());
+                            transaction.commit();
+
+                        } else {
+                            GlobalData.toast(getApplicationContext(), response.body().getMessage());
+
+                        }
+                    } else {
+                        GlobalData.toast(getApplicationContext(), response.body().getMessage());
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getApplicationContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<GetAllDSETrainingFeedbackSummary> call, Throwable t) {
+                if (t.getMessage() != null) {
+                    Log.e("tmess", t.getMessage());
+                }
+            }
+        });
+    }
+
+    private void setAllData() {
+
+        if (GlobalData.DSEFEEDBACKVIEW != null) {
+            txtTrainingName.setText(GlobalData.DSEFEEDBACKVIEW.getTitle());
+
+            String endDate = GlobalData.DSEFEEDBACKVIEW.getEndDate();
+            String startDate = GlobalData.DSEFEEDBACKVIEW.getStartDate();
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startDateString = "", endDateString = "";
+            try {
+                startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+                endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            String endTime = GlobalData.DSEFEEDBACKVIEW.getEndDate();
+            String startTime = GlobalData.DSEFEEDBACKVIEW.getStartDate();
+
+            SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startTimeString = "", endTimeString = "";
+            Date date1, date2;
+            long difference = 0;
+            try {
+                date1 = timeFormat.parse(startTime);
+                date2 = timeFormat.parse(endTime);
+                startTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(startTime)));
+                endTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(endTime)));
+                difference = date1.getTime() - date2.getTime();
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            int days = (int) (difference / (1000 * 60 * 60 * 24));
+            int hours = (int) ((difference - (1000 * 60 * 60 * 24 * days)) / (1000 * 60 * 60));
+            int min = (int) (difference - (1000 * 60 * 60 * 24 * days) - (1000 * 60 * 60 * hours)) / (1000 * 60);
+
+            min = (hours < 0 ? -min : min);
+            Log.i("======= min", " :: " + min);
+
+            txtTrainingStartDate.setText(startDateString);
+            txtTrainingEndDate.setText(endDateString);
+            txtTrainingTotalPArticipant.setText(GlobalData.DSEFEEDBACKVIEW.getTotal_participants());
+            txtTrainingDuration.setText(GlobalData.DSEFEEDBACKVIEW.getOrganizer_name());
+            txtTrainingVenue.setText(GlobalData.DSEFEEDBACKVIEW.getVenueAddress());
+            if (GlobalData.user.getData().getSmpin() != null)
+                smpin.setText(GlobalData.user.getData().getSmpin());
+            participantName.setText(GlobalData.DSEFEEDBACKVIEW.getTraining_id());
+            dealerName.setText(GlobalData.user.getData().getDealer().getName());
+
+
+            Glide.with(DSEViewFeedbackActivity.this).load(GlobalData.DSEFEEDBACKRESPONSEGROUPIMAGE)
+                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                            .placeholder(R.drawable.nodatafound)).into(imgAttendance);
+        }
+    }
+}

+ 28 - 0
Android/app/src/main/java/com/cygnusa/hyperm/EMICalculator.java

@@ -0,0 +1,28 @@
+package com.cygnusa.hyperm;
+
+import android.os.Bundle;
+import android.webkit.WebView;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.cygnusa.hyperm.util.GlobalData;
+
+public class EMICalculator extends AppCompatActivity {
+
+    String url;
+    private WebView mWebview;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_emicalculator);
+        mWebview = findViewById(R.id.webView);
+        url = GlobalData.EMI_URL;
+
+        mWebview = new WebView(this);
+        mWebview.clearCache(true);
+        mWebview.clearHistory();
+        setContentView(mWebview);
+        mWebview.loadUrl(url);
+    }
+}

+ 129 - 0
Android/app/src/main/java/com/cygnusa/hyperm/FaqActivity.java

@@ -0,0 +1,129 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.StrictMode;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ProgressBar;
+
+import com.github.barteksc.pdfviewer.PDFView;
+import com.github.barteksc.pdfviewer.listener.OnLoadCompleteListener;
+import com.github.barteksc.pdfviewer.listener.OnPageChangeListener;
+import com.github.barteksc.pdfviewer.listener.OnPageErrorListener;
+import com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle;
+import com.github.barteksc.pdfviewer.util.FitPolicy;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+
+import java.net.URL;
+
+public class FaqActivity extends AppCompatActivity implements OnPageChangeListener, OnPageErrorListener, OnLoadCompleteListener {
+
+    TransparentProgressDialog progressDialog;
+    PDFView pdfView;
+    ProgressBar progressBar;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_faq);
+        setupWindowAnimations();
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        progressBar = findViewById(R.id.progressBar);
+        pdfView = findViewById(R.id.pdfView);
+        progressBar.setVisibility(View.VISIBLE);
+        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
+        StrictMode.setThreadPolicy(policy);
+
+        new Handler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                try {
+
+                    pdfView.fromStream(new URL(GlobalData.FAQ_URL+"faq/"+GlobalData.user.getData().getRole()+"/"+"faq.pdf").openStream())
+                            .onPageChange(FaqActivity.this)
+                            .enableAnnotationRendering(true)
+                            .onLoad(FaqActivity.this)
+                            .scrollHandle(new DefaultScrollHandle(FaqActivity.this))
+                            .spacing(10)
+                            .onPageError(FaqActivity.this)
+                            .pageFitPolicy(FitPolicy.WIDTH)
+                            .load();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    progressBar.setVisibility(View.GONE);
+                }
+            }
+        }, 1000);
+    }
+
+    @Override
+    public void onBackPressed() {
+        Intent result = new Intent();
+        setResult(Activity.RESULT_CANCELED, result);
+        finish();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    public void showProgress() {
+        progressDialog = new TransparentProgressDialog(FaqActivity.this);
+        progressDialog.show();
+    }
+
+    public void dismissProgress() {
+        if (progressDialog != null && progressDialog.isShowing()) {
+            progressDialog.dismiss();
+        }
+    }
+
+    @Override
+    public void loadComplete(int nbPages) {
+        progressBar.setVisibility(View.GONE);
+    }
+
+    @Override
+    public void onPageChanged(int page, int pageCount) {
+
+    }
+
+    @Override
+    public void onPageError(int page, Throwable t) {
+
+    }
+}

+ 483 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ForgotPasswordActivity.java

@@ -0,0 +1,483 @@
+package com.cygnusa.hyperm;
+
+import android.Manifest;
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.os.Bundle;
+import com.google.android.material.textfield.TextInputLayout;
+import androidx.core.app.ActivityCompat;
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.pinview.PinView;
+import com.cygnusa.hyperm.tooltip.Tooltip;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.ForgotPasswordResponse;
+import com.cygnusa.hyperm.wrappers.OtpResponse;
+import com.cygnusa.hyperm.wrappers.UserResponse;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.concurrent.TimeUnit;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class ForgotPasswordActivity extends AppCompatActivity {
+
+  public ForgotPasswordResponse signup = new ForgotPasswordResponse();
+  public int counter;
+  public OtpResponse errorResponse = new OtpResponse();
+  public UserResponse user = new UserResponse();
+  ApiService restService;
+  TransparentProgressDialog progressDialog;
+  EditText userName;
+  AlertDialog.Builder alertDialogBuilder;
+  AlertDialog alertDialog;
+  TextInputLayout inputLayout;
+  PinView pinview;
+
+
+  public static void hideSoftKeyboard(Activity activity) {
+    try {
+      InputMethodManager inputMethodManager =
+              (InputMethodManager) activity.getSystemService(
+                      Activity.INPUT_METHOD_SERVICE);
+      inputMethodManager.hideSoftInputFromWindow(
+              activity.getCurrentFocus().getWindowToken(), 0);
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+
+  @Override
+  protected void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+
+    setContentView(R.layout.activity_forgotpassword);
+    setupWindowAnimations();
+    setupUI(findViewById(R.id.bgLayout));
+    restService = ((MainApplication) getApplication()).getClient();
+
+    checkPermission();
+
+    userName = findViewById(R.id.userName);
+
+    findViewById(R.id.continueButton).setOnClickListener(new OnClickListener() {
+      @Override
+      public void onClick(View view) {
+        attemptForgotPassword();
+      }
+    });
+
+    findViewById(R.id.info).setOnClickListener(new OnClickListener() {
+      @Override
+      public void onClick(View view) {
+        String header = "If you are dealer staff enter the SMPIN for registering and logging into the system\n" +
+                "\nIf you are HYPERM staff enter your Employee ID for registering and logging into the system";
+        View mView = LayoutInflater.from(ForgotPasswordActivity.this).inflate(R.layout.login_tooltip_text, null);
+        TextView text = mView.findViewById(R.id.text11);
+        text.setText(header);
+        Tooltip.TooltipView tooltip = Tooltip.make(ForgotPasswordActivity.this,
+                new Tooltip.Builder(101)
+                        .anchor(view, Tooltip.Gravity.TOP)
+                        .closePolicy(new Tooltip.ClosePolicy()
+                                .insidePolicy(true, false)
+                                .outsidePolicy(true, false), 0)
+                        .activateDelay(800)
+                        .withStyleId(R.style.ToolTipLayoutCustomStyle)
+                        .showDelay(300)
+                        .text("")
+                        .setBgColor(getResources().getColor(R.color.bg_color))
+                        .view(mView)
+                        .maxWidth(300)
+                        .withArrow(true)
+                        .build()
+        );
+        tooltip.setTextColor(Color.YELLOW);
+        tooltip.show();
+      }
+    });
+
+
+
+    Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+    backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+//        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+    ImageView imageView = findViewById(R.id.back_btn);
+    imageView.setImageDrawable(backArrow);
+    imageView.setOnClickListener(new OnClickListener() {
+      @Override
+      public void onClick(View view) {
+        finish();
+        overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+      }
+    });
+  }
+
+  private void setupWindowAnimations() {
+    this.overridePendingTransition(R.anim.animation_enter,
+            R.anim.animation_leave);
+  }
+
+  @Override
+  public boolean onOptionsItemSelected(MenuItem item) {
+    if (item.getItemId() == android.R.id.home) {
+      finish();
+      this.overridePendingTransition(R.anim.animation_f_enter,
+              R.anim.animation_f_leave);
+    }
+    return super.onOptionsItemSelected(item);
+  }
+
+  @Override
+  public void onBackPressed() {
+    super.onBackPressed();
+    this.overridePendingTransition(R.anim.animation_f_enter,
+            R.anim.animation_f_leave);
+  }
+
+  private void attemptForgotPassword() {
+    String inputString = userName.getText().toString().trim();
+
+    boolean cancel = false;
+    View focusView = null;
+    HashMap<String, String> map = new HashMap<>();
+
+    if (TextUtils.isEmpty(inputString)) {
+      GlobalData.showToast(getBaseContext(), "Please enter the SMPIN", Toast.LENGTH_SHORT).show();
+      focusView = userName;
+      cancel = true;
+    }
+    map.put("username", inputString);
+    map.put("device_type","android");
+    if (cancel) {
+      focusView.requestFocus();
+    } else {
+      if (new UtilService().isNetworkAvailable(ForgotPasswordActivity.this)) {
+        progressDialog = new TransparentProgressDialog(ForgotPasswordActivity.this);
+        progressDialog.show();
+        try {
+          restService.forgotPassword(map).enqueue(new Callback<ForgotPasswordResponse>() {
+            @Override
+            public void onResponse(Call<ForgotPasswordResponse> call, Response<ForgotPasswordResponse> response) {
+              signup = response.body();
+              if (progressDialog != null && progressDialog.isShowing()) {
+                progressDialog.dismiss();
+              }
+
+              if (response.body() != null && response.body().getStatus() == 200) {
+
+                //  GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                showOtpPopUp(signup.getData(), signup.getOtp_expiry());
+              } else if (response.body() != null) {
+
+                GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+              } else if (response.errorBody() != null) {
+                Gson gson = new Gson();
+                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+              }
+            }
+
+            @Override
+            public void onFailure(Call<ForgotPasswordResponse> call, Throwable t) {
+              if (progressDialog != null && progressDialog.isShowing()) {
+                progressDialog.dismiss();
+              }
+              GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+          });
+
+        } catch (Exception e) {
+          e.printStackTrace();
+        }
+      } else {
+        GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+      }
+    }
+  }
+
+  private void showOtpPopUp(String mobileNo, String otpexpirytime) {
+    if (mobileNo == null || mobileNo.trim().isEmpty()) {
+      GlobalData.showToast(getBaseContext(), "Invalid Mobile Number", Toast.LENGTH_SHORT).show();
+      return;
+    }
+    View view = LayoutInflater.from(ForgotPasswordActivity.this).inflate(
+            R.layout.otp_popup, null);
+
+    pinview = (PinView) view.findViewById(R.id.pinView);
+
+
+    TextView mobileNumTextView = view.findViewById(R.id.mobileNo);
+    final TextView resentOtpTxt = view.findViewById(R.id.resentOtp);
+    resentOtpTxt.setEnabled(false);
+    resentOtpTxt.setAlpha(0.5f);
+
+    final TextView count_time = view.findViewById(R.id.count_time);
+    view.findViewById(R.id.btn_cancel).setOnClickListener(
+            new View.OnClickListener() {
+              @Override
+              public void onClick(View v) {
+                alertDialog.dismiss();
+              }
+            });
+    resentOtpTxt.setOnClickListener(
+            new View.OnClickListener() {
+              @Override
+              public void onClick(View v) {
+                alertDialog.dismiss();
+                reSentOtp();
+              }
+            });
+    view.findViewById(R.id.btn_submit).setOnClickListener(
+            new View.OnClickListener() {
+              @Override
+              public void onClick(View v) {
+                if (pinview.getText().toString().equalsIgnoreCase("")) {
+                  GlobalData.showToast(getBaseContext(), "Please enter OTP", Toast.LENGTH_SHORT).show();
+                  return;
+                }
+                otpValidation(pinview.getText().toString());
+
+              }
+            });
+
+    int millsec = Integer.parseInt(otpexpirytime) * 60 * 1000;
+    new android.os.CountDownTimer(millsec, 1000) {
+      public void onTick(long millisUntilFinished) {
+
+        String formattedTime = String.format("%02d:%02d Sec",
+                TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % TimeUnit.HOURS.toMinutes(1),
+                TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % TimeUnit.MINUTES.toSeconds(1));
+        count_time.setText(formattedTime);
+        counter++;
+      }
+
+      public void onFinish() {
+        count_time.setText("00:00");
+        resentOtpTxt.setEnabled(true);
+        resentOtpTxt.setAlpha(1f);
+      }
+    }.start();
+
+    Paint p = new Paint();
+    p.setColor(getResources().getColor(R.color.btn_bg_color));
+    resentOtpTxt.setPaintFlags(resentOtpTxt.getPaintFlags() | p.UNDERLINE_TEXT_FLAG);
+    String alterStr = new StringBuilder(mobileNo).replace(2, 7, "XXXXX").toString();
+    mobileNumTextView.setText(alterStr);
+    alertDialogBuilder = new AlertDialog.Builder(ForgotPasswordActivity.this);
+    alertDialogBuilder.setCancelable(false);
+    alertDialogBuilder.setView(view);
+    alertDialog = alertDialogBuilder.create();
+    alertDialog.show();
+    setupUI(alertDialog.getWindow().getDecorView());
+    view.setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View view) {
+        try {
+          InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+          imm.hideSoftInputFromWindow(pinview.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
+        } catch (Exception e) {
+          e.printStackTrace();
+        }
+
+
+      }
+    });
+  }
+
+  private void otpValidation(String otp) {
+    if (new UtilService().isNetworkAvailable(ForgotPasswordActivity.this)) {
+      progressDialog = new TransparentProgressDialog(ForgotPasswordActivity.this);
+      progressDialog.show();
+
+      try {
+        HashMap<String, String> map = new HashMap<>();
+        map.put("otp", otp);
+        map.put("type", "forgot_password");
+        map.put("username", userName.getText().toString());
+        restService.OtpValidation(map).enqueue(new Callback<UserResponse>() {
+          @Override
+          public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+            user = response.body();
+            if (progressDialog != null && progressDialog.isShowing()) {
+              progressDialog.dismiss();
+            }
+
+            if (user != null && user.getStatus() == 200) {
+              ((MainApplication) getApplication()).addAccessToken(String.format("Bearer %s", user.getAccess_token().trim()));
+              restService = ((MainApplication) getApplication()).getClient();
+              Intent i = new Intent(ForgotPasswordActivity.this, ResetPasswordActivity.class);
+              i.putExtra("username", userName.getText().toString().trim());
+              startActivity(i);
+              finish();
+            } else if (user != null) {
+              GlobalData.showToast(getBaseContext(), user.getMessage(), Toast.LENGTH_SHORT).show();
+
+            } else if (response.errorBody() != null) {
+              Gson gson = new Gson();
+              ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+              GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+
+            }
+
+
+          }
+
+          @Override
+          public void onFailure(Call<UserResponse> call, Throwable t) {
+            if (progressDialog != null && progressDialog.isShowing()) {
+              progressDialog.dismiss();
+            }
+            GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+          }
+        });
+
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
+    } else {
+      GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+    }
+
+  }
+
+  public void reSentOtp() {
+    if (new UtilService().isNetworkAvailable(ForgotPasswordActivity.this)) {
+      progressDialog = new TransparentProgressDialog(ForgotPasswordActivity.this);
+      progressDialog.show();
+      try {
+        HashMap<String, String> map = new HashMap<>();
+        map.put("username", userName.getText().toString());
+
+        restService.sentOtp(map).enqueue(new Callback<OtpResponse>() {
+          @Override
+          public void onResponse(Call<OtpResponse> call, Response<OtpResponse> response) {
+            errorResponse = response.body();
+            if (progressDialog != null && progressDialog.isShowing()) {
+              progressDialog.dismiss();
+            }
+            if (errorResponse != null && errorResponse.getStatus() == 200) {
+              showOtpPopUp(signup.getData(), errorResponse.getData().getOtp_expiry());
+            } else if (errorResponse != null) {
+              GlobalData.showToast(getBaseContext(), errorResponse.getMessage(), Toast.LENGTH_SHORT).show();
+            } else if (response.errorBody() != null) {
+              Gson gson = new Gson();
+              ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+              GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+            }
+
+
+          }
+
+          @Override
+          public void onFailure(Call<OtpResponse> call, Throwable t) {
+            if (progressDialog != null && progressDialog.isShowing()) {
+              progressDialog.dismiss();
+            }
+            GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+          }
+        });
+
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
+    } else {
+      GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+    }
+
+  }
+
+  private void showPopup(String emailIdString) {
+    View view = LayoutInflater.from(ForgotPasswordActivity.this).inflate(
+            R.layout.password_popup, null);
+    view.findViewById(R.id.okButton).setOnClickListener(
+            new View.OnClickListener() {
+
+              @Override
+              public void onClick(View v) {
+                alertDialog.dismiss();
+                finish();
+                ForgotPasswordActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                        R.anim.animation_f_leave);
+              }
+            });
+    TextView linkView = view.findViewById(R.id.linkView);
+    linkView.setText(linkView.getText().toString().trim() + " " + emailIdString);
+    alertDialogBuilder = new AlertDialog.Builder(ForgotPasswordActivity.this);
+    alertDialogBuilder.setCancelable(false);
+    alertDialogBuilder.setView(view);
+    alertDialog = alertDialogBuilder.create();
+    alertDialog.show();
+  }
+
+  public void setupUI(View view) {
+    try {
+      if (!(view instanceof EditText)) {
+        view.setOnTouchListener(new View.OnTouchListener() {
+          @SuppressLint("ClickableViewAccessibility")
+          public boolean onTouch(View v, MotionEvent event) {
+            hideSoftKeyboard(ForgotPasswordActivity.this);
+            return false;
+          }
+        });
+      }
+
+      if (view instanceof ViewGroup) {
+        for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+          View innerView = ((ViewGroup) view).getChildAt(i);
+          setupUI(innerView);
+        }
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+  private void checkPermission() {
+    if (Build.VERSION.SDK_INT >= 23) {
+      ArrayList<String> listPermissionsNeeded = new ArrayList<>();
+      if (checkSelfPermission(Manifest.permission.READ_SMS) == PackageManager.PERMISSION_DENIED) {
+        listPermissionsNeeded
+                .add(android.Manifest.permission.READ_SMS);
+        listPermissionsNeeded
+                .add(android.Manifest.permission.READ_SMS);
+      }
+
+      if (!listPermissionsNeeded.isEmpty())
+        ActivityCompat.requestPermissions(this, listPermissionsNeeded
+                .toArray(new String[listPermissionsNeeded.size()]), 1);
+
+    }
+  }
+
+}

ファイルの差分が大きいため隠しています
+ 1444 - 0
Android/app/src/main/java/com/cygnusa/hyperm/HomeActivity.java


+ 627 - 0
Android/app/src/main/java/com/cygnusa/hyperm/HyperMEnquiryForm.java

@@ -0,0 +1,627 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.app.Dialog;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Build;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.view.Window;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ProgressBar;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.dbadapters.CustomerEnquiryDataAdapters;
+import com.cygnusa.hyperm.swipe.EnquirySwipeSelector;
+import com.cygnusa.hyperm.swipe.OnSwipeItemSelectedListener;
+import com.cygnusa.hyperm.swipe.SwipeItem;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.CommonMethods;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.CustomerEnquiryModel;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.GetAllExploreModel;
+import com.cygnusa.hyperm.wrappers.GetAllPersonalizationModel;
+import com.cygnusa.hyperm.wrappers.SendEnquiryDataModel;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class HyperMEnquiryForm extends AppCompatActivity implements View.OnClickListener, OnSwipeItemSelectedListener {
+    EnquirySwipeSelector swipeSelector;
+    ProgressBar progressBar;
+    StorePreference storePreference;
+    private Spinner spnVariant;
+    EditText edtCustName, edtMobNumber, edtEmailAddress;
+    ImageView imgCheck, backButton, img_rating;
+    Button btnSend, btn_tv_send;
+    String VariantId, selectedModel;
+    int position = 1;
+    ApiService restService;
+    private boolean isChecked = true;
+    LinearLayout llout_buttons, llout_lay;
+    private GetAllExploreModel exploreModel;
+    ArrayAdapter<String> spinnerArrayAdapter = null;
+    ImageView img_close;
+    private GetAllPersonalizationModel personalizationModel;
+    LinearLayout lloutCheckTerms;
+    List<String> stringList = new ArrayList<>();
+    String modelId = "";
+    private HashMap<String, String> enquiryDetailsMap;
+    private TransparentProgressDialog progressDialog;
+    private TextView txtBikeModel;
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_enquiry_form);
+        swipeSelector = findViewById(R.id.swipeSelector);
+        progressBar = findViewById(R.id.progress);
+        progressBar.setVisibility(View.GONE);
+        storePreference = new StorePreference(this);
+        backButton = findViewById(R.id.backButton);
+        txtBikeModel = findViewById(R.id.bike_model);
+        backButton.setOnClickListener(this);
+        llout_lay = findViewById(R.id.linear);
+        llout_buttons = findViewById(R.id.llout_buttons);
+        llout_buttons.setOnClickListener(this);
+        img_rating = findViewById(R.id.img_rating);
+        img_rating.setOnClickListener(this);
+        img_close = findViewById(R.id.img_close);
+        img_close.setOnClickListener(this);
+        btn_tv_send = findViewById(R.id.btn_tv_send);
+        btn_tv_send.setOnClickListener(this);
+        lloutCheckTerms = findViewById(R.id.lloutCheckTerms);
+        personalizationModel = new GetAllPersonalizationModel();
+        exploreModel = new GetAllExploreModel();
+        spnVariant = findViewById(R.id.spnVariant);
+        restService = ((MainApplication) getApplication()).getClient();
+        edtCustName = findViewById(R.id.edtCustName);
+        edtMobNumber = findViewById(R.id.edtMobNumer);
+        edtEmailAddress = findViewById(R.id.edtEmailAddress);
+        imgCheck = findViewById(R.id.imgCheck);
+        btnSend = findViewById(R.id.btn_send);
+        progressDialog = new TransparentProgressDialog(HyperMEnquiryForm.this);
+        btnSend.setOnClickListener(this);
+        imgCheck.setOnClickListener(this);
+        modelId = storePreference.getStringValue(GlobalData.SELECTED_MODEL);
+        swipeSelector.setOnItemSelectedListener(this);
+
+        spnVariant.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+            @Override
+            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+                VariantId = personalizationModel.getPersonalizationDataModelList().get(position).getId();
+            }
+
+            @Override
+            public void onNothingSelected(AdapterView<?> parent) {
+
+            }
+        });
+
+        if (CommonMethods.isNetworkAvailable(this)) {
+            getAllExploreImageDataList();
+            // getAllPersonalizationDetails("1");
+        } else {
+            checkLocalData();
+            getAllExploreLocalDataModel();
+        }
+        if (GlobalData.user.getData().getRole().equalsIgnoreCase("16")) {
+            llout_buttons.setVisibility(View.VISIBLE);
+            btn_tv_send.setVisibility(View.VISIBLE);
+            btnSend.setVisibility(View.GONE);
+            lloutCheckTerms.setVisibility(View.GONE);
+            edtCustName.setText(storePreference.getStringValue(GlobalData.DETAIL_NAME));
+            edtEmailAddress.setText(storePreference.getStringValue(GlobalData.DETAIL_EMAIL));
+            edtMobNumber.setText(storePreference.getStringValue(GlobalData.DETAIL_MOBILE));
+//            edtMobNumber.setShowSoftInputOnFocus(false);
+//            edtEmailAddress.setShowSoftInputOnFocus(false);
+//            edtCustName.setShowSoftInputOnFocus(false);
+        } else {
+            llout_buttons.setVisibility(View.GONE);
+            llout_buttons.setVisibility(View.GONE);
+            btn_tv_send.setVisibility(View.GONE);
+            btnSend.setVisibility(View.VISIBLE);
+            lloutCheckTerms.setVisibility(View.VISIBLE);
+        }
+
+        if (CommonMethods.isNetworkAvailable(this)) {
+            sendOfflineEnquiryDataToServer();
+        }
+        int selectVal = 0;
+        try {
+            selectVal = Integer.parseInt(storePreference.getStringValue(GlobalData.SELECTED_MODEL));
+        } catch (NumberFormatException e) {
+            e.printStackTrace();
+        }
+        getAllPersonalizationDetails(String.valueOf(selectVal));
+    }
+
+    private void getAllExploreLocalDataModel() {
+        SharedPreferences pref = Objects.requireNonNull(this).getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+        if (pref.getString("ENQUIRY_FORM_EXPLORE_IMAGE" + storePreference.getStringValue(GlobalData.SELECTED_MODEL), null) != null) {
+            Gson gson = new Gson();
+            exploreModel = gson.fromJson(
+                    pref.getString("ENQUIRY_FORM_EXPLORE_IMAGE" + storePreference.getStringValue(GlobalData.SELECTED_MODEL), null),
+                    new TypeToken<GetAllExploreModel>() {
+                    }.getType());
+            assert exploreModel != null;
+            if (exploreModel.getData() != null && exploreModel.getData().size() > 0) {
+                SwipeItem[] swipeItems = new SwipeItem[exploreModel.getData().size()];
+                for (int i = 0; i < exploreModel.getData().size(); i++) {
+                    SwipeItem item = new SwipeItem("test", exploreModel.getData().get(i).getModelEnquiryUrl(), exploreModel.getData().get(i).getModelId());
+                    swipeItems[i] = item;
+                }
+                swipeSelector.setItems(swipeItems);
+            }
+
+        }
+    }
+
+    private void checkLocalData() {
+        SharedPreferences pref = Objects.requireNonNull(this).getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+        if (pref.getString("ENQUIRY_FORM_" + storePreference.getStringValue(GlobalData.SELECTED_MODEL), null) != null) {
+            Gson gson = new Gson();
+            personalizationModel = gson.fromJson(
+                    pref.getString("ENQUIRY_FORM_" + storePreference.getStringValue(GlobalData.SELECTED_MODEL), null),
+                    new TypeToken<GetAllPersonalizationModel>() {
+                    }.getType());
+            stringList = new ArrayList<>();
+            for (int i = 0; i < personalizationModel.getPersonalizationDataModelList().size(); i++) {
+                stringList.add(personalizationModel.getPersonalizationDataModelList().get(i).getTitle());
+            }
+            spinnerArrayAdapter = new ArrayAdapter<String>(
+                    HyperMEnquiryForm.this, R.layout.spinner_item, stringList);
+            spnVariant.setAdapter(spinnerArrayAdapter);
+        } else {
+            llout_lay.setVisibility(View.INVISIBLE);
+            txtBikeModel.setVisibility(View.INVISIBLE);
+            personalizationModel = new GetAllPersonalizationModel();
+            stringList = new ArrayList<>();
+            stringList.add("No Data");
+            spinnerArrayAdapter = new ArrayAdapter<String>(
+                    HyperMEnquiryForm.this, R.layout.spinner_item, stringList);
+            spnVariant.setAdapter(spinnerArrayAdapter);
+
+        }
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+    }
+
+    private void getAllPersonalizationDetails(String s) {
+        progressBar.setVisibility(View.VISIBLE);
+        restService.getAllPersonalizationModel(s).enqueue(new Callback<GetAllPersonalizationModel>() {
+            @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
+            @Override
+            public void onResponse(@NonNull Call<GetAllPersonalizationModel> call, @NonNull Response<GetAllPersonalizationModel> response) {
+                progressBar.setVisibility(View.GONE);
+                SharedPreferences pref = HyperMEnquiryForm.this.getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+                SharedPreferences.Editor editor = pref.edit();
+                personalizationModel = new GetAllPersonalizationModel();
+                if (response.body() != null && response.body().getStatus() == 200) {
+                    if (response.body().getPersonalizationDataModelList().size() > 0) {
+                        llout_lay.setVisibility(View.VISIBLE);
+                        txtBikeModel.setVisibility(View.VISIBLE);
+                        personalizationModel = response.body();
+                        if (personalizationModel.getPersonalizationDataModelList() != null && personalizationModel.getPersonalizationDataModelList().size() > 0)
+                            VariantId = personalizationModel.getPersonalizationDataModelList().get(0).getId();
+                        Gson gson = new Gson();
+                        JsonElement jsonElement = gson.toJsonTree(
+                                personalizationModel, new TypeToken<GetAllPersonalizationModel>() {
+                                }.getType());
+                        editor.putString("ENQUIRY_FORM_" + storePreference.getStringValue(GlobalData.SELECTED_MODEL),
+                                jsonElement.toString()).apply();
+                        stringList = new ArrayList<>();
+                        for (int i = 0; i < personalizationModel.getPersonalizationDataModelList().size(); i++) {
+                            stringList.add(personalizationModel.getPersonalizationDataModelList().get(i).getTitle());
+                        }
+                        spinnerArrayAdapter = new ArrayAdapter<String>(
+                                HyperMEnquiryForm.this, R.layout.spinner_item, stringList);
+                        spnVariant.setAdapter(spinnerArrayAdapter);
+
+                    } else {
+                        checkLocalData();
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.body() != null && response.body().getStatus() == 406) {
+                    checkLocalData();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(HyperMEnquiryForm.this, message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                    checkLocalData();
+                } else {
+                    checkLocalData();
+                }
+            }
+
+            @Override
+            public void onFailure(Call<GetAllPersonalizationModel> call, Throwable t) {
+                progressBar.setVisibility(View.GONE);
+                if (t.getMessage() != null) {
+                    Log.e("Server Error", t.getMessage());
+                    checkLocalData();
+                }
+            }
+        });
+    }
+
+    private void getAllExploreImageDataList() {
+        restService.getAllExploreImage().enqueue(new Callback<GetAllExploreModel>() {
+            @Override
+            public void onResponse(@NonNull Call<GetAllExploreModel> call, @NonNull Response<GetAllExploreModel> response) {
+                if (response.body() != null) {
+                    SharedPreferences pref = HyperMEnquiryForm.this.getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+                    SharedPreferences.Editor editor = pref.edit();
+                    if (response.body().getData().size() > 0) {
+                        exploreModel = response.body();
+                        Gson gson = new Gson();
+                        JsonElement jsonElement = gson.toJsonTree(
+                                exploreModel, new TypeToken<GetAllExploreModel>() {
+                                }.getType());
+                        editor.putString("ENQUIRY_FORM_EXPLORE_IMAGE" + storePreference.getStringValue(GlobalData.SELECTED_MODEL),
+                                jsonElement.toString()).apply();
+                        SwipeItem[] swipeItems = new SwipeItem[response.body().getData().size()];
+                        for (int i = 0; i < response.body().getData().size(); i++) {
+                            SwipeItem item = new SwipeItem("test", response.body().getData().get(i).getModel_brochure_image_url(), response.body().getData().get(i).getModelId());
+                            swipeItems[i] = item;
+                        }
+                        getAllPersonalizationDetails(response.body().getData().get(0).getModelId());
+                        swipeSelector.setItems(swipeItems);
+                    } else {
+                        getAllExploreLocalDataModel();
+                    }
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(HyperMEnquiryForm.this, message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                        finish();
+                    }
+                    getAllExploreLocalDataModel();
+                } else {
+                    getAllExploreLocalDataModel();
+                }
+            }
+
+            @Override
+            public void onFailure(Call<GetAllExploreModel> call, Throwable t) {
+                getAllExploreLocalDataModel();
+            }
+        });
+    }
+
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()) {
+            case R.id.backButton:
+                onBackPressed();
+                break;
+            case R.id.img_close:
+                openCloseAlertBox();
+                break;
+            case R.id.img_rating:
+                startActivity(new Intent(HyperMEnquiryForm.this, ProductFeedbackFormActivity.class));
+                break;
+            case R.id.imgCheck:
+                if (!isChecked) {
+                    imgCheck.setImageResource(android.R.drawable.checkbox_on_background);
+                    isChecked = true;
+                } else {
+                    imgCheck.setImageResource(android.R.drawable.checkbox_off_background);
+                    isChecked = false;
+                }
+                break;
+            case R.id.btn_send:
+                checkFieldEmpty();
+                break;
+            case R.id.btn_tv_send:
+                checkFieldEmpty();
+                break;
+            default:
+        }
+    }
+
+    private void openCloseAlertBox() {
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.popup_alert_close);
+        aDialog.setCancelable(true);
+        TextView aAlertMessage = aDialog.findViewById(R.id.txt_alert_message);
+        aAlertMessage.setText(String.format("Dear %s", storePreference.getStringValue(GlobalData.PRODUCT_NAME)));
+        aDialog.show();
+        Button btnYes = aDialog.findViewById(R.id.btn_yes);
+        Button btnNo = aDialog.findViewById(R.id.btn_no);
+        btnYes.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+                openFeedbackAlertBox();
+                aDialog.dismiss();
+            }
+        });
+        btnNo.setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View arg0) {
+                // TODO Auto-generated method stub
+                aDialog.dismiss();
+            }
+
+        });
+
+
+    }
+
+    private void openFeedbackAlertBox() {
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.popup_alert_feedback);
+        aDialog.setCancelable(true);
+        TextView aAlertMessage = aDialog.findViewById(R.id.txt_alert_message);
+        aAlertMessage.setText(String.format("Dear %s", storePreference.getStringValue(GlobalData.PRODUCT_NAME)));
+        aDialog.show();
+        TextView txtSkip;
+        ImageView imgClose;
+        imgClose = aDialog.findViewById(R.id.img_close);
+        txtSkip = aDialog.findViewById(R.id.txtSkip);
+        imgClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                aDialog.dismiss();
+            }
+        });
+        txtSkip.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                aDialog.dismiss();
+                startActivity(new Intent(HyperMEnquiryForm.this, ProductExplorerActivity.class));
+                finish();
+            }
+        });
+        Button btnYes = aDialog.findViewById(R.id.btn_yes);
+        btnYes.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                aDialog.dismiss();
+                startActivity(new Intent(HyperMEnquiryForm.this, ProductFeedbackFormActivity.class));
+                finish();
+
+            }
+        });
+    }
+
+    private void hideKeyboard(Activity activity) {
+        InputMethodManager inputMethodManager =
+                (InputMethodManager) activity.getSystemService(
+                        Activity.INPUT_METHOD_SERVICE);
+        inputMethodManager.hideSoftInputFromWindow(
+                Objects.requireNonNull(activity.getCurrentFocus()).getWindowToken(), 0);
+    }
+
+    @SuppressLint("SetTextI18n")
+    private void openAlertBox() {
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.popup_alert_box);
+        aDialog.setCancelable(true);
+        TextView aAlertMessage = aDialog.findViewById(R.id.txt_alert_message);
+        TextView description = aDialog.findViewById(R.id.description);
+
+        if (!isChecked) {
+            description.setText("Thank you for showing your interest in HYPER-M.");
+        }
+
+        aAlertMessage.setText(String.format("Dear %s", edtCustName.getText().toString().trim()));
+        aDialog.show();
+        Button aButton = aDialog.findViewById(R.id.btn_alert);
+        aButton.setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View arg0) {
+                aDialog.dismiss();
+                onBackPressed();
+            }
+
+        });
+    }
+
+    public boolean validateEmailID(String str) {
+        return str.contains("@") && str.lastIndexOf(".") != -1;
+    }
+
+    private void checkFieldEmpty() {
+        if (edtCustName.getText().toString().equalsIgnoreCase("")) {
+            GlobalData.showToast(this, "Enter name", Toast.LENGTH_LONG).show();
+        } else if (edtMobNumber.getText().toString().equalsIgnoreCase("")) {
+            GlobalData.showToast(this, "Enter mobile number", Toast.LENGTH_LONG).show();
+        } else if (edtEmailAddress.getText().toString().equalsIgnoreCase("")) {
+            GlobalData.showToast(this, "Enter E-mail address", Toast.LENGTH_LONG).show();
+        } else if (edtMobNumber.getText().length() < 10) {
+            GlobalData.showToast(this, "Enter your valid mobile number.", Toast.LENGTH_LONG).show();
+        } else if (!validateEmailID(edtEmailAddress.getText().toString())) {
+            GlobalData.showToast(this, "Please enter your valid email id", Toast.LENGTH_LONG).show();
+        } else {
+
+            enquiryDetailsMap = new HashMap<>();
+            enquiryDetailsMap.put("current_time", storePreference.getStringValue(GlobalData.CURRENTTIME));
+            enquiryDetailsMap.put("variant_id", VariantId);
+            enquiryDetailsMap.put("name", edtCustName.getText().toString());
+            enquiryDetailsMap.put("model_id", modelId);
+            enquiryDetailsMap.put("mobile", edtMobNumber.getText().toString());
+            enquiryDetailsMap.put("is_brochure", isChecked ? "1" : "0");
+            enquiryDetailsMap.put("email", edtEmailAddress.getText().toString());
+            if (CommonMethods.isNetworkAvailable(this)) {
+                sendOfflineEnquiryDataToServer();
+                sendAllCustomerEnquiry();
+            } else {
+                insetDetailsToLocalDB();
+            }
+        }
+    }
+
+    private void sendOfflineEnquiryDataToServer() {
+        CustomerEnquiryModel detailsModel = new CustomerEnquiryModel();
+        CustomerEnquiryDataAdapters customerEnquiryDataAdapters = new CustomerEnquiryDataAdapters(HyperMEnquiryForm.this);
+        List<SendEnquiryDataModel> getAllOfflineData = customerEnquiryDataAdapters.getAllEnquiryFromTable();
+        List<SendEnquiryDataModel> allEnquiryData = new ArrayList<>();
+        if (getAllOfflineData != null && getAllOfflineData.size() > 0) {
+            detailsModel.setEmp_code(GlobalData.user.getData().getEmp_code());
+            detailsModel.setSmpin(GlobalData.user.getData().getSmpin());
+            for (int i = 0; i < getAllOfflineData.size(); i++) {
+                SendEnquiryDataModel customerData = new SendEnquiryDataModel();
+                customerData.setModelId(getAllOfflineData.get(i).getModelId());
+                customerData.setIsBrochure(getAllOfflineData.get(i).getIsBrochure());
+                customerData.setEmail(getAllOfflineData.get(i).getEmail());
+                customerData.setName(getAllOfflineData.get(i).getName());
+                customerData.setVariantId(getAllOfflineData.get(i).getVariantId());
+                customerData.setMobile(getAllOfflineData.get(i).getMobile());
+                customerData.setUid(getAllOfflineData.get(i).getUid());
+                allEnquiryData.add(customerData);
+            }
+            detailsModel.setCust_enquiry(allEnquiryData);
+            if (detailsModel.getCust_enquiry() != null && detailsModel.getCust_enquiry().size() > 0) {
+                restService.sendAllCustomerEnquiry(detailsModel).enqueue(new Callback<CommonResponse>() {
+                    @Override
+                    public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                        progressBar.setVisibility(View.GONE);
+                        if (response.body() != null) {
+                            if (response.body().getStatus() == 200) {
+                                openAlertBox();
+                                edtCustName.setText("");
+                                edtEmailAddress.setText("");
+                                edtMobNumber.setText("");
+                            } else {
+                                GlobalData.showToast(HyperMEnquiryForm.this, response.body().getMessage(), Toast.LENGTH_LONG).show();
+                            }
+                        } else {
+                            if (response.errorBody() != null) {
+                                CommonMethods.errorShow(HyperMEnquiryForm.this, response.errorBody());
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<CommonResponse> call, Throwable t) {
+                        progressBar.setVisibility(View.GONE);
+                    }
+                });
+            }
+        }
+    }
+
+    private void insetDetailsToLocalDB() {
+        CustomerEnquiryDataAdapters customerEnquiryDataAdapters = new CustomerEnquiryDataAdapters(HyperMEnquiryForm.this);
+        if (!customerEnquiryDataAdapters.checkRecordExists(edtMobNumber.getText().toString())) {
+            customerEnquiryDataAdapters.insertEnquiryDetails(enquiryDetailsMap);
+            clearField();
+        } else {
+            clearField();
+        }
+    }
+
+    private void clearField() {
+        edtCustName.setText("");
+        edtEmailAddress.setText("");
+        edtMobNumber.setText("");
+    }
+
+    private void sendAllCustomerEnquiry() {
+        progressDialog.show();
+        restService.sendAllCustomerEnquiry(buildCustConfigData()).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                if (response.body() != null) {
+                    if (response.body().getStatus() == 200) {
+                        openAlertBox();
+                        edtCustName.setText("");
+                        edtEmailAddress.setText("");
+                        edtMobNumber.setText("");
+                    } else {
+                        GlobalData.showToast(HyperMEnquiryForm.this, response.body().getMessage(), Toast.LENGTH_LONG).show();
+                    }
+                } else {
+                    if (response.errorBody() != null) {
+                        CommonMethods.errorShow(HyperMEnquiryForm.this, response.errorBody());
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+                progressBar.setVisibility(View.GONE);
+            }
+        });
+    }
+
+    private CustomerEnquiryModel buildCustConfigData() {
+        CustomerEnquiryModel enquiryModel = new CustomerEnquiryModel();
+        List<SendEnquiryDataModel> enquiryDataModel = new ArrayList<>();
+        enquiryModel.setEmp_code(GlobalData.user.getData().getEmp_code());
+        enquiryModel.setSmpin(GlobalData.user.getData().getSmpin());
+        SendEnquiryDataModel dataModel = new SendEnquiryDataModel();
+        dataModel.setEmail(edtEmailAddress.getText().toString());
+        dataModel.setMobile(edtMobNumber.getText().toString());
+        dataModel.setName(edtCustName.getText().toString());
+        dataModel.setVariantId(VariantId);
+        dataModel.setIsBrochure(isChecked ? "1" : "0");
+        dataModel.setModelId(Integer.valueOf(modelId));
+        dataModel.setUid(storePreference.getStringValue(GlobalData.CURRENTTIME));
+        enquiryDataModel.add(dataModel);
+        enquiryModel.setCust_enquiry(enquiryDataModel);
+        return enquiryModel;
+    }
+
+    @Override
+    public void onItemSelected(SwipeItem item) {
+        selectedModel = item.getDescription();
+        modelId = item.getDescription();
+        storePreference.setString(GlobalData.SELECTED_MODEL, selectedModel);
+        position = Integer.parseInt(item.getDescription());
+        getAllPersonalizationDetails(String.valueOf(position));
+    }
+}

+ 135 - 0
Android/app/src/main/java/com/cygnusa/hyperm/IndroScreen.java

@@ -0,0 +1,135 @@
+package com.cygnusa.hyperm;
+
+import android.content.Intent;
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentStatePagerAdapter;
+import androidx.viewpager.widget.ViewPager;
+import androidx.appcompat.app.AppCompatActivity;
+import android.view.View;
+import android.view.animation.TranslateAnimation;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+
+import com.ogaclejapan.smarttablayout.SmartTabLayout;
+import com.cygnusa.hyperm.fragments.IndroFragment;
+import com.cygnusa.hyperm.util.BackgroundToForegroundTransformerNew;
+import com.cygnusa.hyperm.util.ViewPagerCustomDuration;
+
+
+public class IndroScreen extends AppCompatActivity {
+
+    ViewPagerCustomDuration viewPager;
+    SmartTabLayout viewpagerTab;
+    FrameLayout frameLayout;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_indro_screen);
+        ImageView splashLogo = findViewById(R.id.splashLogo);
+        setupWindowAnimations();
+        viewPager = findViewById(R.id.viewPager);
+        frameLayout = findViewById(R.id.frame);
+        viewpagerTab = findViewById(R.id.viewpagerTab);
+        viewPager.setPageTransformer(true, new BackgroundToForegroundTransformerNew());
+        viewPager.setScrollDurationFactor(3.0);
+
+
+        frameLayout.setVisibility(View.GONE);
+
+
+        findViewById(R.id.next).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                goLogin();
+
+            }
+        });
+
+        viewPager.post(new Runnable() {
+            @Override
+            public void run() {
+                viewPager.setAdapter(new IndroAdapter(getSupportFragmentManager()));
+                viewpagerTab.setViewPager(viewPager);
+            }
+        });
+
+        viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            @Override
+            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+
+            }
+
+            @Override
+            public void onPageSelected(int position) {
+                if (position == 2) {
+                    if (frameLayout.getVisibility() == View.GONE)
+                        slideToTop(frameLayout);
+                } else {
+                    if (frameLayout.getVisibility() == View.VISIBLE)
+                        slideToBottom(frameLayout);
+                }
+            }
+
+            @Override
+            public void onPageScrollStateChanged(int state) {
+
+            }
+        });
+    }
+
+    public void slideToBottom(View view) {
+        TranslateAnimation animate = new TranslateAnimation(0, 0, 0, view.getHeight());
+        animate.setDuration(500);
+        animate.setFillAfter(true);
+        view.startAnimation(animate);
+        view.setVisibility(View.GONE);
+    }
+
+    public void slideToTop(View view) {
+        TranslateAnimation animate = new TranslateAnimation(0, 0, view.getHeight(), 0);
+        animate.setDuration(500);
+        animate.setFillAfter(true);
+        view.startAnimation(animate);
+        view.setVisibility(View.VISIBLE);
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    private void goLogin() {
+        startActivity(new Intent(getBaseContext(), LoginActivity.class));
+        finish();
+    }
+
+    public class IndroAdapter extends FragmentStatePagerAdapter {
+
+
+        private IndroAdapter(FragmentManager fm) {
+            super(fm);
+        }
+
+        @Override
+        public Fragment getItem(int position) {
+            IndroFragment fragment = new IndroFragment();
+            fragment.setPosition(position);
+            return fragment;
+        }
+
+        @Override
+        public int getCount() {
+            return 3;
+        }
+
+
+        @Override
+        public CharSequence getPageTitle(int position) {
+            return "";
+        }
+    }
+}

+ 263 - 0
Android/app/src/main/java/com/cygnusa/hyperm/LearningPathActivity.java

@@ -0,0 +1,263 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Handler;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.appcompat.widget.Toolbar;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.adapter.LearningPathAdapter;
+import com.cygnusa.hyperm.fancyshowcase.FancyShowCaseView;
+import com.cygnusa.hyperm.fancyshowcase.FocusShape;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.LearningPath;
+import com.cygnusa.hyperm.wrappers.LearningPathResponse;
+import com.tylersuehr.esr.EmptyStateRecyclerView;
+import com.tylersuehr.esr.TextStateDisplay;
+
+import java.util.ArrayList;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class LearningPathActivity extends AppCompatActivity {
+    View mainView;
+
+
+    TransparentProgressDialog progressDialog;
+    ApiService restService;
+    ArrayList<LearningPath> MY_LEARNING_PATH = new ArrayList<>();
+
+    private int SHOWCASE_POSITION = 0;
+    EmptyStateRecyclerView learningPath;
+
+    public static Handler.Callback callback;
+    LearningPathAdapter adapter;
+    LinearLayoutManager linearLayoutManager;
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_learning_path);
+        setupWindowAnimations();
+        setupUI(findViewById(R.id.bgLayout));
+        restService = ((MainApplication)getApplication()).getClient();
+        learningPath =findViewById(R.id.learningPath);
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setNavigationIcon(R.mipmap.back);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        learningPath.post(new Runnable() {
+            @Override
+            public void run() {
+                getLearningPath();
+            }
+        });
+        findViewById(R.id.helpIcon).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                //  showHelpScreen();
+            }
+        });
+
+    }
+
+    private void getLearningPath() {
+
+        if (new UtilService().isNetworkAvailable(this)) {
+            progressDialog = new TransparentProgressDialog(this);
+            progressDialog.show();
+
+            try {
+                restService.getLearningPath()
+                        .enqueue(new Callback<LearningPathResponse>() {
+                            @Override
+                            public void onResponse(Call<LearningPathResponse> call, Response<LearningPathResponse> response) {
+                                if (progressDialog != null && progressDialog.isShowing()) {
+                                    progressDialog.dismiss();
+                                }
+
+                                if (response.body() != null && response.body().getStatus() == 200) {
+                                    MY_LEARNING_PATH = response.body().getData();
+
+
+                                    if (MY_LEARNING_PATH == null) {
+                                        MY_LEARNING_PATH = new ArrayList<>();
+                                    }
+
+                                    if (MY_LEARNING_PATH.size() == 0) {
+                                        learningPath.invokeState(EmptyStateRecyclerView.STATE_EMPTY);
+                                    } else {
+                                        learningPath.invokeState(EmptyStateRecyclerView.STATE_OK);
+                                    }
+                                    setLearningPath();
+                                } else if (response.body() != null && response.body().getStatus() == 401) {
+                                    GlobalData.canLogout = true;
+                                    new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                                } else if (response.body() != null) {
+                                    GlobalData.showToast(LearningPathActivity.this, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                                } else if (response.errorBody() != null) {
+                                    Gson gson = new Gson();
+                                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                                    GlobalData.showToast(LearningPathActivity.this, message.getMessage(), Toast.LENGTH_SHORT).show();
+                                    if (message.getStatus() == 401) {
+                                        GlobalData.canLogout = true;
+                                        new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                                    }
+                                }
+                            }
+
+                            @Override
+                            public void onFailure(Call<LearningPathResponse> call, Throwable t) {
+                                if (progressDialog != null && progressDialog.isShowing()) {
+                                    progressDialog.dismiss();
+                                }
+                                GlobalData.showToast(LearningPathActivity.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                            }
+                        });
+
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                GlobalData.showToast(this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+        } else {
+            GlobalData.showToast(this, "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    public void setLearningPath() {
+        learningPath.setHasFixedSize(true);
+        learningPath.setItemAnimator(new SlideInLeftAnimator());
+        linearLayoutManager = new LinearLayoutManager(this);
+        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
+        learningPath.setLayoutManager(linearLayoutManager);
+        learningPath.setStateDisplay(EmptyStateRecyclerView.STATE_EMPTY,
+                new TextStateDisplay(this, "No data available", ""));
+
+        adapter = new LearningPathAdapter(this,  MY_LEARNING_PATH);
+
+        learningPath.setAdapter(adapter);
+
+    }
+
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(LearningPathActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    activity.getCurrentFocus().getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (adapter != null) {
+            adapter.notifyDataSetChanged();
+        }
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    private void showHelpScreen() {
+        try {
+            View view;
+            if (adapter != null && adapter.getItemCount() > 0) {
+                view = learningPath.findViewHolderForAdapterPosition(linearLayoutManager.findFirstVisibleItemPosition()).itemView;
+            } else {
+                view = learningPath;
+            }
+            new FancyShowCaseView.Builder(this)
+                    .focusOn(view)
+                    .title("Tap here to view the PDF or Video")
+                    .titleSize(22, 1)
+                    .closeOnTouch(true)
+                    .fitSystemWindows(false)
+                    .focusShape(FocusShape.ROUNDED_RECTANGLE)
+                    .backgroundColor(Color.parseColor("#99000000"))
+                    .build()
+                    .show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            confirmClose();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void confirmClose() {
+        finish();
+        LearningPathActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+
+}

+ 356 - 0
Android/app/src/main/java/com/cygnusa/hyperm/LoginActivity.java

@@ -0,0 +1,356 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
+import android.graphics.Color;
+import android.os.Build;
+import android.os.Bundle;
+import android.text.SpannableString;
+import android.text.TextUtils;
+import android.text.style.UnderlineSpan;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.tooltip.Tooltip;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.UserResponse;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class LoginActivity extends AppCompatActivity {
+    EditText mPasswordView, mEmailView;
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    SharedPreferences preferences;
+    SharedPreferences.Editor editor;
+    StorePreference storePreference;
+
+    @SuppressLint("ClickableViewAccessibility")
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_login);
+        setupWindowAnimations();
+        setupUI(findViewById(R.id.bgLayout));
+        restService = ((MainApplication) getApplication()).getClient();
+        mEmailView = findViewById(R.id.userName);
+        mPasswordView = findViewById(R.id.password);
+        storePreference = new StorePreference(this);
+        TextView textView = findViewById(R.id.notRegistered);
+        SpannableString loginText = new SpannableString("Signup");
+        loginText.setSpan(new UnderlineSpan(), 0, loginText.length(), 0);
+        textView.setText(loginText);
+        mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
+                if (id == 2276) {
+                    attemptLogin();
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        findViewById(R.id.email_sign_in_button).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                attemptLogin();
+            }
+        });
+
+        findViewById(R.id.notRegistered).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                startActivity(new Intent(LoginActivity.this, SignUpActivity.class));
+            }
+        });
+
+        findViewById(R.id.info).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                String header = "-If you are dealer staff enter the SMPIN for registering and logging into the system\n" +
+                        "\n-If you are HYPER-M staff enter your Employee ID for registering and logging into the system";
+                View mView = LayoutInflater.from(LoginActivity.this).inflate(R.layout.login_tooltip_text, null);
+                TextView text = mView.findViewById(R.id.text11);
+                text.setText(header);
+                Tooltip.TooltipView tooltip = Tooltip.make(LoginActivity.this,
+                        new Tooltip.Builder(101)
+                                .anchor(view, Tooltip.Gravity.TOP)
+                                .closePolicy(new Tooltip.ClosePolicy()
+                                        .insidePolicy(true, false)
+                                        .outsidePolicy(true, false), 0)
+                                .activateDelay(300)
+                                .withStyleId(R.style.ToolTipLayoutCustomStyle)
+                                .showDelay(300)
+                                .text("")
+                                .setBgColor(getResources().getColor(R.color.bg_color))
+                                .view(mView)
+                                .maxWidth(300)
+                                .withArrow(true)
+                                .build()
+                );
+                tooltip.setTextColor(Color.WHITE);
+                tooltip.show();
+            }
+        });
+        TextView mTextView = findViewById(R.id.forgotPassword);
+        String udata = mTextView.getText().toString().trim();
+        SpannableString content = new SpannableString(udata);
+        content.setSpan(new UnderlineSpan(), 0, udata.length(), 0);
+        mTextView.setText(content);
+        mTextView.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                startActivity(new Intent(getBaseContext(), ForgotPasswordActivity.class));
+            }
+        });
+        findViewById(R.id.faq).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                startActivity(new Intent(LoginActivity.this, FaqActivity.class));
+                finish();
+            }
+        });
+
+        findViewById(R.id.faq1).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                findViewById(R.id.faq).performClick();
+            }
+        });
+    }
+
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    private void attemptLogin() {
+        String email = mEmailView.getText().toString().trim();
+        String password = mPasswordView.getText().toString().trim();
+
+        boolean cancel = false;
+        View focusView = null;
+        if (TextUtils.isEmpty(email) && TextUtils.isEmpty(password)) {
+            GlobalData.showToast(getBaseContext(), "Please fill in all necessary fields", Toast.LENGTH_SHORT).show();
+            focusView = mEmailView;
+            cancel = true;
+        } else if (TextUtils.isEmpty(email)) {
+            GlobalData.showToast(getBaseContext(), "Please enter the SMPIN", Toast.LENGTH_SHORT).show();
+            focusView = mEmailView;
+            cancel = true;
+        } else if (TextUtils.isEmpty(password)) {
+            GlobalData.showToast(getBaseContext(), "Please enter the password", Toast.LENGTH_SHORT).show();
+            focusView = mPasswordView;
+            cancel = true;
+        }
+
+        if (cancel) {
+            focusView.requestFocus();
+        } else {
+            if (new UtilService().isNetworkAvailable(LoginActivity.this)) {
+                progressDialog = new TransparentProgressDialog(LoginActivity.this);
+                progressDialog.show();
+
+                try {
+                    HashMap<String, String> map = new HashMap<>();
+                    map.put("username", email);
+                    map.put("password", password);
+                    restService.login(map).enqueue(new Callback<UserResponse>() {
+                        @Override
+                        public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+                            GlobalData.user = response.body();
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+                            if (GlobalData.user != null && GlobalData.user.getStatus() == 200) {
+                                getSharedPreferences("FCM_TOKEN", Context.MODE_PRIVATE)
+                                        .edit().putString("FCM_TOKEN_ID", "").apply();
+                                if (Build.VERSION.SDK_INT >= 23) {
+                                    if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
+                                            == PackageManager.PERMISSION_GRANTED) {
+                                        File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                                                + "/" + ".HYPERM", "PDF");
+                                        if (f1.exists()) {
+                                            f1.delete();
+                                        }
+                                    }
+                                } else {
+                                    File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                                            + "/" + ".HYPERM", "PDF");
+                                    if (f1.exists()) {
+                                        f1.delete();
+                                    }
+                                }
+
+                                GlobalData.sdb.delete("session", null, null);
+                                preferences = getSharedPreferences("UserDetails",
+                                        Context.MODE_PRIVATE);
+                                if (!Objects.requireNonNull(preferences.getString("inputUsername", "")).trim()
+                                        .equalsIgnoreCase(mEmailView.getText().toString().trim())) {
+                                    GlobalData.sdb.delete("training", null, null);
+                                    GlobalData.sdb.delete("assessment", null, null);
+                                    GlobalData.sdb.delete("assessment_question", null, null);
+                                    GlobalData.sdb.delete("assessment_answer", null, null);
+                                    GlobalData.sdb.delete("notifications", null, null);
+                                    GlobalData.sdb.delete("notification_readed", null, null);
+                                    GlobalData.sdb.delete("notification_deleted", null, null);
+                                    GlobalData.sdb.delete("banner", null, null);
+                                    GlobalData.sdb.delete("topic", null, null);
+                                    GlobalData.sdb.delete("topic_content", null, null);
+                                }
+                                editor = preferences.edit();
+                                editor.putString("inputUsername", mEmailView.getText().toString().trim());
+                                editor.putString("inputPassword", mPasswordView.getText().toString().trim());
+                                editor.apply();
+                                ((MainApplication) getApplication()).addAccessToken(String.format("Bearer %s", GlobalData.user.getAccess_token().trim()));
+                                restService = ((MainApplication) getApplication()).getClient();
+                                if (GlobalData.user.getData().getIs_first_login().trim().equalsIgnoreCase("1")) {
+                                    startActivity(new Intent(getBaseContext(), SetNewPasswordActivity.class));
+                                    finish();
+                                } else if (GlobalData.user.getData().getIs_password_expired().trim().equalsIgnoreCase("1")) {
+                                    GlobalData.showToast(LoginActivity.this, "Your password is expired, please create new password", Toast.LENGTH_SHORT).show();
+                                    startActivity(new Intent(getBaseContext(), SetNewPasswordActivity.class));
+                                    finish();
+                                } else if (GlobalData.user.getData().getIs_profile_updated().equalsIgnoreCase("0")) {
+                                    startActivity(new Intent(getBaseContext(), MainProfileActivity.class));
+                                    finish();
+                                } else if (GlobalData.user.getData().getRole().equalsIgnoreCase("16")) {
+                                    GlobalData.showToast(getBaseContext(), "You don’t have required permission to log in to the STAR app", Toast.LENGTH_LONG).show();
+                                } else {
+                                    Gson gson = new Gson();
+                                    JsonElement jsonElement = gson.toJsonTree(
+                                            GlobalData.user, new TypeToken<UserResponse>() {
+                                            }.getType());
+                                    ContentValues values = new ContentValues();
+                                    values.put("user", jsonElement.toString());
+                                    GlobalData.sdb.insert("session", null, values);
+                                    GlobalData.zmEmail = "none";
+                                    GlobalData.rmEmail = "none";
+                                    GlobalData.amEmail = "none";
+                                    GlobalData.canLogout = false;
+                                    if (GlobalData.user.getData().getRole().equalsIgnoreCase("4")
+                                            || GlobalData.user.getData().getRole().equalsIgnoreCase("6")
+                                            || GlobalData.user.getData().getRole().equalsIgnoreCase("7")
+                                            || GlobalData.user.getData().getRole().equalsIgnoreCase("3")
+                                            || GlobalData.user.getData().getRole().equalsIgnoreCase("5")
+                                            || GlobalData.user.getData().getRole().equalsIgnoreCase("14")) {
+                                        storePreference.setBoolean(GlobalData.ISDSELOGIN, false);
+                                        startActivity(new Intent(LoginActivity.this, AMHomeActivity.class));
+                                        finish();
+                                    } else if (GlobalData.user.getData().getRole().equalsIgnoreCase("15")) {
+                                        storePreference.setBoolean(GlobalData.ISDSELOGIN, false);
+                                        startActivity(new Intent(LoginActivity.this, SEHomeActivity.class));
+                                        finish();
+                                    } else {
+                                        storePreference.setBoolean(GlobalData.ISDSELOGIN, true);
+                                        startActivity(new Intent(LoginActivity.this, HomeActivity.class));
+                                        finish();
+                                    }
+
+                                }
+
+                            } else if (GlobalData.user != null) {
+                                GlobalData.showToast(getBaseContext(), GlobalData.user.getMessage(), Toast.LENGTH_SHORT).show();
+                            } else if (response.errorBody() != null) {
+                                Gson gson = new Gson();
+                                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            }
+                        }
+
+                        @Override
+                        public void onFailure(Call<UserResponse> call, Throwable t) {
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+                            GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                        }
+                    });
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            } else {
+                GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+            }
+        }
+    }
+
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(LoginActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    Objects.requireNonNull(activity.getCurrentFocus()).getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
+

+ 133 - 0
Android/app/src/main/java/com/cygnusa/hyperm/MainActivity.java

@@ -0,0 +1,133 @@
+package com.cygnusa.hyperm;
+
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import androidx.annotation.NonNull;
+import com.google.android.material.tabs.TabLayout;
+import androidx.core.app.ActivityCompat;
+import androidx.core.content.ContextCompat;
+import androidx.viewpager.widget.ViewPager;
+import androidx.appcompat.app.AppCompatActivity;
+import android.util.Log;
+import android.view.View;
+import android.widget.ImageView;
+
+import com.cygnusa.hyperm.adapter.ViewPagerAdapter;
+import com.cygnusa.hyperm.util.GlobalData;
+
+
+public class MainActivity extends AppCompatActivity implements View.OnClickListener {
+    private static final int PERMISSION_REQUEST_CODE = 1;
+
+    ViewPager viewPager;
+    ViewPagerAdapter viewPagerAdapter;
+    TabLayout tabLayout;
+
+    public static ImageView img_broucher, img_rating;
+    public static ImageView layout1;
+    private Handler.Callback callback;
+   // public int tabTitles[] = new int[]{R.string.exterior_title, R.string.interior_title};
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_explore);
+        initViews();
+
+        if (GlobalData.user.getData().getRole().equalsIgnoreCase("16")) {
+            layout1.setVisibility(View.GONE);
+            img_rating.setVisibility(View.VISIBLE);
+            img_broucher.setVisibility(View.VISIBLE);
+        } else {
+            layout1.setVisibility(View.VISIBLE);
+            img_rating.setVisibility(View.GONE);
+            img_broucher.setVisibility(View.GONE);
+        }
+
+        if (checkPermissionStorage()) {
+            requestPermission();
+        }
+
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        if (GlobalData.user.getData().getRole().equalsIgnoreCase("16")) {
+            startActivity(new Intent(MainActivity.this, ProductWelcomeScreenActivity.class));
+        }
+    }
+
+    private boolean checkPermissionStorage() {
+        int result = ContextCompat.checkSelfPermission(MainActivity.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
+        return result == PackageManager.PERMISSION_GRANTED;
+    }
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+        switch (requestCode) {
+            case PERMISSION_REQUEST_CODE:
+                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+                    Log.e("value", "Permission Granted, Now you can use local drive .");
+                    viewPagerAdapter = new ViewPagerAdapter(MainActivity.this,getSupportFragmentManager());
+                    viewPager.setAdapter(viewPagerAdapter);
+                } else {
+                    Log.e("value", "Permission Denied, You cannot use local drive .");
+                }
+                break;
+        }
+    }
+
+    private void requestPermission() {
+
+        if (!ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
+            ActivityCompat.requestPermissions(MainActivity.this, new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);
+        }
+    }
+
+    private void initViews() {
+        //initHomeFragment(new Hotspot360());
+        viewPager = findViewById(R.id.viewPager);
+        viewPagerAdapter = new ViewPagerAdapter(MainActivity.this,getSupportFragmentManager());
+        viewPager.setAdapter(viewPagerAdapter);
+
+        tabLayout = findViewById(R.id.tabs);
+        tabLayout.setupWithViewPager(viewPager);
+
+        img_broucher = findViewById(R.id.imgBroucher);
+        img_broucher.setOnClickListener(this);
+
+        img_rating = findViewById(R.id.img_rating);
+        img_rating.setOnClickListener(this);
+
+        layout1 = findViewById(R.id.fabEnquiry);
+        layout1.setOnClickListener(this);
+        callback = new Handler.Callback() {
+            @Override
+            public boolean handleMessage(Message msg) {
+                if (GlobalData.canLogout) {
+                    startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                    finish();
+                }
+                return false;
+            }
+        };
+    }
+
+    @Override
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.imgBroucher:
+                startActivity(new Intent(this, HyperMEnquiryForm.class));
+                break;
+            case R.id.img_rating:
+                startActivity(new Intent(this, ProductFeedbackFormActivity.class));
+                break;
+            default:
+        }
+    }
+}

+ 884 - 0
Android/app/src/main/java/com/cygnusa/hyperm/MainProfileActivity.java

@@ -0,0 +1,884 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.app.DatePickerDialog;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.content.res.ColorStateList;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.os.Handler;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.AnimationUtils;
+import android.view.animation.TranslateAnimation;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.DatePicker;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import com.bumptech.glide.Glide;
+import com.google.android.material.appbar.AppBarLayout;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import com.google.android.material.textfield.TextInputLayout;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.fancyshowcase.FancyShowCaseView;
+import com.cygnusa.hyperm.fancyshowcase.FocusShape;
+import com.cygnusa.hyperm.pickimage.bean.PickResult;
+import com.cygnusa.hyperm.pickimage.bundle.PickSetup;
+import com.cygnusa.hyperm.pickimage.dialog.PickImageDialog;
+import com.cygnusa.hyperm.pickimage.listeners.IPickCancel;
+import com.cygnusa.hyperm.pickimage.listeners.IPickResult;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.widget.SubtitleCollapsingToolbarLayout;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.UserResponse;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.RequestBody;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class MainProfileActivity extends AppCompatActivity implements IPickResult {
+    public Calendar calendar;
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    AppBarLayout appBarLayout;
+    Toolbar toolbar;
+    ImageView userImage;
+    FloatingActionButton editButton;
+    FloatingActionButton cameraButton;
+    LinearLayout bottomLayout;
+    EditText dob, email, mobile, doj, dealer, zone, state, city, region, designation, weddingDate;
+    Button submitButton;
+    UserResponse MY_PROFILE = new UserResponse();
+    SubtitleCollapsingToolbarLayout collapsingToolbar;
+    String IMAGE_PATH = "";
+    ImageButton toolEditIcon, helpIcon;
+    CheckBox checkBoxMarried;
+    AlertDialog.Builder alertDialogBuilder;
+    AlertDialog alertDialog;
+    LinearLayout linearWeddingDate;
+    private ImageView dobCalendar;
+    private int year;
+    private int month;
+    private int day;
+    boolean isDOB = false;
+    public TextInputLayout editInputDob,editInputEmail,editInputWedding;
+
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_my_profile);
+        setupWindowAnimations();
+        setupUI(findViewById(R.id.main_content));
+        calendar = Calendar.getInstance();
+        year = calendar.get(Calendar.YEAR);
+        month = calendar.get(Calendar.MONTH);
+        day = calendar.get(Calendar.DAY_OF_MONTH);
+
+        restService = ((MainApplication) getApplication()).getClient();
+        appBarLayout = findViewById(R.id.appBarLayout);
+        userImage = findViewById(R.id.userImage);
+        toolbar = findViewById(R.id.toolbar);
+        bottomLayout = findViewById(R.id.bottomLayout);
+        toolEditIcon = findViewById(R.id.toolEditIcon);
+        helpIcon = findViewById(R.id.helpIcon);
+        helpIcon.setVisibility(View.GONE);
+
+        email = findViewById(R.id.email);
+        mobile = findViewById(R.id.mobile);
+        doj = findViewById(R.id.doj);
+        dob = findViewById(R.id.dob);
+        dealer = findViewById(R.id.dealer);
+        zone = findViewById(R.id.zone);
+        region = findViewById(R.id.region);
+        state = findViewById(R.id.state);
+        city = findViewById(R.id.city);
+        designation = findViewById(R.id.designation);
+        checkBoxMarried = findViewById(R.id.checkMarried);
+        weddingDate = findViewById(R.id.weddingDate);
+        dobCalendar = findViewById(R.id.dob_date);
+        final ImageView weddingCalendar = findViewById(R.id.weddding_date);
+        linearWeddingDate = findViewById(R.id.linear_wedding_date);
+        editInputEmail = findViewById(R.id.txtemail);
+        editInputDob = findViewById(R.id.txtInputDob);
+        editInputWedding = findViewById(R.id.txtInputWedding);
+
+        submitButton = findViewById(R.id.submitButton);
+        email.setEnabled(false);
+        weddingDate.setEnabled(false);
+        dob.setEnabled(false);
+        doj.setEnabled(false);
+        dealer.setEnabled(false);
+        designation.setEnabled(false);
+        mobile.setEnabled(false);
+        region.setEnabled(false);
+        state.setEnabled(false);
+        zone.setEnabled(false);
+        city.setEnabled(false);
+        weddingCalendar.setVisibility(View.VISIBLE);
+        checkBoxMarried.setChecked(false);
+
+        setSupportActionBar(toolbar);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+
+        collapsingToolbar = findViewById(R.id.collapsing_toolbar);
+        appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
+            @Override
+            public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
+                if (Math.abs(verticalOffset) - appBarLayout.getTotalScrollRange() == 0) {
+                    toolbar.setBackgroundColor(getResources().getColor(R.color.bg_color));
+                    toolEditIcon.setVisibility(View.GONE);
+                    helpIcon.setVisibility(View.GONE);
+                } else {
+                    toolbar.setBackgroundColor(Color.TRANSPARENT);
+                    toolEditIcon.setVisibility(View.GONE);
+                    helpIcon.setVisibility(View.GONE);
+                }
+            }
+        });
+
+        toolEditIcon.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                editButton.performClick();
+            }
+        });
+
+        dobCalendar.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                isDOB = true;
+                Calendar c = Calendar.getInstance();
+                c.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - 18);
+                Date date = new Date();
+
+                if (dob.getText().toString().trim().isEmpty()
+                        || dob.getText().toString().trim().equalsIgnoreCase("0000-00-00")
+                        || dob.getText().toString().trim().equalsIgnoreCase("00-00-0000")
+                        || dob.getText().toString().trim().equalsIgnoreCase("00/00/0000")
+                        || dob.getText().toString().trim().equalsIgnoreCase("0000/00/00")) {
+                    date = c.getTime();
+                } else {
+                    if (dob.getText().toString().trim().contains("-")) {
+                        try {
+                            date = new SimpleDateFormat("yyyy-MM-dd").parse(dob.getText().toString().trim());
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    } else {
+                        try {
+                            date = new SimpleDateFormat("dd-MMM-yyyy").parse(dob.getText().toString().trim());
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                c.setTime(date);
+
+                DatePickerDialog dialog = new DatePickerDialog(MainProfileActivity.this, tolistener,
+                        c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH));
+                try {
+                    c = Calendar.getInstance();
+                    c.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - 18);
+                    DatePicker datePicker = dialog.getDatePicker();
+                    datePicker.setMaxDate(c.getTime().getTime());
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                dialog.show();
+            }
+        });
+
+
+        weddingCalendar.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                isDOB = false;
+                Calendar c = Calendar.getInstance();
+                Date date = new Date();
+
+                if (weddingDate.getText().toString().trim().isEmpty()
+                        || weddingDate.getText().toString().trim().equalsIgnoreCase("0000-00-00")
+                        || weddingDate.getText().toString().trim().equalsIgnoreCase("00-00-0000")
+                        || weddingDate.getText().toString().trim().equalsIgnoreCase("00/00/0000")
+                        || weddingDate.getText().toString().trim().equalsIgnoreCase("0000/00/00")) {
+                    date = c.getTime();
+                } else {
+                    if (weddingDate.getText().toString().trim().contains("-")) {
+                        try {
+                            date = new SimpleDateFormat("yyyy-MM-dd").parse(weddingDate.getText().toString().trim());
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    } else {
+                        try {
+                            date = new SimpleDateFormat("dd-MMM-yyyy").parse(weddingDate.getText().toString().trim());
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                c.setTime(date);
+
+                DatePickerDialog dialog = new DatePickerDialog(MainProfileActivity.this, tolistener,
+                        c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH));
+                try {
+                    DatePicker datePicker = dialog.getDatePicker();
+                    datePicker.setMaxDate(c.getTime().getTime());
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                dialog.show();
+            }
+        });
+
+        editButton = findViewById(R.id.editButton);
+        cameraButton = findViewById(R.id.cameraButton);
+        cameraButton.hide();
+        bottomLayout.setVisibility(View.INVISIBLE);
+        getMyProfile();
+
+        checkBoxMarried.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                boolean checked = ((CheckBox) v).isChecked();
+                if (checked) {
+                    linearWeddingDate.setVisibility(View.VISIBLE);
+                } else {
+                    linearWeddingDate.setVisibility(View.INVISIBLE);
+                }
+            }
+        });
+
+
+        IMAGE_PATH = "";
+        cameraButton.show();
+        cameraButton.startAnimation(AnimationUtils.loadAnimation(MainProfileActivity.this, R.anim.zoomin));
+        slideToTop(bottomLayout);
+        dobCalendar.setEnabled(true);
+        email.setEnabled(true);
+        editButton.hide();
+        linearWeddingDate.setVisibility(View.INVISIBLE);
+
+        editButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (cameraButton.getVisibility() == View.GONE) {
+                    IMAGE_PATH = "";
+
+                    setUpperHintColor(getResources().getColor(R.color.btn_bg_color),editInputDob);
+                    setUpperHintColor(getResources().getColor(R.color.btn_bg_color),editInputEmail);
+                    setUpperHintColor(getResources().getColor(R.color.btn_bg_color),editInputWedding);
+                    mobile.setTextColor(getResources().getColor(R.color.material_grey300));
+                    designation.setTextColor(getResources().getColor(R.color.material_grey300));
+                    dealer.setTextColor(getResources().getColor(R.color.material_grey300));
+                    doj.setTextColor(getResources().getColor(R.color.material_grey300));
+                    zone.setTextColor(getResources().getColor(R.color.material_grey300));
+                    region.setTextColor(getResources().getColor(R.color.material_grey300));
+                    state.setTextColor(getResources().getColor(R.color.material_grey300));
+                    city.setTextColor(getResources().getColor(R.color.material_grey300));
+                    weddingDate.setHintTextColor(getResources().getColor(R.color.material_grey700));
+                    cameraButton.show();
+                    cameraButton.startAnimation(AnimationUtils.loadAnimation(MainProfileActivity.this, R.anim.zoomin));
+                    slideToTop(bottomLayout);
+                    email.setEnabled(true);
+                    dobCalendar.setVisibility(View.VISIBLE);
+                } else {
+                    setUpperHintColor(getResources().getColor(R.color.btn_bg_color),editInputDob);
+                    setUpperHintColor(getResources().getColor(R.color.btn_bg_color),editInputEmail);
+                    setUpperHintColor(getResources().getColor(R.color.btn_bg_color),editInputWedding);
+                    mobile.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    designation.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    doj.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    zone.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    region.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    state.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    city.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    dealer.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    cameraButton.startAnimation(AnimationUtils.loadAnimation(MainProfileActivity.this, R.anim.zoomout));
+                    cameraButton.hide();
+                    slideToBottom(bottomLayout);
+                    email.setEnabled(false);
+                    dobCalendar.setVisibility(View.INVISIBLE);
+                    weddingCalendar.setVisibility(View.INVISIBLE);
+                    IMAGE_PATH = "";
+                    setMyProfile();
+                }
+
+            }
+        });
+
+        cameraButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                PickImageDialog.build(new PickSetup().setButtonOrientation(LinearLayout.HORIZONTAL)).setOnPickCancel(new IPickCancel() {
+                    @Override
+                    public void onCancelClick() {
+
+                    }
+                }).show(MainProfileActivity.this);
+            }
+        });
+
+        submitButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                updateProfile();
+            }
+        });
+
+
+        helpIcon.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showHelpScreen();
+            }
+        });
+
+    }
+    public DatePickerDialog.OnDateSetListener tolistener = new DatePickerDialog.OnDateSetListener() {
+        @Override
+        public void onDateSet(DatePicker view, int y, int monthOfYear, int dayOfMonth) {
+            year = y;
+            month = monthOfYear;
+            day = dayOfMonth;
+            String datevalue = String.valueOf(day);
+            int mval = (month + 1);
+            String monthvalue = String.valueOf(mval);
+            String date;
+            String monthname;
+            if (datevalue.length() == 1) {
+                date = "0" + datevalue;
+            } else {
+                date = datevalue;
+            }
+
+            if (monthvalue.length() == 1) {
+                monthname = "0" + monthvalue;
+            } else {
+                monthname = monthvalue;
+            }
+           // String dateValue = date + "/" + monthname + "/" + String.valueOf(year) + " ";
+            String dateValue =  String.valueOf(year) + "-"+monthname+"-"+date;
+            dob.setText(dateFormate(dateValue));
+            if (isDOB) {
+                dob.setText(dateFormate(dateValue));
+            } else {
+                weddingDate.setText(dateFormate(dateValue));
+            }
+
+        }
+    };
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    activity.getCurrentFocus().getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static boolean isValidEmail(String email) {
+        return !TextUtils.isEmpty(email) && android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches();
+    }
+
+    private void setUpperHintColor(int color, TextInputLayout txtInputLayout) {
+        try {
+            Field field = txtInputLayout.getClass().getDeclaredField("mFocusedTextColor");
+            field.setAccessible(true);
+            int[][] states = new int[][]{
+                    new int[]{}
+            };
+            int[] colors = new int[]{
+                    color
+            };
+            ColorStateList myList = new ColorStateList(states, colors);
+            field.set(txtInputLayout, myList);
+
+            Method method = txtInputLayout.getClass().getDeclaredMethod("updateLabelState", boolean.class);
+            method.setAccessible(true);
+            method.invoke(txtInputLayout, true);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public String dateFormate(String dte) {
+        String date = "";
+        if (dte.equalsIgnoreCase("0000-00-00")) {
+            date = "";
+            return date;
+        } else {
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            Date newDate = null;
+            try {
+                newDate = format.parse(dte);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            format = new SimpleDateFormat("dd-MMM-yyyy");
+            date = format.format(newDate);
+
+        }
+        return date;
+    }
+
+    public String finalDateFormat(String date) {
+
+        SimpleDateFormat format = new SimpleDateFormat("dd-MMM-yyyy");
+        Date newDate = null;
+        try {
+            newDate = format.parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        format = new SimpleDateFormat("yyyy-MM-dd");
+        date = format.format(newDate);
+        return date;
+
+    }
+
+    private void showHelpScreen() {
+        try {
+            new FancyShowCaseView.Builder(this)
+                    .focusOn(editButton)
+                    .title("Tap here to edit profile details")
+                    .titleSize(22, 1)
+                    .closeOnTouch(true)
+                    .focusShape(FocusShape.CIRCLE)
+                    .backgroundColor(Color.parseColor("#99000000"))
+                    .build()
+                    .show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        finish();
+        overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+        finish();
+    }
+
+    public void slideToBottom(View view) {
+        TranslateAnimation animate = new TranslateAnimation(0, 0, 0, view.getHeight());
+        animate.setDuration(500);
+        animate.setFillAfter(true);
+        view.startAnimation(animate);
+        view.setVisibility(View.GONE);
+    }
+
+    public void slideToTop(View view) {
+        TranslateAnimation animate = new TranslateAnimation(0, 0, view.getHeight(), 0);
+        animate.setDuration(500);
+        animate.setFillAfter(true);
+        view.startAnimation(animate);
+        view.setVisibility(View.VISIBLE);
+    }
+
+    private void getMyProfile() {
+        if (new UtilService().isNetworkAvailable(MainProfileActivity.this)) {
+            progressDialog = new TransparentProgressDialog(MainProfileActivity.this);
+            progressDialog.show();
+
+            try {
+                restService.getProfile().enqueue(new Callback<UserResponse>() {
+                    @Override
+                    public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            MY_PROFILE = response.body();
+                            if (MY_PROFILE.getData().getIs_married().equalsIgnoreCase("1")) {
+                                checkBoxMarried.setEnabled(true);
+                                linearWeddingDate.setVisibility(View.VISIBLE);
+                            }
+                            setMyProfile();
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                        }
+
+                        new Handler().postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                if (getPreferences(MODE_PRIVATE).getBoolean("MyProfileActivity", true)) {
+//                                    showHelpScreen();
+                                    getPreferences(MODE_PRIVATE).edit().putBoolean("MyProfileActivity", false).apply();
+                                }
+                            }
+                        }, 1000);
+                    }
+
+                    @Override
+                    public void onFailure(Call<UserResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+            }
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void setMyProfile() {
+
+        email.setText(MY_PROFILE.getData().getEmailid());
+        mobile.setText(MY_PROFILE.getData().getMobileno());
+        dealer.setText(MY_PROFILE.getData().getDealer().getDealer_name());
+        designation.setText(MY_PROFILE.getData().getRolename());
+        doj.setText(dateFormate(MY_PROFILE.getData().getDoj()));
+        zone.setText(MY_PROFILE.getData().getZone());
+        region.setText(MY_PROFILE.getData().getZone());
+        state.setText(MY_PROFILE.getData().getState());
+        city.setText(MY_PROFILE.getData().getCity());
+        dob.setText(dateFormate(MY_PROFILE.getData().getDob()));
+        weddingDate.setText(dateFormate(MY_PROFILE.getData().getMarriage_date()));
+
+        collapsingToolbar.setTitle(MY_PROFILE.getData().getFname() + " " + MY_PROFILE.getData().getLname());
+        collapsingToolbar.setSubtitle(MY_PROFILE.getData().getRolename());
+        Glide.with(this).load(MY_PROFILE.getData().getProfile_photo())
+                .thumbnail(Glide.with(this).load(R.drawable.gif_loader))
+                .into(userImage);
+    }
+
+    @Override
+    public void onPickResult(PickResult pickResult) {
+        if (pickResult.getError() == null) {
+            IMAGE_PATH = pickResult.getPath();
+            if (IMAGE_PATH != null && !IMAGE_PATH.trim().isEmpty()) {
+                Intent intent = new Intent(MainProfileActivity.this, CropActivity.class);
+                CropActivity.mSourceUri = pickResult.getUri();
+                startActivityForResult(intent, 2276);
+            } else {
+                userImage.setImageBitmap(pickResult.getBitmap());
+            }
+
+        } else {
+            GlobalData.showToast(this, pickResult.getError().getMessage(), Toast.LENGTH_LONG).show();
+        }
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == RESULT_OK && requestCode == 2276) {
+            IMAGE_PATH = data.getStringExtra("IMAGE_PATH");
+            Glide.with(this).load(new File(IMAGE_PATH))
+                    .thumbnail(Glide.with(this).load(R.drawable.gif_loader))
+                    .into(userImage);
+        } else if (resultCode == RESULT_CANCELED && requestCode == 2276) {
+            IMAGE_PATH = "";
+        }
+    }
+
+    public void updateProfile() {
+        if (dob.getText().toString().trim().isEmpty() || dob.getText().toString().equalsIgnoreCase("00/00/0000")) {
+            GlobalData.showToast(this, "Please enter DOB", Toast.LENGTH_SHORT).show();
+            return;
+        }
+
+        if (email.getText().toString().trim().isEmpty()) {
+            GlobalData.showToast(this, "Enter email", Toast.LENGTH_SHORT).show();
+            return;
+        }
+        if (!isValidEmail(email.getText().toString())) {
+            GlobalData.showToast(this, "Please enter valid email address", Toast.LENGTH_SHORT).show();
+            return;
+        }
+
+        if (mobile.getText().toString().trim().isEmpty()) {
+            GlobalData.showToast(this, "Enter mobile number", Toast.LENGTH_SHORT).show();
+            return;
+        }
+
+        if (checkBoxMarried.isChecked()) {
+            if (weddingDate.getText().toString().trim().isEmpty() || weddingDate.getText().toString().equalsIgnoreCase("00/00/0000")) {
+                GlobalData.showToast(this, "Please enter wedding date", Toast.LENGTH_SHORT).show();
+                return;
+            }
+        }
+
+        if (new UtilService().isNetworkAvailable(MainProfileActivity.this)) {
+            if (IMAGE_PATH.trim().isEmpty()) {
+                try {
+                    HashMap<String, String> map = new HashMap<>();
+
+                    map.put("dob", finalDateFormat(dob.getText().toString().trim()));
+                    map.put("email", email.getText().toString().trim());
+                    map.put("is_married", checkBoxMarried.isChecked() ? "1" : "0");
+                    if (checkBoxMarried.isChecked()) {
+                        map.put("marriage_date", finalDateFormat(weddingDate.getText().toString().trim()));
+                    } else {
+                        map.put("marriage_date", "0000-00-00");
+                    }
+
+                    progressDialog = new TransparentProgressDialog(MainProfileActivity.this);
+                    progressDialog.show();
+                    restService.postProfile(map).enqueue(new Callback<UserResponse>() {
+                        @Override
+                        public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+
+                            if (response.body() != null && response.body().getStatus() == 200) {
+                                MY_PROFILE = response.body();
+                                GlobalData.user = MY_PROFILE;
+                                GlobalData.user.setAccess_token(SetNewPasswordActivity.accessToken);
+                                saveUserData();
+                                showInstructions();
+                            } else if (response.body() != null && response.body().getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            } else if (response.body() != null) {
+                                GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                            } else if (response.errorBody() != null) {
+                                Gson gson = new Gson();
+                                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                                if (message.getStatus() == 401) {
+                                    GlobalData.canLogout = true;
+                                    finish();
+                                }
+                            }
+                        }
+
+                        @Override
+                        public void onFailure(Call<UserResponse> call, Throwable t) {
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+                            GlobalData.showToast(MainProfileActivity.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                        }
+                    });
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+
+            } else {
+                File file = new File(IMAGE_PATH);
+                RequestBody reqFile = RequestBody.create(MediaType.parse("image/*"), file);
+                MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getName(), reqFile);
+                RequestBody emailtxt = RequestBody.create(MediaType.parse("text/plain"), email.getText().toString().trim());
+                RequestBody dobtxt = RequestBody.create(MediaType.parse("text/plain"), finalDateFormat(dob.getText().toString().trim()));
+                RequestBody isMarried = RequestBody.create(MediaType.parse("text/plain"), checkBoxMarried.isChecked() ? "1" : "0");
+                RequestBody isMarriedDate = RequestBody.create(MediaType.parse("text/plain"), "0000-00-00");
+                if (checkBoxMarried.isChecked()) {
+                    isMarriedDate = RequestBody.create(MediaType.parse("text/plain"), finalDateFormat(weddingDate.getText().toString().trim()));
+                }
+
+                progressDialog = new TransparentProgressDialog(MainProfileActivity.this);
+                progressDialog.show();
+                restService.postProfileWithImage(body, emailtxt, dobtxt, isMarried, isMarriedDate).enqueue(new Callback<UserResponse>() {
+                    @Override
+                    public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            MY_PROFILE = response.body();
+
+                            if(MY_PROFILE.getData().getRole().equalsIgnoreCase("16")){
+                                GlobalData.showToast(getBaseContext(), "You don’t have required permission to log in to the STAR app", Toast.LENGTH_LONG).show();
+                            }else {
+                                GlobalData.user = MY_PROFILE;
+                                saveUserData();
+                                showInstructions();
+                            }
+
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<UserResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        t.printStackTrace();
+                        GlobalData.showToast(MainProfileActivity.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+            }
+
+        } else {
+            GlobalData.showToast(MainProfileActivity.this, "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void showInstructions() {
+        View view = LayoutInflater.from(MainProfileActivity.this).inflate(
+                R.layout.profile_success, null);
+        TextView textHead = (TextView) view.findViewById(R.id.textHead);
+        TextView text1 = (TextView) view.findViewById(R.id.text1);
+        TextView text2 = (TextView) view.findViewById(R.id.text2);
+        TextView text3 = (TextView) view.findViewById(R.id.text3);
+
+
+        view.findViewById(R.id.btn_ok).setOnClickListener(
+                new View.OnClickListener() {
+
+                    @Override
+                    public void onClick(View v) {
+                        alertDialog.dismiss();
+                        if(MY_PROFILE.getData().getRole().equalsIgnoreCase("3")||MY_PROFILE.getData().getRole().equalsIgnoreCase("4")||MY_PROFILE.getData().getRole().equalsIgnoreCase("5")||MY_PROFILE.getData().getRole().equalsIgnoreCase("6")||MY_PROFILE.getData().getRole().equalsIgnoreCase("7")||MY_PROFILE.getData().getRole().equalsIgnoreCase("14")){
+                            startActivity(new Intent(MainProfileActivity.this, AMHomeActivity.class));
+                            finish();
+
+                        }else if(MY_PROFILE.getData().getRole().equalsIgnoreCase("15")) {
+                            startActivity(new Intent(MainProfileActivity.this, SEHomeActivity.class));
+                            finish();
+                        }else {
+                            startActivity(new Intent(MainProfileActivity.this, HomeActivity.class));
+                            finish();
+                        }
+
+
+                    }
+                });
+
+        alertDialogBuilder = new AlertDialog.Builder(MainProfileActivity.this);
+        alertDialogBuilder.setCancelable(false);
+        alertDialogBuilder.setView(view);
+        alertDialog = alertDialogBuilder.create();
+        alertDialog.show();
+    }
+
+
+    private void saveUserData() {
+        editButton.performClick();
+        GlobalData.sdb.delete("session", null, null);
+        Gson gson = new Gson();
+        JsonElement jsonElement = gson.toJsonTree(
+                GlobalData.user, new TypeToken<UserResponse>() {
+                }.getType());
+        ContentValues values = new ContentValues();
+        values.put("user", jsonElement.toString());
+        GlobalData.sdb.insert("session", null, values);
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(MainProfileActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
+

ファイルの差分が大きいため隠しています
+ 2627 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ModifyClassRoomActivity.java


+ 446 - 0
Android/app/src/main/java/com/cygnusa/hyperm/MyEarnedPoints.java

@@ -0,0 +1,446 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.Window;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentStatePagerAdapter;
+import androidx.viewpager.widget.ViewPager;
+
+import com.google.gson.Gson;
+import com.ogaclejapan.smarttablayout.SmartTabLayout;
+import com.cygnusa.hyperm.autofit.AutofitTextView;
+import com.cygnusa.hyperm.fragments.RewardPointFragment;
+import com.cygnusa.hyperm.screenpinview.AppLockActivity;
+import com.cygnusa.hyperm.tooltip.Tooltip;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.DepthPageTransformerNew;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.FragmentItem;
+import com.cygnusa.hyperm.wrappers.LearningLevel;
+import com.cygnusa.hyperm.wrappers.LevelData;
+import com.cygnusa.hyperm.wrappers.RedeemToWalletResponse;
+
+import java.util.ArrayList;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class MyEarnedPoints extends AppCompatActivity {
+    TextView title, earnedPoints, text_rules;
+    Button btnRedeemNow;
+    TransparentProgressDialog progressDialog;
+    ViewPager earningPager;
+    SmartTabLayout earningTab;
+    ArrayList<String> arrEarnedPoints = new ArrayList<>();
+    ArrayList<FragmentItem> fragments = new ArrayList<>();
+    EarningPointsAdapter adapter;
+    AutofitTextView points;
+    public static Handler.Callback myEarnedPointsCallback;
+    ApiService restService;
+    public String currPoint = "";
+    public RedeemToWalletResponse data = new RedeemToWalletResponse();
+    int cPoints;
+    private TextView minPoint;
+    public LearningLevel responseLevel = new LearningLevel();
+    public ArrayList<LevelData> LEARNING_LEVEL_LIST = new ArrayList<>();
+    View mView;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_earned_points);
+        setupWindowAnimations();
+        restService = ((MainApplication) getApplication()).getClient();
+        title = findViewById(R.id.title);
+        minPoint = findViewById(R.id.text_message);
+        text_rules = findViewById(R.id.text_rules);
+        points = findViewById(R.id.points);
+        earnedPoints = findViewById(R.id.earned);
+        btnRedeemNow = findViewById(R.id.btn_redeem);
+        earningPager = findViewById(R.id.myEarningPager);
+        earningTab = findViewById(R.id.myEarningPagerTab);
+        arrEarnedPoints.clear();
+        arrEarnedPoints.add("Earned History");
+        arrEarnedPoints.add("Redeem History");
+
+        text_rules.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                openRulesPopup();
+            }
+        });
+
+        btnRedeemNow.setEnabled(false);
+        btnRedeemNow.setAlpha(0.3f);
+        setLeaderBoardCategory();
+        earningPager.setOffscreenPageLimit(0);
+        btnRedeemNow.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                final int cPoints = Integer.parseInt(currPoint);
+                new androidx.appcompat.app.AlertDialog.Builder(MyEarnedPoints.this)
+                        .setMessage("Confirm redemption of points to your wallet?")
+                        .setPositiveButton("Ok",
+                                new DialogInterface.OnClickListener() {
+                                    @Override
+                                    public void onClick(
+                                            DialogInterface dialog,
+                                            int which) {
+                                        getRedeemNow();
+                                    }
+                                }).setNegativeButton("Cancel", null).show();
+
+
+            }
+        });
+        earningPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            public void onPageScrollStateChanged(int state) {
+            }
+
+            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+            }
+
+            public void onPageSelected(int position) {
+                try {
+                    RewardPointFragment fragment = (RewardPointFragment) fragments.get(position).getFragment();
+
+                    if (position == 0) {
+                        earnedPoints.setText(String.format("Total Points Earned %s", fragment.getTotalPoint()));
+                    } else {
+                        earnedPoints.setText(String.format("Total Points Redeemed %s", fragment.getTotalPoint()));
+                    }
+                    currPoint = fragment.getCurrentPoint();
+                    cPoints = Integer.parseInt(currPoint);
+                    points.setText(fragment.getCurrentPoint() + "");
+                    minPoint.setText(String.format("Minimum  %s points required for redemption", fragment.getMinPoint()));
+                    if (fragment.getIs_Redeem_Point().equalsIgnoreCase("0") || cPoints == 0) {
+                        btnRedeemNow.setEnabled(false);
+                        btnRedeemNow.setAlpha(0.3f);
+                    } else if (fragment.getIs_Redeem_Point().equalsIgnoreCase("1") || cPoints >= 1500) {
+                        btnRedeemNow.setEnabled(true);
+                        btnRedeemNow.setAlpha(1f);
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+
+        myEarnedPointsCallback = new Handler.Callback() {
+            @Override
+            public boolean handleMessage(Message msg) {
+                RewardPointFragment fragment = (RewardPointFragment) fragments.get(earningPager.getCurrentItem()).getFragment();
+                if (earningPager.getCurrentItem() == 0) {
+                    earnedPoints.setText(String.format("Total Points Earned %s", fragment.getTotalPoint()));
+                } else {
+                    earnedPoints.setText(String.format("Total Points Redeemed %s", fragment.getTotalPoint()));
+                }
+                currPoint = fragment.getCurrentPoint();
+                cPoints = Integer.parseInt(currPoint);
+                points.setText(fragment.getCurrentPoint());
+                minPoint.setText(String.format("Minimum  %s points required for redemption", fragment.getMinPoint()));
+                if (fragment.getIs_Redeem_Point().equalsIgnoreCase("0") || cPoints == 0) {
+                    btnRedeemNow.setEnabled(false);
+                    btnRedeemNow.setAlpha(0.3f);
+                } else if (fragment.getIs_Redeem_Point().equalsIgnoreCase("1") || cPoints >= 1500) {
+                    btnRedeemNow.setEnabled(true);
+                    btnRedeemNow.setAlpha(1f);
+                }
+
+                return false;
+            }
+        };
+
+        findViewById(R.id.info).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+            }
+        });
+        getLearningData();
+        findViewById(R.id.info).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                setupView();
+                Tooltip.TooltipView tooltip = Tooltip.make(MyEarnedPoints.this,
+                        new Tooltip.Builder(101)
+                                .anchor(view, Tooltip.Gravity.BOTTOM)
+                                .closePolicy(new Tooltip.ClosePolicy()
+                                        .insidePolicy(true, false)
+                                        .outsidePolicy(true, false), 0)
+                                .activateDelay(800)
+                                .withStyleId(R.style.ToolTipLayoutCustomStyle)
+                                .showDelay(300)
+                                .text("")
+                                .setBgColor(getResources().getColor(R.color.white))
+                                .view(mView)
+                                .maxWidth(800)
+                                .withArrow(true)
+                                .build()
+                );
+                tooltip.setTextColor(Color.YELLOW);
+                tooltip.show();
+            }
+        });
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setNavigationIcon(R.mipmap.back);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+    }
+
+    private void openRulesPopup() {
+
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.popup_reward_rules);
+        aDialog.setCancelable(true);
+        ImageView img_close = aDialog.findViewById(R.id.img_close);
+        img_close.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                aDialog.dismiss();
+            }
+        });
+        aDialog.show();
+
+    }
+
+
+    private void getLearningData() {
+        if (new UtilService().isNetworkAvailable(this)) {
+            progressDialog = new TransparentProgressDialog(this);
+            progressDialog.show();
+            try {
+                restService.getLearninglevel()
+                        .enqueue(new Callback<LearningLevel>() {
+                            @Override
+                            public void onResponse(Call<LearningLevel> call, Response<LearningLevel> response) {
+                                if (progressDialog != null && progressDialog.isShowing()) {
+                                    progressDialog.dismiss();
+                                }
+                                if (response.body() != null && response.body().getStatus() == 200) {
+                                    responseLevel = response.body();
+                                    LEARNING_LEVEL_LIST = response.body().getData();
+                                } else if (response.body() != null && response.body().getStatus() == 401) {
+                                    GlobalData.canLogout = true;
+                                    new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                                    finish();
+                                } else if (response.body() != null) {
+                                    GlobalData.showToast(MyEarnedPoints.this, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                                } else if (response.errorBody() != null) {
+                                    Gson gson = new Gson();
+                                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                                    GlobalData.showToast(MyEarnedPoints.this, message.getMessage(), Toast.LENGTH_SHORT).show();
+                                    if (message.getStatus() == 401) {
+                                        GlobalData.canLogout = true;
+                                        new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                                        finish();
+                                    }
+                                }
+                            }
+
+                            @Override
+                            public void onFailure(Call<LearningLevel> call, Throwable t) {
+                                if (progressDialog != null && progressDialog.isShowing()) {
+                                    progressDialog.dismiss();
+                                }
+                                GlobalData.showToast(MyEarnedPoints.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                            }
+                        });
+
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                GlobalData.showToast(MyEarnedPoints.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+        } else {
+            GlobalData.showToast(MyEarnedPoints.this, "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+
+    private void setupView() {
+        mView = LayoutInflater.from(MyEarnedPoints.this).inflate(R.layout.tooltip, null);
+        LinearLayout vocItemExpLayout = (LinearLayout) mView.findViewById(R.id.linearLevel);
+        vocItemExpLayout.removeAllViews();
+        for (int i = 0; i < LEARNING_LEVEL_LIST.size(); i++) {
+            View view = LayoutInflater.from(this).inflate(
+                    R.layout.tooltip_item, null);
+            TextView levelText = (TextView) view.findViewById(R.id.level);
+            TextView levelPointText = (TextView) view.findViewById(R.id.level_point);
+            TextView levelRateText = (TextView) view.findViewById(R.id.level_rate);
+            levelText.setText(LEARNING_LEVEL_LIST.get(i).getLvl_name());
+            levelPointText.setText("1");
+            levelRateText.setText(LEARNING_LEVEL_LIST.get(i).getLvl_points());
+            vocItemExpLayout.addView(view);
+        }
+
+
+    }
+
+
+    private void getRedeemNow() {
+        if (new UtilService().isNetworkAvailable(this)) {
+            progressDialog = new TransparentProgressDialog(this);
+            progressDialog.show();
+            try {
+                restService.getRedeemToWallet().enqueue(new Callback<RedeemToWalletResponse>() {
+                    @Override
+                    public void onResponse(Call<RedeemToWalletResponse> call, Response<RedeemToWalletResponse> response) {
+                        data = response.body();
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (data != null && data.getStatus() == 200) {
+                            if (GlobalData.user.getData().getMpin().trim().isEmpty()) {
+                                Intent i = new Intent(MyEarnedPoints.this, OtpActivity.class);
+                                i.putExtra("type", "redeem");
+                                startActivity(i);
+                                finish();
+                            } else {
+                                startActivity(new Intent(MyEarnedPoints.this, AppLockActivity.class));
+                                finish();
+                            }
+
+                        } else if (GlobalData.user != null) {
+                            GlobalData.showToast(MyEarnedPoints.this, GlobalData.user.getMessage(), Toast.LENGTH_SHORT).show();
+
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(MyEarnedPoints.this, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(MyEarnedPoints.this, message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<RedeemToWalletResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(MyEarnedPoints.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        } else {
+            GlobalData.showToast(MyEarnedPoints.this, "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+
+    }
+
+    public void showView() {
+
+    }
+
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            confirmClose();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void confirmClose() {
+        finish();
+        MyEarnedPoints.this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    public class EarningPointsAdapter extends FragmentStatePagerAdapter {
+
+        ArrayList<String> categories;
+
+
+        private EarningPointsAdapter(FragmentManager fm, ArrayList<String> list) {
+            super(fm);
+            categories = list;
+            fragments = new ArrayList<>();
+        }
+
+        @Override
+        public Fragment getItem(int position) {
+
+            RewardPointFragment fragment = new RewardPointFragment();
+            fragment.setIsEarnedHistory(position == 0);
+            FragmentItem item = new FragmentItem();
+            item.setFragment(fragment);
+            item.setTitle(categories.get(position));
+            fragments.add(item);
+            return fragment;
+        }
+
+        @Override
+        public int getCount() {
+            return categories.size();
+        }
+
+
+        @Override
+        public CharSequence getPageTitle(int position) {
+            return categories.get(position);
+        }
+    }
+
+    private void setLeaderBoardCategory() {
+        earningPager.setPageTransformer(true, new DepthPageTransformerNew());
+        adapter = new EarningPointsAdapter(getSupportFragmentManager(),
+                arrEarnedPoints);
+        earningPager.setAdapter(adapter);
+        earningTab.setViewPager(earningPager);
+    }
+
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+}

+ 900 - 0
Android/app/src/main/java/com/cygnusa/hyperm/MyProfileActivity.java

@@ -0,0 +1,900 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.app.DatePickerDialog;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.content.res.ColorStateList;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.os.Handler;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.AnimationUtils;
+import android.view.animation.TranslateAnimation;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.DatePicker;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import com.bumptech.glide.Glide;
+import com.google.android.material.appbar.AppBarLayout;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import com.google.android.material.textfield.TextInputLayout;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.fancyshowcase.FancyShowCaseView;
+import com.cygnusa.hyperm.fancyshowcase.FocusShape;
+import com.cygnusa.hyperm.pickimage.bean.PickResult;
+import com.cygnusa.hyperm.pickimage.bundle.PickSetup;
+import com.cygnusa.hyperm.pickimage.dialog.PickImageDialog;
+import com.cygnusa.hyperm.pickimage.listeners.IPickCancel;
+import com.cygnusa.hyperm.pickimage.listeners.IPickResult;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.widget.SubtitleCollapsingToolbarLayout;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.UserResponse;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.RequestBody;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class MyProfileActivity extends AppCompatActivity implements IPickResult {
+    public Calendar calendar;
+    public Calendar calendarret;
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    AppBarLayout appBarLayout;
+    Toolbar toolbar;
+    ImageView userImage;
+    FloatingActionButton editButton;
+    FloatingActionButton cameraButton;
+    LinearLayout bottomLayout;
+    EditText firstName, lastName, dob, email, mobile, doj, dealer, zone, state, city, region, designation, weddingDate;
+    Button submitButton;
+    UserResponse MY_PROFILE = new UserResponse();
+    SubtitleCollapsingToolbarLayout collapsingToolbar;
+    String IMAGE_PATH = "";
+    ImageButton toolEditIcon, helpIcon;
+    CheckBox checkBoxMarried;
+    AlertDialog.Builder alertDialogBuilder;
+    AlertDialog alertDialog;
+    String emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+";
+    private ImageView dobCalendar,weddingCalendar;
+    private int year;
+    private int month;
+    private int day;
+    boolean isDOB = false;
+    private LinearLayout linearWeddingDate;
+    private boolean isEditable = false;
+    public TextInputLayout editInputDob,editInputEmail,editInputWedding,getEditInputMobile;
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    activity.getCurrentFocus().getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static boolean isValidEmail(String email) {
+        return !TextUtils.isEmpty(email) && android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches();
+    }
+
+
+    @SuppressLint("WrongViewCast")
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_my_profile);
+        setupWindowAnimations();
+        setupUI(findViewById(R.id.main_content));
+        calendar = Calendar.getInstance();
+        year = calendar.get(Calendar.YEAR);
+        month = calendar.get(Calendar.MONTH);
+        day = calendar.get(Calendar.DAY_OF_MONTH);
+        restService = ((MainApplication) getApplication()).getClient();
+        appBarLayout = findViewById(R.id.appBarLayout);
+        userImage = findViewById(R.id.userImage);
+        toolbar = findViewById(R.id.toolbar);
+        bottomLayout = findViewById(R.id.bottomLayout);
+        toolEditIcon = findViewById(R.id.toolEditIcon);
+        helpIcon = findViewById(R.id.helpIcon);
+        helpIcon.setVisibility(View.VISIBLE);
+        email = findViewById(R.id.email);
+        editInputEmail = findViewById(R.id.txtemail);
+        editInputDob = findViewById(R.id.txtInputDob);
+        editInputWedding = findViewById(R.id.txtInputWedding);
+        editInputWedding = findViewById(R.id.edit_mobile);
+
+
+        mobile = findViewById(R.id.mobile);
+        doj = findViewById(R.id.doj);
+        dob = findViewById(R.id.dob);
+        dealer = findViewById(R.id.dealer);
+        zone = findViewById(R.id.zone);
+        region = findViewById(R.id.region);
+        state = findViewById(R.id.state);
+        city = findViewById(R.id.city);
+        designation = findViewById(R.id.designation);
+        checkBoxMarried = findViewById(R.id.checkMarried);
+        weddingDate = findViewById(R.id.weddingDate);
+        dobCalendar = findViewById(R.id.dob_date);
+        weddingCalendar = findViewById(R.id.weddding_date);
+        linearWeddingDate = findViewById(R.id.linear_wedding_date);
+
+        submitButton = findViewById(R.id.submitButton);
+        email.setEnabled(false);
+        weddingDate.setEnabled(false);
+        dob.setEnabled(false);
+        doj.setEnabled(false);
+        dealer.setEnabled(false);
+        designation.setEnabled(false);
+        mobile.setEnabled(false);
+        region.setEnabled(false);
+        state.setEnabled(false);
+        zone.setEnabled(false);
+        city.setEnabled(false);
+        weddingCalendar.setVisibility(View.VISIBLE);
+        checkBoxMarried.setChecked(false);
+
+
+        setSupportActionBar(toolbar);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+
+        collapsingToolbar = findViewById(R.id.collapsing_toolbar);
+        appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
+            @Override
+            public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
+                if (Math.abs(verticalOffset) - appBarLayout.getTotalScrollRange() == 0) {
+                    toolbar.setBackgroundColor(getResources().getColor(R.color.bg_color));
+                    toolEditIcon.setVisibility(View.VISIBLE);
+                    helpIcon.setVisibility(View.GONE);
+                } else {
+                    toolbar.setBackgroundColor(Color.TRANSPARENT);
+                    toolEditIcon.setVisibility(View.GONE);
+                    helpIcon.setVisibility(View.VISIBLE);
+                }
+            }
+        });
+
+        toolEditIcon.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                editButton.performClick();
+            }
+        });
+        dobCalendar.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                isDOB = true;
+                Calendar c = Calendar.getInstance();
+                c.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - 18);
+                Date date = new Date();
+
+                if (dob.getText().toString().trim().isEmpty()
+                        || dob.getText().toString().trim().equalsIgnoreCase("0000-00-00")
+                        || dob.getText().toString().trim().equalsIgnoreCase("00-00-0000")
+                        || dob.getText().toString().trim().equalsIgnoreCase("00/00/0000")
+                        || dob.getText().toString().trim().equalsIgnoreCase("0000/00/00")) {
+                    date = c.getTime();
+                } else {
+                    if (dob.getText().toString().trim().contains("-")) {
+                        try {
+                            date = new SimpleDateFormat("yyyy-MM-dd").parse(dob.getText().toString().trim());
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    } else {
+                        try {
+                            date = new SimpleDateFormat("dd-MMM-yyyy").parse(dob.getText().toString().trim());
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                c.setTime(date);
+
+                DatePickerDialog dialog = new DatePickerDialog(MyProfileActivity.this, tolistener,
+                        c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH));
+                try {
+                    c = Calendar.getInstance();
+                    c.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - 18);
+                    DatePicker datePicker = dialog.getDatePicker();
+                    datePicker.setMaxDate(c.getTime().getTime());
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                dialog.show();
+            }
+        });
+
+
+        weddingCalendar.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                isDOB = false;
+                Calendar c = Calendar.getInstance();
+                Date date = new Date();
+
+                if (weddingDate.getText().toString().trim().isEmpty()
+                        || weddingDate.getText().toString().trim().equalsIgnoreCase("0000-00-00")
+                        || weddingDate.getText().toString().trim().equalsIgnoreCase("00-00-0000")
+                        || weddingDate.getText().toString().trim().equalsIgnoreCase("00/00/0000")
+                        || weddingDate.getText().toString().trim().equalsIgnoreCase("0000/00/00")) {
+                    date = c.getTime();
+                } else {
+                    if (weddingDate.getText().toString().trim().contains("-")) {
+                        try {
+                            date = new SimpleDateFormat("yyyy-MM-dd").parse(weddingDate.getText().toString().trim());
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    } else {
+                        try {
+                            date = new SimpleDateFormat("dd-MMM-yyyy").parse(weddingDate.getText().toString().trim());
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                c.setTime(date);
+
+                DatePickerDialog dialog = new DatePickerDialog(MyProfileActivity.this, tolistener,
+                        c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH));
+                try {
+                    DatePicker datePicker = dialog.getDatePicker();
+                    datePicker.setMaxDate(c.getTime().getTime());
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                dialog.show();
+            }
+        });
+
+
+        editButton = findViewById(R.id.editButton);
+        cameraButton = findViewById(R.id.cameraButton);
+        cameraButton.hide();
+        bottomLayout.setVisibility(View.INVISIBLE);
+        linearWeddingDate.setVisibility(View.INVISIBLE);
+        dobCalendar.setVisibility(View.INVISIBLE);
+        checkBoxMarried.setEnabled(false);
+        weddingCalendar.setVisibility(View.INVISIBLE);
+        getMyProfile();
+
+        checkBoxMarried.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                boolean checked = ((CheckBox) v).isChecked();
+                if (checked) {
+                    linearWeddingDate.setVisibility(View.VISIBLE);
+                    if (!isEditable) {
+                        weddingCalendar.setVisibility(View.INVISIBLE);
+                    } else {
+                        weddingCalendar.setVisibility(View.VISIBLE);
+                    }
+                } else {
+                    linearWeddingDate.setVisibility(View.INVISIBLE);
+                    if (!isEditable) {
+                        weddingCalendar.setVisibility(View.INVISIBLE);
+                    } else {
+                        weddingCalendar.setVisibility(View.VISIBLE);
+                    }
+                }
+            }
+        });
+
+
+        editButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (cameraButton.getVisibility() == View.GONE) {
+                    IMAGE_PATH = "";
+                    setUpperHintColor(getResources().getColor(R.color.bg_color_dark),editInputDob);
+                    setUpperHintColor(getResources().getColor(R.color.bg_color_dark),editInputEmail);
+                    setUpperHintColor(getResources().getColor(R.color.bg_color_dark),editInputWedding);
+
+                    mobile.setTextColor(getResources().getColor(R.color.material_grey300));
+                    designation.setTextColor(getResources().getColor(R.color.material_grey300));
+                    dealer.setTextColor(getResources().getColor(R.color.material_grey300));
+                    doj.setTextColor(getResources().getColor(R.color.material_grey300));
+                    zone.setTextColor(getResources().getColor(R.color.material_grey300));
+                    region.setTextColor(getResources().getColor(R.color.material_grey300));
+                    state.setTextColor(getResources().getColor(R.color.material_grey300));
+                    city.setTextColor(getResources().getColor(R.color.material_grey300));
+                    weddingDate.setHintTextColor(getResources().getColor(R.color.material_grey700));
+                    cameraButton.show();
+                    cameraButton.startAnimation(AnimationUtils.loadAnimation(MyProfileActivity.this, R.anim.zoomin));
+                    slideToTop(bottomLayout);
+                    email.setEnabled(true);
+                    checkBoxMarried.setEnabled(true);
+                    dobCalendar.setVisibility(View.VISIBLE);
+                    isEditable = true;
+
+                } else {
+
+                    setUpperHintColor(getResources().getColor(R.color.btn_bg_color),editInputDob);
+                    setUpperHintColor(getResources().getColor(R.color.btn_bg_color),editInputEmail);
+                    setUpperHintColor(getResources().getColor(R.color.btn_bg_color),editInputWedding);
+                    mobile.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    designation.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    doj.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    zone.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    region.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    state.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    city.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    dealer.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                    cameraButton.startAnimation(AnimationUtils.loadAnimation(MyProfileActivity.this, R.anim.zoomout));
+                    cameraButton.hide();
+                    slideToBottom(bottomLayout);
+                    email.setEnabled(false);
+                    checkBoxMarried.setEnabled(false);
+                    dobCalendar.setVisibility(View.INVISIBLE);
+                    weddingCalendar.setVisibility(View.INVISIBLE);
+                    IMAGE_PATH = "";
+                    isEditable = false;
+                    setMyProfile();
+
+                }
+
+            }
+        });
+
+        cameraButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                PickImageDialog.build(new PickSetup().setButtonOrientation(LinearLayout.HORIZONTAL)).setOnPickCancel(new IPickCancel() {
+                    @Override
+                    public void onCancelClick() {
+
+                    }
+                }).show(MyProfileActivity.this);
+            }
+        });
+
+        submitButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                updateProfile();
+            }
+        });
+
+
+        helpIcon.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showHelpScreen();
+            }
+        });
+
+    }
+    private static String displayMonth(String date) throws ParseException{
+        Date d = new SimpleDateFormat("dd-MM-yyyy").parse(date);
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(d);
+        String monthName = new SimpleDateFormat("dd-MMM-yyyy").format(cal.getTime());
+        return monthName;
+    }
+    private void setUpperHintColor(int color, TextInputLayout txtInputLayout) {
+        try {
+            Field field = txtInputLayout.getClass().getDeclaredField("mFocusedTextColor");
+            field.setAccessible(true);
+            int[][] states = new int[][]{
+                    new int[]{}
+            };
+            int[] colors = new int[]{
+                    color
+            };
+            ColorStateList myList = new ColorStateList(states, colors);
+            field.set(txtInputLayout, myList);
+
+            Method method = txtInputLayout.getClass().getDeclaredMethod("updateLabelState", boolean.class);
+            method.setAccessible(true);
+            method.invoke(txtInputLayout, true);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public DatePickerDialog.OnDateSetListener tolistener = new DatePickerDialog.OnDateSetListener() {
+        @Override
+        public void onDateSet(DatePicker view, int y, int monthOfYear, int dayOfMonth) {
+            year = y;
+            month = monthOfYear;
+            day = dayOfMonth;
+            String datevalue = String.valueOf(day);
+            int mval = (month + 1);
+            String monthvalue = String.valueOf(mval);
+            String date = "0";
+            String monthname = "0";
+            if (datevalue.length() == 1) {
+                date = "0" + datevalue;
+            } else {
+                date = datevalue;
+            }
+
+            if (monthvalue.length() == 1) {
+                monthname = "0" + monthvalue;
+            } else {
+                monthname = monthvalue;
+            }
+            //dateValue = String.valueOf(year) + "-" + (month + 1) + "-" + day + " ";
+            String dateValue =  String.valueOf(year) + "-"+monthname+"-"+date;
+            dob.setText(dateFormate(dateValue));
+            if (isDOB) {
+                dob.setText(dateFormate(dateValue));
+            } else {
+                weddingDate.setText(dateFormate(dateValue));
+            }
+        }
+    };
+
+
+    public String dateFormate(String dte) {
+        String date = "";
+        if (dte.equalsIgnoreCase("0000-00-00")) {
+            date = "00/00/0000";
+            return date;
+        } else {
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            Date newDate = null;
+            try {
+                newDate = format.parse(dte);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            format = new SimpleDateFormat("dd-MMM-yyyy");
+            date = format.format(newDate);
+
+        }
+        return date;
+    }
+
+    public String finalDateFormat(String date) {
+
+        SimpleDateFormat format1 = new SimpleDateFormat("dd-MMM-yyyy");
+        Date newDate = null;
+        try {
+            newDate = format1.parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        format1 = new SimpleDateFormat("yyyy-MM-dd");
+        date = format1.format(newDate);
+        return date;
+
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        finish();
+        overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    public void slideToBottom(View view) {
+        TranslateAnimation animate = new TranslateAnimation(0, 0, 0, view.getHeight());
+        animate.setDuration(500);
+        animate.setFillAfter(true);
+        view.startAnimation(animate);
+        view.setVisibility(View.GONE);
+    }
+
+    public void slideToTop(View view) {
+        TranslateAnimation animate = new TranslateAnimation(0, 0, view.getHeight(), 0);
+        animate.setDuration(500);
+        animate.setFillAfter(true);
+        view.startAnimation(animate);
+        view.setVisibility(View.VISIBLE);
+    }
+
+    private void getMyProfile() {
+        if (new UtilService().isNetworkAvailable(MyProfileActivity.this)) {
+            progressDialog = new TransparentProgressDialog(MyProfileActivity.this);
+            progressDialog.show();
+
+            try {
+                restService.getProfile().enqueue(new Callback<UserResponse>() {
+                    @Override
+                    public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            MY_PROFILE = response.body();
+                            if (MY_PROFILE.getData().getIs_married().equalsIgnoreCase("1")) {
+                                checkBoxMarried.setChecked(true);
+                                linearWeddingDate.setVisibility(View.VISIBLE);
+                            }
+                            setMyProfile();
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                        }
+
+                        new Handler().postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                if (getPreferences(MODE_PRIVATE).getBoolean("MyProfileActivity", true)) {
+                                    showHelpScreen();
+                                    getPreferences(MODE_PRIVATE).edit().putBoolean("MyProfileActivity", false).apply();
+                                }
+                            }
+                        }, 1000);
+                    }
+
+                    @Override
+                    public void onFailure(Call<UserResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+            }
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+    protected void onResume() {
+        super.onResume();
+
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    private void setMyProfile() {
+
+        email.setText(MY_PROFILE.getData().getEmailid());
+        mobile.setText(MY_PROFILE.getData().getMobileno());
+        dealer.setText(MY_PROFILE.getData().getDealer().getDealer_name());
+        designation.setText(MY_PROFILE.getData().getRolename());
+        doj.setText(dateFormate(MY_PROFILE.getData().getDoj()));
+        zone.setText(MY_PROFILE.getData().getZone());
+        region.setText(MY_PROFILE.getData().getZone());
+        state.setText(MY_PROFILE.getData().getState());
+        city.setText(MY_PROFILE.getData().getCity());
+        dob.setText(dateFormate(MY_PROFILE.getData().getDob()));
+        weddingDate.setText(dateFormate(MY_PROFILE.getData().getMarriage_date()));
+        collapsingToolbar.setTitle(MY_PROFILE.getData().getFname() + " " + MY_PROFILE.getData().getLname());
+        collapsingToolbar.setSubtitle(MY_PROFILE.getData().getRolename());
+        Glide.with(this).load(MY_PROFILE.getData().getProfile_photo())
+                .thumbnail(Glide.with(this).load(R.drawable.gif_loader))
+                .into(userImage);
+    }
+
+    @Override
+    public void onPickResult(PickResult pickResult) {
+        if (pickResult.getError() == null) {
+            IMAGE_PATH = pickResult.getPath();
+            if (IMAGE_PATH != null && !IMAGE_PATH.trim().isEmpty()) {
+                Intent intent = new Intent(MyProfileActivity.this, CropActivity.class);
+                CropActivity.mSourceUri = pickResult.getUri();
+                startActivityForResult(intent, 2276);
+            } else {
+                userImage.setImageBitmap(pickResult.getBitmap());
+            }
+
+        } else {
+            GlobalData.showToast(this, pickResult.getError().getMessage(), Toast.LENGTH_LONG).show();
+        }
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == RESULT_OK && requestCode == 2276) {
+            IMAGE_PATH = data.getStringExtra("IMAGE_PATH");
+            Glide.with(this).load(new File(IMAGE_PATH))
+                    .thumbnail(Glide.with(this).load(R.drawable.gif_loader))
+                    .into(userImage);
+        } else if (resultCode == RESULT_CANCELED && requestCode == 2276) {
+            IMAGE_PATH = "";
+        }
+    }
+
+    private void showHelpScreen() {
+        try {
+            new FancyShowCaseView.Builder(this)
+                    .focusOn(editButton)
+                    .title("Tap here to edit profile details")
+                    .titleSize(22, 1)
+                    .closeOnTouch(true)
+                    .focusShape(FocusShape.CIRCLE)
+                    .backgroundColor(Color.parseColor("#99000000"))
+                    .build()
+                    .show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    public void updateProfile() {
+        if (dob.getText().toString().trim().isEmpty() || dob.getText().toString().equalsIgnoreCase("00/00/0000")) {
+            GlobalData.showToast(this, "Enter Date of Birth", Toast.LENGTH_SHORT).show();
+            return;
+        }
+
+        if (email.getText().toString().trim().isEmpty()) {
+            GlobalData.showToast(this, "Enter email", Toast.LENGTH_SHORT).show();
+            return;
+        }
+        if (!isValidEmail(email.getText().toString())) {
+            GlobalData.showToast(this, "Enter valid email address", Toast.LENGTH_SHORT).show();
+            return;
+        }
+
+        if (mobile.getText().toString().trim().isEmpty()) {
+            GlobalData.showToast(this, "Enter mobile number", Toast.LENGTH_SHORT).show();
+            return;
+        }
+
+        if (checkBoxMarried.isChecked()) {
+            if (weddingDate.getText().toString().trim().isEmpty() || weddingDate.getText().toString().equalsIgnoreCase("00/00/0000")) {
+                GlobalData.showToast(this, "Enter wedding date", Toast.LENGTH_SHORT).show();
+                return;
+            }
+        }
+
+        if (new UtilService().isNetworkAvailable(MyProfileActivity.this)) {
+            if (IMAGE_PATH.trim().isEmpty()) {
+                try {
+                    HashMap<String, String> map = new HashMap<>();
+                    map.put("dob", finalDateFormat(dob.getText().toString().trim()));
+                    map.put("email", email.getText().toString().trim());
+                    map.put("is_married", checkBoxMarried.isChecked() ? "1" : "0");
+                    if (checkBoxMarried.isChecked()) {
+                        map.put("marriage_date", finalDateFormat(weddingDate.getText().toString().trim()));
+                    } else {
+                        map.put("marriage_date", "0000-00-00");
+                    }
+
+                    progressDialog = new TransparentProgressDialog(MyProfileActivity.this);
+                    progressDialog.show();
+                    restService.postProfile(map).enqueue(new Callback<UserResponse>() {
+                        @Override
+                        public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+
+                            if (response.body() != null && response.body().getStatus() == 200) {
+                                MY_PROFILE = response.body();
+                                GlobalData.showToast(MyProfileActivity.this, "Profile updated successfully", Toast.LENGTH_SHORT).show();
+                                setMyProfile();
+                                GlobalData.user.setData(response.body().getData());
+                                saveUserData();
+                                new Handler(HomeActivity.profileUpdateCallback).sendEmptyMessage(0);
+
+                            } else if (response.body() != null && response.body().getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            } else if (response.body() != null) {
+                                GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                            } else if (response.errorBody() != null) {
+                                Gson gson = new Gson();
+                                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                                if (message.getStatus() == 401) {
+                                    GlobalData.canLogout = true;
+                                    finish();
+                                }
+                            }
+                        }
+
+                        @Override
+                        public void onFailure(Call<UserResponse> call, Throwable t) {
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+                            GlobalData.showToast(MyProfileActivity.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                        }
+                    });
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+
+            } else {
+                File file = new File(IMAGE_PATH);
+                RequestBody reqFile = RequestBody.create(MediaType.parse("image/*"), file);
+                MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getName(), reqFile);
+                RequestBody emailtxt = RequestBody.create(MediaType.parse("text/plain"), email.getText().toString().trim());
+                RequestBody dobtxt = RequestBody.create(MediaType.parse("text/plain"), finalDateFormat(dob.getText().toString().trim()));
+                RequestBody isMarried = RequestBody.create(MediaType.parse("text/plain"), checkBoxMarried.isChecked() ? "1" : "0");
+                RequestBody isMarriedDate = RequestBody.create(MediaType.parse("text/plain"), "0000-00-00");
+                if (checkBoxMarried.isChecked()) {
+                    isMarriedDate = RequestBody.create(MediaType.parse("text/plain"), finalDateFormat(weddingDate.getText().toString().trim()));
+                }
+                progressDialog = new TransparentProgressDialog(MyProfileActivity.this);
+                progressDialog.show();
+                restService.postProfileWithImage(body, emailtxt, dobtxt, isMarried, isMarriedDate).enqueue(new Callback<UserResponse>() {
+                    @Override
+                    public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            MY_PROFILE = response.body();
+                            GlobalData.showToast(MyProfileActivity.this, "Profile updated successfully", Toast.LENGTH_SHORT).show();
+                            setMyProfile();
+                            GlobalData.user.setData(response.body().getData());
+                            saveUserData();
+                            new Handler(HomeActivity.profileUpdateCallback).sendEmptyMessage(0);
+
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<UserResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        t.printStackTrace();
+                        GlobalData.showToast(MyProfileActivity.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+            }
+
+        } else {
+            GlobalData.showToast(MyProfileActivity.this, "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void showInstructions() {
+        View view = LayoutInflater.from(MyProfileActivity.this).inflate(
+                R.layout.profile_success, null);
+        TextView textHead = (TextView) view.findViewById(R.id.textHead);
+        TextView text1 = (TextView) view.findViewById(R.id.text1);
+        TextView text2 = (TextView) view.findViewById(R.id.text2);
+        TextView text3 = (TextView) view.findViewById(R.id.text3);
+
+
+        view.findViewById(R.id.btn_ok).setOnClickListener(
+                new View.OnClickListener() {
+
+                    @Override
+                    public void onClick(View v) {
+                        alertDialog.dismiss();
+                        startActivity(new Intent(MyProfileActivity.this, HomeActivity.class));
+                    }
+                });
+
+        alertDialogBuilder = new AlertDialog.Builder(MyProfileActivity.this);
+        alertDialogBuilder.setCancelable(false);
+        alertDialogBuilder.setView(view);
+        alertDialog = alertDialogBuilder.create();
+        alertDialog.show();
+    }
+
+
+    private void saveUserData() {
+        editButton.performClick();
+        GlobalData.sdb.delete("session", null, null);
+        Gson gson = new Gson();
+        JsonElement jsonElement = gson.toJsonTree(
+                GlobalData.user, new TypeToken<UserResponse>() {
+                }.getType());
+        ContentValues values = new ContentValues();
+        values.put("user", jsonElement.toString());
+        GlobalData.sdb.insert("session", null, values);
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(MyProfileActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
+

+ 106 - 0
Android/app/src/main/java/com/cygnusa/hyperm/MyTrainingModuleActivity.java

@@ -0,0 +1,106 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.view.MenuItem;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+import androidx.viewpager.widget.ViewPager;
+
+import com.ogaclejapan.smarttablayout.SmartTabLayout;
+import com.cygnusa.hyperm.fragments.TrainingScoreCommandFragment;
+
+import java.util.Objects;
+
+public class MyTrainingModuleActivity extends AppCompatActivity {
+
+    ViewPager viewPager;
+    SmartTabLayout viewPagerTab;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_view_pager);
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        viewPagerTab = findViewById(R.id.trainingModulePagerTab);
+        viewPager = findViewById(R.id.viewPager);
+        viewPager.setOffscreenPageLimit(2);
+
+        viewPager.setAdapter(new TrainingPagerAdapter(getSupportFragmentManager()));
+        viewPagerTab.setViewPager(viewPager);
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            onBackPressed();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    public class TrainingPagerAdapter extends FragmentPagerAdapter {
+
+        TrainingPagerAdapter(FragmentManager fm) {
+            super(fm);
+        }
+
+        @NonNull
+        @Override
+        public Fragment getItem(int position) {
+            Fragment fragment = null;
+            if (position == 0) {
+                //fragment = new ClassRoomTainingFragment();
+            } else if (position == 1) {
+                fragment = new TrainingScoreCommandFragment();
+            }
+            assert fragment != null;
+            return fragment;
+        }
+
+        @Override
+        public int getCount() {
+            return 2;
+        }
+
+
+        @Override
+        public CharSequence getPageTitle(int position) {
+            switch (position) {
+                case 0:
+                    return getResources().getString(R.string.attendanceMarking);
+                case 1:
+                    return getResources().getString(R.string.scoreAndCommand);
+            }
+            return null;
+        }
+    }
+}

+ 309 - 0
Android/app/src/main/java/com/cygnusa/hyperm/MyWallet.java

@@ -0,0 +1,309 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.appcompat.widget.Toolbar;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.firebase.analytics.FirebaseAnalytics;
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.adapter.OrderHistoryAdapter;
+import com.cygnusa.hyperm.autofit.AutofitTextView;
+import com.cygnusa.hyperm.droppy.DroppyClickCallbackInterface;
+import com.cygnusa.hyperm.droppy.DroppyMenuItem;
+import com.cygnusa.hyperm.droppy.DroppyMenuPopup;
+import com.cygnusa.hyperm.droppy.EasyDialog;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.OrderHistoryResponse;
+import com.tylersuehr.esr.EmptyStateRecyclerView;
+import com.tylersuehr.esr.TextStateDisplay;
+
+import java.util.Objects;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class MyWallet extends AppCompatActivity {
+    TextView title, earnedPoints;
+    Button purchaseNow;
+    TransparentProgressDialog progressDialog;
+    AutofitTextView points, unApprovedPoints;
+    EmptyStateRecyclerView purchasedList;
+    LinearLayoutManager linearLayoutManager;
+    ProgressBar progressBar;
+    ApiService restService;
+
+    public OrderHistoryResponse dataOrderHistory = new OrderHistoryResponse();
+    int TOTAL_RECORD = 0;
+    int PAGE = 0;
+    int LIMIT = 10;
+    public static Handler.Callback callbackOrderHistory;
+    public static String strCurrentAmount = "";
+
+    ImageView rightMenu;
+    EasyDialog easyDialog;
+    DroppyMenuPopup droppyMenu;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_wallet_history);
+        rightMenu = findViewById(R.id.rightMenu);
+
+        restService = ((MainApplication) getApplication()).getClient();
+        title = findViewById(R.id.title);
+        points = findViewById(R.id.points);
+        unApprovedPoints = findViewById(R.id.unApprovedPoints);
+
+        FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(this);
+
+        Bundle bundle = new Bundle();
+       /* bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "1");
+        bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "MyWalletActivity");
+        firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);*/
+        // GlobalData.user.getData().setMpin("");
+        purchaseNow = findViewById(R.id.btn_purchase);
+        purchasedList = findViewById(R.id.redeemProductList);
+        purchasedList.setHasFixedSize(true);
+        purchasedList.setItemAnimator(new SlideInLeftAnimator());
+        linearLayoutManager = new LinearLayoutManager(MyWallet.this);
+        purchasedList.setLayoutManager(linearLayoutManager);
+        purchasedList.addOnScrollListener(recyclerViewOnScrollListener);
+        callbackOrderHistory = new Handler.Callback() {
+            @Override
+            public boolean handleMessage(Message msg) {
+                getOrderHistory();
+                return false;
+            }
+        };
+
+        purchasedList.post(new Runnable() {
+            @Override
+            public void run() {
+
+                getOrderHistory();
+            }
+        });
+
+
+        purchasedList.setStateDisplay(EmptyStateRecyclerView.STATE_EMPTY,
+                new TextStateDisplay(this, "No data available", ""));
+
+        purchaseNow.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                startActivity(new Intent(MyWallet.this, RedeemProductListActivity.class));
+            }
+        });
+        progressBar = findViewById(R.id.progressBar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        initDroppyMenu();
+        rightMenu.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                easyDialog = new EasyDialog(MyWallet.this, droppyMenu)
+                        .setLayout(droppyMenu.show())
+                        .setGravity(EasyDialog.GRAVITY_BOTTOM)
+                        .setBackgroundColor(Color.TRANSPARENT, Color.WHITE)
+                        .setLocationByAttachedView(rightMenu)
+                        .setAnimationTranslationShow(EasyDialog.DIRECTION_X, 350,
+                                GlobalData.width, 0)
+                        .setAnimationTranslationDismiss(EasyDialog.DIRECTION_X, 350, 0,
+                                GlobalData.width).setTouchOutsideDismiss(true)
+                        .setMatchParent(false).setMarginLeftAndRight(0, 15)
+                        .setOutsideColor(Color.parseColor("#80000000")).show();
+
+            }
+        });
+    }
+
+    private void initDroppyMenu() {
+        DroppyMenuPopup.Builder droppyBuilder = new DroppyMenuPopup.Builder(
+                MyWallet.this, rightMenu);
+        droppyBuilder.addMenuItem(new DroppyMenuItem("Change Pin", R.mipmap.icon_change_password))
+                .triggerOnAnchorClick(false);
+        droppyBuilder.setOnClick(new DroppyClickCallbackInterface() {
+            @Override
+            public void call(View v, int id) {
+                easyDialog.dismiss();
+                switch (id) {
+                    case 0:
+                        new Handler().postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                Intent i = new Intent(MyWallet.this, OtpActivity.class);
+                                i.putExtra("type", "change");
+                                startActivity(i);
+
+                            }
+                        }, 300);
+                        break;
+                }
+            }
+        });
+        droppyMenu = droppyBuilder.build();
+    }
+
+    protected void onResume() {
+        super.onResume();
+
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    private RecyclerView.OnScrollListener recyclerViewOnScrollListener = new RecyclerView.OnScrollListener() {
+        @Override
+        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
+            super.onScrollStateChanged(recyclerView, newState);
+        }
+
+        @Override
+        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+            super.onScrolled(recyclerView, dx, dy);
+            int visibleItemCount = linearLayoutManager.getChildCount();
+            int totalItemCount = linearLayoutManager.getItemCount();
+            int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition();
+
+            if (progressBar.getVisibility() != View.VISIBLE) {
+                if ((visibleItemCount + firstVisibleItemPosition) >= totalItemCount
+                        && firstVisibleItemPosition >= 0
+                        && totalItemCount < TOTAL_RECORD && dataOrderHistory.getData().size() < TOTAL_RECORD) {
+                    PAGE++;
+                    getOrderHistory();
+                }
+            }
+        }
+    };
+
+    private void getOrderHistory() {
+        if (new UtilService().isNetworkAvailable(this)) {
+            progressDialog = new TransparentProgressDialog(this);
+            progressDialog.show();
+            try {
+                restService.getOrderHistory(PAGE, LIMIT).enqueue(new Callback<OrderHistoryResponse>() {
+                    @Override
+                    public void onResponse(Call<OrderHistoryResponse> call, Response<OrderHistoryResponse> response) {
+                        dataOrderHistory = response.body();
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (dataOrderHistory != null && dataOrderHistory.getStatus() == 200) {
+                            setDataOrderHistory();
+                        } else if (response.body() != null && Objects.requireNonNull(response.body()).getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                            finish();
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(MyWallet.this, Objects.requireNonNull(response.body()).getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(Objects.requireNonNull(response.errorBody()).charStream(), ErrorResponse.class);
+                            GlobalData.showToast(MyWallet.this, message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                                finish();
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<OrderHistoryResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(MyWallet.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        } else {
+            GlobalData.showToast(MyWallet.this, "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            confirmClose();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void confirmClose() {
+        finish();
+        overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void setDataOrderHistory() {
+        strCurrentAmount = dataOrderHistory.getCurrent_amount();
+        if (dataOrderHistory != null) {
+            int totalAmount = 0;
+            try {
+                totalAmount = Integer.parseInt(strCurrentAmount);
+            } catch (NumberFormatException e) {
+                e.printStackTrace();
+            }
+            if (totalAmount > 0) {
+                purchaseNow.setEnabled(true);
+                purchaseNow.setAlpha(1f);
+            }
+        }
+        points.setText(dataOrderHistory.getCurrent_amount());
+        if (dataOrderHistory.getUnapproved_amount() == null)
+            unApprovedPoints.setText("0");
+        else
+            unApprovedPoints.setText("" + dataOrderHistory.getUnapproved_amount());
+        OrderHistoryAdapter adapter = new OrderHistoryAdapter(this, dataOrderHistory.getData());
+        purchasedList.setAdapter(adapter);
+
+    }
+}

+ 464 - 0
Android/app/src/main/java/com/cygnusa/hyperm/NotificationActivity.java

@@ -0,0 +1,464 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.PorterDuff;
+import android.graphics.RectF;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.appcompat.widget.Toolbar;
+import androidx.recyclerview.widget.ItemTouchHelper;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ProgressBar;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.adapter.NotificationAdapter;
+import com.cygnusa.hyperm.fancyshowcase.DismissListener;
+import com.cygnusa.hyperm.fancyshowcase.FancyShowCaseView;
+import com.cygnusa.hyperm.fancyshowcase.FocusShape;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.MyCallback;
+import com.cygnusa.hyperm.util.PositionUpdateListener;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.util.WrapContentLinearLayoutManager;
+import com.cygnusa.hyperm.wrappers.AssessmentList;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.Notification;
+import com.cygnusa.hyperm.wrappers.NotificationResponse;
+import com.tylersuehr.esr.EmptyStateRecyclerView;
+import com.tylersuehr.esr.TextStateDisplay;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class NotificationActivity extends AppCompatActivity implements PositionUpdateListener, DismissListener {
+    ApiService restService;
+    EmptyStateRecyclerView notificationList;
+    TransparentProgressDialog progressDialog;
+    int PAGE = 0;
+    int LIMIT = 10;
+    WrapContentLinearLayoutManager linearLayoutManager;
+    int TOTAL_RECORD = 0;
+    ProgressBar progressBar;
+    ArrayList<Notification> MY_NOTIFICATIONS = new ArrayList<>();
+    NotificationAdapter adapter;
+    private Paint p = new Paint();
+    public static Handler.Callback notificationCallback;
+    ArrayList<AssessmentList> ASSESSMENT_LIST = new ArrayList<>();
+    ArrayList<AssessmentList> OFFLINE_ASSESSMENT_LIST = new ArrayList<>();
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_notification);
+        setupWindowAnimations();
+
+        restService = ((MainApplication) getApplication()).getClient();
+        GlobalData.openDatabase(NotificationActivity.this);
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        notificationList = findViewById(R.id.notificationList);
+        notificationList.setHasFixedSize(true);
+        notificationList.setItemAnimator(new SlideInLeftAnimator());
+        linearLayoutManager = new WrapContentLinearLayoutManager(getBaseContext());
+        notificationList.setLayoutManager(linearLayoutManager);
+        notificationList.addOnScrollListener(recyclerViewOnScrollListener);
+        progressBar = findViewById(R.id.progressBar);
+        notificationList.setStateDisplay(EmptyStateRecyclerView.STATE_EMPTY,
+                new TextStateDisplay(this, "No data available", ""));
+
+        notificationList.post(new Runnable() {
+            @Override
+            public void run() {
+                getNotifications(true);
+            }
+        });
+
+        initSwipe();
+
+        findViewById(R.id.helpIcon).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showHelpScreen();
+            }
+        });
+
+        notificationCallback = new Handler.Callback() {
+            @Override
+            public boolean handleMessage(Message msg) {
+                PAGE = 0;
+                getNotifications(false);
+                return false;
+            }
+        };
+    }
+
+    private void showHelpScreen() {
+        try {
+            View view;
+//            if (adapter != null && adapter.getItemCount() > 0) {
+//                view = notificationList.findViewHolderForAdapterPosition(linearLayoutManager.findFirstVisibleItemPosition()).itemView;
+//            } else {
+//                view = notificationList;
+//            }
+            new FancyShowCaseView.Builder(this)
+                    .focusOn(notificationList)
+                    .title("Tap here to view notification")
+                    .titleSize(22, 1)
+                    .titleGravity(1)
+                    .closeOnTouch(true)
+                    .fitSystemWindows(false)
+                    .dismissListener(this)
+                    .focusShape(FocusShape.ROUNDED_RECTANGLE)
+                    .backgroundColor(Color.parseColor("#99000000"))
+                    .build()
+                    .show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    @Override
+    public void onDismiss(String id) {
+        try {
+            View view;
+            if (adapter != null && adapter.getItemCount() > 0) {
+                view = notificationList.findViewHolderForAdapterPosition(linearLayoutManager.findFirstVisibleItemPosition()).itemView;
+            } else {
+                view = notificationList;
+            }
+            new FancyShowCaseView.Builder(this)
+                    .focusOn(view)
+                    .title("Swipe right to left delete notification")
+                    .titleSize(22, 1)
+                    .closeOnTouch(true)
+                    .fitSystemWindows(false)
+                    .focusShape(FocusShape.ROUNDED_RECTANGLE)
+                    .backgroundColor(Color.parseColor("#99000000"))
+                    .build()
+                    .show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void onSkipped(String id) {
+
+    }
+
+    private void initSwipe() {
+        ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) {
+
+            @Override
+            public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
+                return false;
+            }
+
+            @Override
+            public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
+                int position = viewHolder.getAdapterPosition();
+                if (direction == ItemTouchHelper.LEFT) {
+                    try {
+                        notificationList.setEnabled(false);
+                        deleteNotification(position);
+                        notificationList.setEnabled(true);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+
+            @Override
+            public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
+
+                Bitmap icon;
+                if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) {
+
+                    View itemView = viewHolder.itemView;
+                    float height = (float) itemView.getBottom() - (float) itemView.getTop();
+                    float width = height / 3;
+
+                    if (dX < 0) {
+                        p.setColor(Color.RED);
+                        RectF background = new RectF((float) itemView.getRight() + dX, (float) itemView.getTop(),
+                                (float) itemView.getRight(), (float) itemView.getBottom());
+                        c.drawRect(background, p);
+                        icon = BitmapFactory.decodeResource(getResources(), R.mipmap.delete_icon);
+                        RectF icon_dest = new RectF((float) itemView.getRight() - 2 * width,
+                                (float) itemView.getTop() + width, (float) itemView.getRight() - width,
+                                (float) itemView.getBottom() - width);
+                        c.drawBitmap(icon, null, icon_dest, p);
+                    }
+                }
+                super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
+            }
+        };
+        ItemTouchHelper itemTouchHelper = new ItemTouchHelper(simpleItemTouchCallback);
+        itemTouchHelper.attachToRecyclerView(notificationList);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    private void getNotifications(boolean canLoadProgress) {
+        if (new UtilService().isNetworkAvailable(NotificationActivity.this)) {
+            if (canLoadProgress) {
+                progressDialog = new TransparentProgressDialog(NotificationActivity.this);
+                progressDialog.show();
+                progressBar.setVisibility(View.GONE);
+            } else {
+                progressBar.setVisibility(View.VISIBLE);
+            }
+
+            restService.getNotifications(PAGE, LIMIT).enqueue(new Callback<NotificationResponse>() {
+                @Override
+                public void onResponse(Call<NotificationResponse> call, Response<NotificationResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    progressBar.setVisibility(View.GONE);
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        TOTAL_RECORD = Integer.parseInt(response.body().getTotal());
+
+                        if (adapter == null) {
+                            MY_NOTIFICATIONS = response.body().getData();
+                            adapter = new NotificationAdapter(NotificationActivity.this, MY_NOTIFICATIONS,
+                                    NotificationActivity.this, restService);
+                            notificationList.setAdapter(adapter);
+                        } else {
+
+                            MY_NOTIFICATIONS.addAll(response.body().getData());
+                            adapter.notifyDataSetChanged();
+                        }
+
+                        if (MY_NOTIFICATIONS.size() == 0) {
+                            notificationList.invokeState(EmptyStateRecyclerView.STATE_EMPTY);
+                        } else {
+                            notificationList.invokeState(EmptyStateRecyclerView.STATE_OK);
+                        }
+
+                        GlobalData.sdb.delete("notifications", null, null);
+                        Gson gson = new Gson();
+                        JsonElement jsonElement = gson.toJsonTree(
+                                MY_NOTIFICATIONS, new TypeToken<ArrayList<Notification>>() {
+                                }.getType());
+                        ContentValues values = new ContentValues();
+                        values.put("notifications", jsonElement.toString());
+                        GlobalData.sdb.insert("notifications", null, values);
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        }
+                    }
+
+                    new Handler().postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            if (getPreferences(MODE_PRIVATE).getBoolean("NotificationActivity", true)) {
+                                showHelpScreen();
+                                getPreferences(MODE_PRIVATE).edit().putBoolean("NotificationActivity", false).apply();
+                            }
+                        }
+                    }, 1000);
+                }
+
+                @Override
+                public void onFailure(Call<NotificationResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    progressBar.setVisibility(View.GONE);
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            if (adapter == null) {
+                Cursor cursor = GlobalData.sdb.rawQuery("select * from notifications", null);
+                if (cursor.getCount() > 0) {
+                    cursor.moveToFirst();
+                    Gson gson = new Gson();
+                    MY_NOTIFICATIONS = gson.fromJson(
+                            cursor.getString(cursor.getColumnIndex("notifications")),
+                            new TypeToken<ArrayList<Notification>>() {
+                            }.getType());
+                    TOTAL_RECORD = MY_NOTIFICATIONS.size();
+                    adapter = new NotificationAdapter(NotificationActivity.this, MY_NOTIFICATIONS,
+                            NotificationActivity.this, restService);
+                    notificationList.setAdapter(adapter);
+                } else {
+                    GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+                }
+            } else {
+                GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+            }
+        }
+    }
+
+
+    private RecyclerView.OnScrollListener recyclerViewOnScrollListener = new RecyclerView.OnScrollListener() {
+        @Override
+        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
+            super.onScrollStateChanged(recyclerView, newState);
+        }
+
+        @Override
+        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+            super.onScrolled(recyclerView, dx, dy);
+            int visibleItemCount = linearLayoutManager.getChildCount();
+            int totalItemCount = linearLayoutManager.getItemCount();
+            int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition();
+
+            if (progressBar.getVisibility() != View.VISIBLE) {
+                if ((visibleItemCount + firstVisibleItemPosition) >= totalItemCount
+                        && firstVisibleItemPosition >= 0
+                        && totalItemCount < TOTAL_RECORD && MY_NOTIFICATIONS.size() < TOTAL_RECORD) {
+                    PAGE++;
+                    getNotifications(false);
+                }
+            }
+        }
+    };
+
+    @Override
+    public void onPositionUpdate(int position) {
+
+    }
+
+    private void deleteNotification(int id) {
+        Cursor cursor = GlobalData.sdb.rawQuery("select * from notification_deleted", null);
+        String ids;
+        if (cursor.getCount() > 0) {
+            cursor.moveToFirst();
+            ids = cursor.getString(cursor.getColumnIndex("notification_deleted"));
+            ids = ids + "," + MY_NOTIFICATIONS.get(id).getId().trim();
+        } else {
+            ids = MY_NOTIFICATIONS.get(id).getId().trim();
+        }
+        adapter.remove(id);
+        if (MY_NOTIFICATIONS.size() == 0) {
+            notificationList.invokeState(EmptyStateRecyclerView.STATE_EMPTY);
+        }
+
+        GlobalData.sdb.delete("notification_deleted", null, null);
+        ContentValues values1 = new ContentValues();
+        values1.put("notification_deleted", ids);
+        GlobalData.sdb.insert("notification_deleted", null, values1);
+
+        GlobalData.sdb.delete("notifications", null, null);
+        Gson gson = new Gson();
+        JsonElement jsonElement = gson.toJsonTree(
+                MY_NOTIFICATIONS, new TypeToken<ArrayList<Notification>>() {
+                }.getType());
+        ContentValues values = new ContentValues();
+        values.put("notifications", jsonElement.toString());
+        GlobalData.sdb.insert("notifications", null, values);
+
+        if (new UtilService().isNetworkAvailable(NotificationActivity.this)) {
+            HashMap<String, String> map = new HashMap<>();
+            map.put("notificationid", ids);
+
+            restService.updateDeleteNotifications(map)
+                    .enqueue(new MyCallback<ErrorResponse>(ids) {
+                        @Override
+                        public void onResponse(Call<ErrorResponse> call, Response<ErrorResponse> response) {
+                            if (response.body() != null && response.body().getStatus() == 200) {
+                                GlobalData.sdb.delete("notification_deleted", null, null);
+                            }
+                            try {
+                                new android.os.Handler(HomeActivity.badgeUpdateCallback).sendEmptyMessage(0);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }
+
+                        @Override
+                        public void onFailure(Call<ErrorResponse> call, Throwable t) {
+                            GlobalData.showToast(NotificationActivity.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                        }
+                    });
+        } else {
+            try {
+                new android.os.Handler(HomeActivity.badgeUpdateCallback).sendEmptyMessage(0);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+}

+ 88 - 0
Android/app/src/main/java/com/cygnusa/hyperm/NotificationViewActivity.java

@@ -0,0 +1,88 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.text.method.ScrollingMovementMethod;
+import android.view.MenuItem;
+import android.widget.TextView;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import com.google.firebase.analytics.FirebaseAnalytics;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.wrappers.Notification;
+
+import java.util.Objects;
+
+
+public class NotificationViewActivity extends AppCompatActivity {
+    TextView title, contentTitle, contentDescription;
+    public static Notification NOTIFICATION = new Notification();
+    Toolbar toolbar;
+    private FirebaseAnalytics firebaseAnalytics;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_notification_view);
+        setupWindowAnimations();
+        title = findViewById(R.id.title);
+        firebaseAnalytics = FirebaseAnalytics.getInstance(this);
+        Bundle bundle = new Bundle();
+
+        contentTitle = findViewById(R.id.contentTitle);
+        contentTitle.setText(NOTIFICATION.getNotificationtitle());
+        contentDescription = findViewById(R.id.contentDescription);
+        contentDescription.setText(NOTIFICATION.getNotificationtext());
+        contentDescription.setMovementMethod(new ScrollingMovementMethod());
+
+        toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+    }
+
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+}

+ 454 - 0
Android/app/src/main/java/com/cygnusa/hyperm/OtpActivity.java

@@ -0,0 +1,454 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.graphics.Paint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.pinview.PinView;
+import com.cygnusa.hyperm.screenpinview.AppLockActivity;
+import com.cygnusa.hyperm.screenpinview.ChangeAppLockActivity;
+import com.cygnusa.hyperm.screenpinview.ForgotAppLockActivity;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.OtpResponse;
+import com.cygnusa.hyperm.wrappers.UserResponse;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class OtpActivity extends AppCompatActivity {
+
+    PinView pinview;
+    public OtpResponse errorResponse = new OtpResponse();
+    public UserResponse user = new UserResponse();
+    TransparentProgressDialog progressDialog;
+    ApiService restService;
+    public int counter;
+    TextView mobileNumTextView, resentOtpTxt, count_time;
+    String type;
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    Objects.requireNonNull(activity.getCurrentFocus()).getWindowToken(), 0);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        restService = ((MainApplication) getApplication()).getClient();
+
+        setContentView(R.layout.otp_activity);
+        Bundle extras = getIntent().getExtras();
+        if (extras != null) {
+            type = extras.getString("type");
+
+        }
+        pinview = findViewById(R.id.pinView);
+        count_time = findViewById(R.id.count_time);
+        mobileNumTextView = findViewById(R.id.mobileNo);
+        resentOtpTxt = findViewById(R.id.resentOtp);
+        resentOtpTxt.setEnabled(false);
+        resentOtpTxt.setAlpha(0.5f);
+        resentOtpTxt.setOnClickListener(
+                new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        reSentOtp();
+                    }
+                });
+        findViewById(R.id.btn_cancel).setOnClickListener(
+                new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        if (type.equalsIgnoreCase("forgot")) {
+                            Intent i = new Intent(OtpActivity.this, AppLockActivity.class);
+                            startActivity(i);
+                            finish();
+                        } else {
+                            Intent result = new Intent();
+                            setResult(Activity.RESULT_CANCELED, result);
+                            finish();
+                            OtpActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                                    R.anim.animation_f_leave);
+                        }
+
+                    }
+                });
+
+        findViewById(R.id.btn_submit).setOnClickListener(
+                new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        if (Objects.requireNonNull(pinview.getText()).toString().equalsIgnoreCase("")) {
+                            GlobalData.showToast(getBaseContext(), "Please enter Valid OTP", Toast.LENGTH_SHORT).show();
+                            return;
+                        }
+                        otpValidation(pinview.getText().toString());
+
+                    }
+                });
+        findViewById(R.id.bgLayout).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                try {
+                    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+                    imm.hideSoftInputFromWindow(pinview.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+
+
+            }
+        });
+        sentOtp();
+        setupWindowAnimations();
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+    }
+
+    @SuppressLint("SetTextI18n")
+    private void setData(String mobileNo, String otpexpirytime) {
+        int millsec = Integer.parseInt(otpexpirytime) * 60 * 1000;
+        new android.os.CountDownTimer(millsec, 1000) {
+            public void onTick(long millisUntilFinished) {
+                String formattedTime = String.format("%02d:%02d Sec",
+                        TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % TimeUnit.HOURS.toMinutes(1),
+                        TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % TimeUnit.MINUTES.toSeconds(1));
+                count_time.setText(formattedTime);
+                counter++;
+            }
+
+            @SuppressLint("SetTextI18n")
+            public void onFinish() {
+                count_time.setText("00:00");
+                resentOtpTxt.setEnabled(true);
+                resentOtpTxt.setAlpha(1f);
+            }
+        }.start();
+        Paint p = new Paint();
+        p.setColor(getResources().getColor(R.color.btn_bg_color));
+        resentOtpTxt.setPaintFlags(resentOtpTxt.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
+        String alterStr = new StringBuilder(mobileNo).replace(2, 7, "XXXXX").toString();
+        mobileNumTextView.setText("Your OTP has been sent to your " + alterStr);
+    }
+
+    public void sentOtp() {
+        if (new UtilService().isNetworkAvailable(OtpActivity.this)) {
+            progressDialog = new TransparentProgressDialog(OtpActivity.this);
+            progressDialog.show();
+
+            try {
+                HashMap<String, String> map = new HashMap<>();
+                map.put("device_type", "android");
+                restService.sentMPINOtp(map).enqueue(new Callback<OtpResponse>() {
+                    @Override
+                    public void onResponse(Call<OtpResponse> call, Response<OtpResponse> response) {
+                        errorResponse = response.body();
+
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        if (errorResponse != null && errorResponse.getStatus() == 200) {
+                            setData(GlobalData.user.getData().getMobileno(), errorResponse.getData().getOtp_expiry());
+                        } else if (errorResponse != null) {
+                            GlobalData.showToast(getBaseContext(), errorResponse.getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<OtpResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                GlobalData.showToast(getBaseContext(), "Server Error. Try again.", Toast.LENGTH_SHORT).show();
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+
+                e.printStackTrace();
+            }
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    public void reSentOtp() {
+        if (new UtilService().isNetworkAvailable(OtpActivity.this)) {
+            progressDialog = new TransparentProgressDialog(OtpActivity.this);
+            progressDialog.show();
+            try {
+                HashMap<String, String> map = new HashMap<>();
+                map.put("device_type", "android");
+                restService.sentMPINOtp(map).enqueue(new Callback<OtpResponse>() {
+                    @Override
+                    public void onResponse(Call<OtpResponse> call, Response<OtpResponse> response) {
+                        errorResponse = response.body();
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        if (errorResponse != null && errorResponse.getStatus() == 200) {
+                            setData(GlobalData.user.getData().getMobileno(), errorResponse.getData().getOtp_expiry());
+                        } else if (errorResponse != null) {
+                            GlobalData.showToast(getBaseContext(), errorResponse.getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        }
+
+
+                    }
+
+                    @Override
+                    public void onFailure(Call<OtpResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(OtpActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void otpValidation(String otp) {
+
+        boolean cancel = false;
+        View focusView = null;
+        if (Objects.requireNonNull(pinview.getText()).toString().length() < 4) {
+            GlobalData.showToast(getBaseContext(), "please enter 4 digits", Toast.LENGTH_SHORT).show();
+            focusView = pinview;
+            cancel = true;
+        }
+        if (cancel) {
+            focusView.requestFocus();
+        } else {
+            if (new UtilService().isNetworkAvailable(OtpActivity.this)) {
+                progressDialog = new TransparentProgressDialog(OtpActivity.this);
+                progressDialog.show();
+                try {
+                    HashMap<String, String> map = new HashMap<>();
+                    map.put("otp", otp);
+                    map.put("type", "mpin");
+
+
+                    restService.OtpValidation(map).enqueue(new Callback<UserResponse>() {
+                        @Override
+                        public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+                            user = response.body();
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+
+                            if (user != null && user.getStatus() == 200) {
+                                getSharedPreferences("FCM_TOKEN", Context.MODE_PRIVATE)
+                                        .edit().putString("FCM_TOKEN_ID", "").apply();
+                                if (Build.VERSION.SDK_INT >= 23) {
+                                    if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
+                                            == PackageManager.PERMISSION_GRANTED) {
+                                        File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                                                + "/" + ".HYPERM", "PDF");
+                                        if (f1.exists()) {
+                                            f1.delete();
+                                        }
+                                    }
+                                } else {
+                                    File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                                            + "/" + ".HYPERM", "PDF");
+                                    if (f1.exists()) {
+                                        f1.delete();
+                                    }
+                                }
+                                if (type.equalsIgnoreCase("change")) {
+                                    Intent i = new Intent(OtpActivity.this, ChangeAppLockActivity.class);
+                                    startActivity(i);
+                                    finish();
+                                } else if (type.equalsIgnoreCase("forgot")) {
+                                    Intent i = new Intent(OtpActivity.this, ForgotAppLockActivity.class);
+                                    startActivity(i);
+                                    finish();
+                                } else {
+                                    Intent i = new Intent(OtpActivity.this, AppLockActivity.class);
+                                    startActivity(i);
+                                    finish();
+                                }
+
+
+                            } else if (user != null) {
+                                GlobalData.showToast(getBaseContext(), user.getMessage(), Toast.LENGTH_SHORT).show();
+
+                            } else if (response.body() != null && Objects.requireNonNull(response.body()).getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                                finish();
+                            } else if (response.errorBody() != null) {
+                                Gson gson = new Gson();
+                                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+
+
+                                if (message.getStatus() == 401) {
+                                    GlobalData.canLogout = true;
+                                    new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                                    finish();
+                                }
+
+
+                            }
+
+
+                        }
+
+                        @Override
+                        public void onFailure(Call<UserResponse> call, Throwable t) {
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+                            GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                        }
+                    });
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            } else {
+                GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+            }
+        }
+
+    }
+
+
+    @Override
+    public void onBackPressed() {
+
+        if (type.equalsIgnoreCase("forgot")) {
+            Intent i = new Intent(OtpActivity.this, AppLockActivity.class);
+            startActivity(i);
+            finish();
+        } else {
+            finish();
+            OtpActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    protected void onResume() {
+        super.onResume();
+
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+
+            if (type.equalsIgnoreCase("forgot")) {
+                Intent i = new Intent(OtpActivity.this, AppLockActivity.class);
+                startActivity(i);
+                finish();
+            } else {
+                finish();
+                OtpActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                        R.anim.animation_f_leave);
+            }
+
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+}

+ 610 - 0
Android/app/src/main/java/com/cygnusa/hyperm/PdfViewActivity.java

@@ -0,0 +1,610 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.database.Cursor;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.StrictMode;
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.github.barteksc.pdfviewer.PDFView;
+import com.github.barteksc.pdfviewer.listener.OnLoadCompleteListener;
+import com.github.barteksc.pdfviewer.listener.OnPageChangeListener;
+import com.github.barteksc.pdfviewer.listener.OnPageErrorListener;
+import com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle;
+import com.github.barteksc.pdfviewer.util.FitPolicy;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.MyCallback;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ContentFile;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.HitCountModel;
+import com.cygnusa.hyperm.wrappers.MyContent;
+import com.cygnusa.hyperm.wrappers.MyTopic;
+import com.cygnusa.hyperm.wrappers.TrainingCategory;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.security.InvalidKeyException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Objects;
+
+import javax.crypto.Cipher;
+import javax.crypto.CipherInputStream;
+import javax.crypto.CipherOutputStream;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.spec.SecretKeySpec;
+
+import okhttp3.ResponseBody;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class PdfViewActivity extends AppCompatActivity implements OnPageChangeListener, OnPageErrorListener, OnLoadCompleteListener {
+    TextView title, contentTitle, mTextLanguageSelection;
+    public static MyContent CONTENT = new MyContent();
+    public static MyTopic TOPIC = new MyTopic();
+    public static TrainingCategory TRAINING_ID = new TrainingCategory();
+    //  public static String TRAINING_ID="";
+    ImageView mImageLangSelection;
+    ProgressBar progressBar;
+    PDFView pdfView;
+    ApiService restService;
+    private AlertDialog.Builder builder;
+    private ContentFile SELECTED_CONTENT = new ContentFile();
+    String type;
+    public static boolean isOffline = false;
+    Handler handler = new Handler();
+    public static final String HASH_ALGORITHM = "SHA-256";
+    public String encryptKey = "Hyperm";
+    public File decryptFile = null;
+    private StorePreference storePreference;
+    public static String tempfilename = "temp";
+    String fromTime, toTime, finalTime;
+    Calendar c;
+    SimpleDateFormat df;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_pdf_view);
+        setupWindowAnimations();
+        Bundle extras = getIntent().getExtras();
+        if (extras != null) {
+            type = extras.getString("type");
+        }
+        restService = ((MainApplication) getApplication()).getClient();
+        title = findViewById(R.id.title);
+        File f = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null), ".HYPERM");
+        if (!f.exists()) {
+            f.mkdirs();
+        }
+
+        File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null) + "/" + ".HYPERM", "PDF");
+        if (!f1.exists()) {
+            f1.mkdirs();
+        }
+        storePreference = new StorePreference(this);
+
+
+        getCurrentTime();
+
+        contentTitle = findViewById(R.id.contentTitle);
+        mTextLanguageSelection = findViewById(R.id.textLanguage);
+        mImageLangSelection = findViewById(R.id.imgLanguage);
+        progressBar = findViewById(R.id.progressBar);
+        pdfView = findViewById(R.id.pdfView);
+        progressBar.setVisibility(View.VISIBLE);
+        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
+        StrictMode.setThreadPolicy(policy);
+
+        mTextLanguageSelection.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                showLanguageSelectionList();
+            }
+        });
+        mImageLangSelection.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                showLanguageSelectionList();
+            }
+        });
+
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        new Handler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                LoadContentFile(getContentFile());
+            }
+        }, 1000);
+
+    }
+
+    private void getCurrentTime() {
+        c = Calendar.getInstance();
+        System.out.println("fromTime " + c.getTime());
+
+        df = new SimpleDateFormat("HH:mm:ss");
+        fromTime = df.format(c.getTime());
+        Log.e("fromTime", fromTime);
+    }
+
+    private void sendHitCountToServer() {
+        restService.sendAllHitCount(buildConfigData()).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+                    Log.e("responeHit", response.body().getMessage());
+                } else {
+                    Log.e("responeHit", response.body().getMessage());
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+                if (t.getMessage() != null) {
+                    Log.e("responeHit", t.getMessage());
+                }
+            }
+        });
+    }
+
+    private HitCountModel buildConfigData() {
+        HitCountModel hitCountModel = new HitCountModel();
+        hitCountModel.setPage("Learning");
+        hitCountModel.setAssettopicid(Integer.valueOf(CONTENT.getAssettopicid()));
+        hitCountModel.setContentid(Integer.valueOf(CONTENT.getContentid()));
+        hitCountModel.setViewtime(finalTime);
+        return hitCountModel;
+    }
+
+    public void decrypt(String pathstr, String filetype, Runnable runnable) throws IOException, NoSuchAlgorithmException,
+            NoSuchPaddingException, InvalidKeyException {
+        FileInputStream fis = new FileInputStream(pathstr);
+        File outputDir = this.getCacheDir(); // context being the Activity pointer
+        String format = ".pdf";
+        if (filetype.equalsIgnoreCase("pdf")) {
+            format = ".pdf";
+        } else if (filetype.equalsIgnoreCase("mp4")) {
+            format = ".mp4";
+        }
+        decryptFile = File.createTempFile(tempfilename, format, this.getCacheDir());
+        FileOutputStream fos = new FileOutputStream(decryptFile);
+        SecretKeySpec sks = generateKey(encryptKey);
+        Cipher cipher = Cipher.getInstance("AES");
+        cipher.init(Cipher.DECRYPT_MODE, sks);
+        CipherInputStream cis = new CipherInputStream(fis, cipher);
+        int b;
+        byte[] d = new byte[1024];
+        while ((b = cis.read(d)) != -1) {
+            fos.write(d, 0, b);
+        }
+
+        fos.flush();
+        fos.close();
+        cis.close();
+        runnable.run();
+    }
+
+
+    private ArrayList<String> getContentFile(MyContent item) {
+        if (item.getContent_files() == null) {
+            return null;
+        }
+        ArrayList<String> Language = new ArrayList<>();
+        for (ContentFile file : item.getContent_files()) {
+            Language.add(file.getLanguage_title());
+        }
+        return Language;
+    }
+    private void showLanguageSelectionList() {
+        final ArrayList<String> contentFile = getContentFile(CONTENT);
+        builder = new AlertDialog.Builder(PdfViewActivity.this);
+        builder.setTitle("SELECT LANGUAGE")
+                .setItems(contentFile.toArray(new String[contentFile.size()]), new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialogInterface, int i) {
+                        LoadContentFile(CONTENT.getContent_files().get(i));
+                        dialogInterface.dismiss();
+                    }
+                });
+        builder.create().show();
+    }
+    public void LoadContentFile(final ContentFile con) {
+        SELECTED_CONTENT = con;
+        mTextLanguageSelection.setText(SELECTED_CONTENT.getLanguage_title());
+        contentTitle.setText(CONTENT.getTitle());
+        title.setText(CONTENT.getTitle());
+        title.setSelected(true);
+        pdfView.post(new Runnable() {
+            @Override
+            public void run() {
+                File file = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                        + "/" + ".HYPERM", "PDF/" + CONTENT.getContentid() + "_" + CONTENT.getVersion() + "_" + SELECTED_CONTENT.getLanguage_code() + ".pdf");
+                if (file.exists()) {
+                    saveTopicData();
+                    try {
+                        decrypt(file.toString(), "pdf", new Runnable() {
+                            @Override
+                            public void run() {
+                                pdfView.fromFile(decryptFile)
+                                        .onPageChange(PdfViewActivity.this)
+                                        .enableAnnotationRendering(true)
+                                        .onLoad(PdfViewActivity.this)
+                                        .scrollHandle(new DefaultScrollHandle(PdfViewActivity.this))
+                                        .spacing(10)
+                                        .onPageError(PdfViewActivity.this)
+                                        .pageFitPolicy(FitPolicy.WIDTH)
+                                        .load();
+                            }
+                        });
+
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                        progressBar.setVisibility(View.GONE);
+                    }
+                } else {
+                    downloadPDF(con);
+                }
+            }
+        });
+
+    }
+
+    public void saveTopicData() {
+        Cursor cursor = GlobalData.sdb.rawQuery("select * from topic_content where" + " category_id='"
+                + TRAINING_ID.getCateid() + "' and topic_id='" + TOPIC.getAssettopicid() + "' and content_id='" + CONTENT.getContentid() + "'", null);
+        if (cursor.getCount() == 0) {
+
+            Gson gson = new Gson();
+            JsonElement jsonElement = gson.toJsonTree(
+                    CONTENT, new TypeToken<MyContent>() {
+                    }.getType());
+            ContentValues values = new ContentValues();
+            values.put("topic_content", jsonElement.toString());
+            values.put("category_id", TRAINING_ID.getCateid());
+            values.put("topic_id", TOPIC.getAssettopicid());
+            values.put("content_id", CONTENT.getContentid());
+            GlobalData.sdb.insert("topic_content", null, values);
+        }
+        cursor = GlobalData.sdb.rawQuery("select * from topic where" + " category_id='"
+                + TRAINING_ID.getCateid()
+                + "' and topic_id='" + TOPIC.getAssettopicid() + "'", null);
+        if (cursor.getCount() == 0) {
+            Gson gson1 = new Gson();
+            JsonElement jsonElement1 = gson1.toJsonTree(
+                    TOPIC, new TypeToken<MyTopic>() {
+                    }.getType());
+            ContentValues values = new ContentValues();
+            values.put("topic", jsonElement1.toString());
+            values.put("category_id", TRAINING_ID.getCateid());
+            values.put("topic_id", TOPIC.getAssettopicid());
+            GlobalData.sdb.insert("topic", null, values);
+        }
+//        else {
+//            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+//        }
+    }
+
+    public ContentFile getContentFile() {
+        if (CONTENT.getContent_files() == null) {
+            return null;
+        }
+        String language = this.getSharedPreferences("LANGUAGE", Context.MODE_PRIVATE).getString("DEFAULT", "en_us");
+
+        for (ContentFile file : CONTENT.getContent_files()) {
+            if (file.getLanguage_code().trim().equalsIgnoreCase(language.trim())) {
+                return file;
+            }
+        }
+        return CONTENT.getContent_files().get(0);
+    }
+
+    @SuppressLint("StaticFieldLeak")
+    private void downloadPDF(final ContentFile con) {
+        new AsyncTask<Void, Void, Void>() {
+            @Override
+            protected Void doInBackground(Void... voids) {
+                OutputStream output = null;
+                CipherOutputStream cos = null;
+                InputStream input = null;
+                try {
+                    int count;
+                    URL url = new URL(con.getFile_url());
+                    URLConnection conection = url.openConnection();
+                    conection.connect();
+                    int lenghtOfFile = conection.getContentLength();
+                    input = new BufferedInputStream(url.openStream(),
+                            8192);
+                    String fileName = Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                            + "/" + ".HYPERM/PDF/" + CONTENT.getContentid() + "_" + CONTENT.getVersion() + "_" + SELECTED_CONTENT.getLanguage_code() + ".pdf";
+                    output = new FileOutputStream(fileName);
+
+                    SecretKeySpec sks = generateKey(encryptKey);
+                    // Create cipher
+                    Cipher cipher = Cipher.getInstance("AES");
+                    cipher.init(Cipher.ENCRYPT_MODE, sks);
+                    // Wrap the output stream
+                    cos = new CipherOutputStream(output, cipher);
+                    byte data[] = new byte[1024];
+                    long total = 0;
+
+                    while ((count = input.read(data)) != -1) {
+                        total += count;
+                        cos.write(data, 0, count);
+                    }
+                    cos.flush();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                } finally {
+                    try {
+                        cos.close();
+                        input.close();
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+                return null;
+            }
+
+            @Override
+            protected void onPostExecute(Void aVoid) {
+                super.onPostExecute(aVoid);
+                File file = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                        + "/" + ".HYPERM", "PDF/" + CONTENT.getContentid() + "_" + CONTENT.getVersion() + ".pdf");
+                if (file.exists()) {
+                    try {
+                        decrypt(file.toString(), "pdf", new Runnable() {
+                            @Override
+                            public void run() {
+                                pdfView.fromFile(decryptFile)
+                                        .onPageChange(PdfViewActivity.this)
+                                        .enableAnnotationRendering(true)
+                                        .onLoad(PdfViewActivity.this)
+                                        .scrollHandle(new DefaultScrollHandle(PdfViewActivity.this))
+                                        .spacing(10)
+                                        .onPageError(PdfViewActivity.this)
+                                        .pageFitPolicy(FitPolicy.WIDTH)
+                                        .load();
+                            }
+                        });
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                        progressBar.setVisibility(View.GONE);
+                    }
+
+                } else {
+                    loadPdf(con);
+                }
+            }
+        }.execute();
+
+
+    }
+
+    public static SecretKeySpec generateKey(final String password) throws NoSuchAlgorithmException, UnsupportedEncodingException {
+        final MessageDigest digest = MessageDigest.getInstance(HASH_ALGORITHM);
+        byte[] bytes = password.getBytes("UTF-8");
+        digest.update(bytes, 0, bytes.length);
+        byte[] key = digest.digest();
+        SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES");
+        return secretKeySpec;
+    }
+
+    private void loadPdf(ContentFile contentFile) {
+        try {
+            pdfView.fromStream(new URL(contentFile.getFile_url()).openStream())
+                    .onPageChange(PdfViewActivity.this)
+                    .enableAnnotationRendering(true)
+                    .onLoad(PdfViewActivity.this)
+                    .scrollHandle(new DefaultScrollHandle(PdfViewActivity.this))
+                    .spacing(10)
+                    .onPageError(PdfViewActivity.this)
+                    .pageFitPolicy(FitPolicy.WIDTH)
+                    .load();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private boolean writeResponseBodyToDisk(ResponseBody body) {
+        try {
+            File futureStudioIconFile = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                    + "/" + ".HYPERM", "PDF/" + CONTENT.getContentid() + "_" + CONTENT.getVersion() + ".pdf");
+            InputStream inputStream = null;
+            OutputStream outputStream = null;
+
+            try {
+                byte[] fileReader = new byte[4096];
+                long fileSize = body.contentLength();
+                long fileSizeDownloaded = 0;
+                inputStream = body.byteStream();
+                outputStream = new FileOutputStream(futureStudioIconFile);
+
+                while (true) {
+                    int read = inputStream.read(fileReader);
+                    if (read == -1) {
+                        break;
+                    }
+                    outputStream.write(fileReader, 0, read);
+                    fileSizeDownloaded += read;
+                }
+                outputStream.flush();
+                return true;
+            } catch (IOException e) {
+                return false;
+            } finally {
+                if (inputStream != null) {
+                    inputStream.close();
+                }
+                if (outputStream != null) {
+                    outputStream.close();
+                }
+            }
+        } catch (IOException e) {
+            return false;
+        }
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        getToTime();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void getToTime() {
+
+        c = Calendar.getInstance();
+        System.out.println("toTime " + c.getTime());
+
+        df = new SimpleDateFormat("HH:mm:ss");
+        toTime = df.format(c.getTime());
+        Log.e("toTime", toTime);
+
+        finalTime = UtilService.getTimeInterval(this,df,fromTime,toTime);
+        if (StorePreference.getInstance(this).getBooleanValue(GlobalData.ISDSELOGIN))
+            sendHitCountToServer();
+
+    }
+
+    @Override
+    public void loadComplete(int nbPages) {
+        progressBar.setVisibility(View.GONE);
+    }
+
+    @Override
+    public void onPageChanged(int page, int pageCount) {
+        if (page + 1 == pageCount) {
+            if (!CONTENT.getStatus().trim().equalsIgnoreCase("2")) {
+                updateStatus("2");
+            }
+        } else {
+            if (!CONTENT.getStatus().trim().equalsIgnoreCase("1") && !CONTENT.getStatus().trim().equalsIgnoreCase("2")) {
+                updateStatus("1");
+            }
+        }
+    }
+
+    private void updateStatus(String status) {
+        CONTENT.setStatus(status);
+        if (new UtilService().isNetworkAvailable(PdfViewActivity.this)) {
+            try {
+                HashMap<String, String> map = new HashMap<>();
+                map.put("contentid", CONTENT.getContentid());
+                map.put("assettopicid", CONTENT.getAssettopicid());
+                map.put("status", status);
+
+                restService.updateContentStaus(map).enqueue(new MyCallback<ErrorResponse>(status) {
+                    @Override
+                    public void onResponse(Call<ErrorResponse> call, Response<ErrorResponse> response) {
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            CONTENT.setStatus(ids);
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<ErrorResponse> call, Throwable t) {
+
+                    }
+                });
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    @Override
+    public void onPageError(int page, Throwable t) {
+        progressBar.setVisibility(View.GONE);
+        GlobalData.showToast(this, "Error", Toast.LENGTH_SHORT).show();
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+}

+ 650 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ProductExploreDetailsActivity.java

@@ -0,0 +1,650 @@
+package com.cygnusa.hyperm;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.app.DownloadManager;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.util.Patterns;
+import android.view.View;
+import android.view.Window;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.MediaController;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.app.ActivityCompat;
+import androidx.core.content.ContextCompat;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.appupdater.AppUpdater;
+import com.cygnusa.hyperm.dbadapters.CommonDBHelper;
+import com.cygnusa.hyperm.dbadapters.CustomerDetailsAdapter;
+import com.cygnusa.hyperm.dbadapters.TableConstants;
+import com.cygnusa.hyperm.library.AppUtils;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.CommonMethods;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.AppVersion;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.GetAllCustomerDetailsResponse;
+import com.cygnusa.hyperm.wrappers.GetAllSalutationModel;
+import com.cygnusa.hyperm.wrappers.ModelData;
+import com.cygnusa.hyperm.wrappers.SendAllCustomerData;
+import com.cygnusa.hyperm.wrappers.SendAllExploreDetailsModel;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class ProductExploreDetailsActivity extends AppCompatActivity implements View.OnClickListener {
+    Context context;
+    private List<String> prefixDetailsSpinnerArray;
+    Spinner spnPrefix;
+    DisplayMetrics dm;
+    MediaController media_Controller;
+    private String ageRange = "";
+    private EditText edtFirstName, edtLastName, edtMobileNumber, edtEmail;
+    private TextView txtAgeFirst, txtAgeSecond, txtAgeThird, txtAgeFour, txtAgeFive;
+    ApiService restService;
+    ArrayAdapter<String> mGroupAdapter;
+    SendAllExploreDetailsModel detailsModel;
+    StorePreference storePreference;
+    boolean doubleBackToExitPressedOnce = false;
+    private TransparentProgressDialog progressDialog;
+    private String currentTime = "";
+    List<SendAllCustomerData> getAllOfflineData = new ArrayList<>();
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_product_explore_details);
+        initViews();
+        // this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
+        AppUpdater appUpdater = new AppUpdater(this);
+        appUpdater.start();
+        detailsModel = new SendAllExploreDetailsModel();
+        if (CommonMethods.isNetworkAvailable(this)) {
+            getAllSalutation();
+            sendOfflineDataToServer();
+        } else {
+            getLocal();
+        }
+//        checkPermission();
+    }
+
+    public boolean validateEmailID(String str) {
+        return str.contains("@") && str.lastIndexOf(".") != -1;
+    }
+
+    private void checkPermission() {
+        if (Build.VERSION.SDK_INT >= 23) {
+            ArrayList<String> listPermissionsNeeded = new ArrayList<>();
+            if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
+                    == PackageManager.PERMISSION_DENIED) {
+                listPermissionsNeeded
+                        .add(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
+                listPermissionsNeeded
+                        .add(android.Manifest.permission.READ_EXTERNAL_STORAGE);
+            }
+
+            if (!listPermissionsNeeded.isEmpty()) {
+                ActivityCompat.requestPermissions(this, listPermissionsNeeded
+                        .toArray(new String[listPermissionsNeeded.size()]), 1);
+            } else {
+              //  checkAppVersion();
+            }
+        } else {
+            //checkAppVersion();
+        }
+    }
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode,
+                                           @NonNull String[] permissions, @NonNull int[] grantResults) {
+        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+
+        if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
+           // checkAppVersion();
+        }
+    }
+
+    private void checkAppVersion() {
+        if (new UtilService().isNetworkAvailable(ProductExploreDetailsActivity.this)) {
+            try {
+                String url = GlobalData.APP_URL + "com.cygnusa.hyperm&deviceid=1";
+                restService.getAppVersion(url).enqueue(new Callback<AppVersion>() {
+                    @Override
+                    public void onResponse(Call<AppVersion> call, Response<AppVersion> response) {
+                        if (response.isSuccessful()) {
+                            if (response.body() != null && Objects.requireNonNull(response.body())
+                                    .getCont().trim().equalsIgnoreCase("success")) {
+                                int versionCode = AppUtils.getVersionCode(ProductExploreDetailsActivity.this);
+                                int iapkCode = Integer.parseInt(Objects.requireNonNull(response.body()).getVersioncode().trim());
+                                if (iapkCode > versionCode) {
+                                    showDialog(ProductExploreDetailsActivity.this, Objects.requireNonNull(response.body()).getUrl().getAndroid(), iapkCode);
+                                }
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<AppVersion> call, Throwable t) {
+
+                    }
+                });
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+    private void showDialog(Context context, final String apkUrl, final int apkCode) {
+        File f = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null), ".HYPERM");
+        if (!f.exists()) {
+            f.mkdirs();
+        }
+
+        File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null) + "/" + ".HYPERM", "Apk");
+        if (!f1.exists()) {
+            f1.mkdirs();
+        }
+
+        android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(ProductExploreDetailsActivity.this);
+        builder.setMessage("New update for HYPER-M App is available")
+                .setPositiveButton(context.getResources().getString(R.string.alert_update),
+                        new DialogInterface.OnClickListener() {
+                            public void onClick(DialogInterface dialog, int id) {
+                                downloadFile(apkUrl, apkCode);
+                            }
+                        }).setNegativeButton("Cancel", null);
+
+        android.app.AlertDialog dialog = builder.create();
+        dialog.setCanceledOnTouchOutside(false);
+        dialog.show();
+    }
+
+    private void downloadFile(String url, int apkCode) {
+        getApplication().registerReceiver(onDownloadComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
+
+        DownloadManager mgr = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
+        Uri downloadUri = Uri.parse(url);
+        DownloadManager.Request request = new DownloadManager.Request(
+                downloadUri);
+        request.setAllowedNetworkTypes(
+                DownloadManager.Request.NETWORK_WIFI
+                        | DownloadManager.Request.NETWORK_MOBILE)
+                .setAllowedOverRoaming(false).setTitle("HYPER-M")
+                .setDescription("Downloading...")
+                .setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)
+                .setDestinationInExternalPublicDir("/.HYPERM/Apk", "hyperm_v_" + apkCode + ".apk");
+        assert mgr != null;
+        mgr.enqueue(request);
+    }
+
+    private BroadcastReceiver onDownloadComplete = new BroadcastReceiver() {
+        public void onReceive(Context ctxt, Intent intent) {
+            try {
+                if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(intent.getAction())) {
+                    long downloadId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);
+                    String filePath = getDownloadedFilePath(ctxt, downloadId);
+                    Intent intent1 = new Intent(Intent.ACTION_VIEW);
+                    intent1.setDataAndType(Uri.fromFile(new File(filePath)), "application/vnd.android.package-archive");
+                    intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                    startActivity(intent1);
+                    finish();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            ctxt.unregisterReceiver(this);
+        }
+    };
+
+    private String getDownloadedFilePath(Context context, long downloadId) {
+        DownloadManager.Query query = new DownloadManager.Query().setFilterById(downloadId);
+        String result = "";
+        Cursor c = null;
+        try {
+            DownloadManager downloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
+            assert downloadManager != null;
+            c = downloadManager.query(query);
+            if (c != null && c.moveToFirst()) {
+                int fileUriIdx = c.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI);
+                String fileUri = c.getString(fileUriIdx);
+                if (fileUri != null) {
+                    File mFile = new File(Objects.requireNonNull(Uri.parse(fileUri).getPath()));
+                    result = mFile.getAbsolutePath();
+                }
+            }
+        } finally {
+            if (c != null) {
+                c.close();
+            }
+        }
+        return result;
+    }
+
+    private void getLocal() {
+        SharedPreferences pref = Objects.requireNonNull(ProductExploreDetailsActivity.this).getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+        if (pref.getString("SALUTATION_" + storePreference.getStringValue(GlobalData.SALUTATION_MODEL), null) != null) {
+            Gson gson = new Gson();
+            prefixDetailsSpinnerArray = gson.fromJson(
+                    pref.getString("SALUTATION_" + storePreference.getStringValue(GlobalData.SALUTATION_MODEL), null),
+                    new TypeToken<List<String>>() {
+                    }.getType());
+            if (prefixDetailsSpinnerArray != null) {
+                mGroupAdapter = new ArrayAdapter<>(context, R.layout.spinner_text_left, R.id.spinner_text, prefixDetailsSpinnerArray);
+                spnPrefix.setAdapter(mGroupAdapter);
+            }
+        } else {
+            Toast.makeText(ProductExploreDetailsActivity.this, "No data found", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void getAllSalutation() {
+        restService.getAllSaltuation().enqueue(new Callback<GetAllSalutationModel>() {
+            @Override
+            public void onResponse(Call<GetAllSalutationModel> call, Response<GetAllSalutationModel> response) {
+                if (response.body() != null) {
+                    if (response.body().getStatus() == 200) {
+                        SharedPreferences pref = Objects.requireNonNull(ProductExploreDetailsActivity.this).getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+                        SharedPreferences.Editor editor = pref.edit();
+                        prefixDetailsSpinnerArray = response.body().getData();
+                        if (prefixDetailsSpinnerArray.size() > 0) {
+                            Gson gson = new Gson();
+                            JsonElement jsonElement = gson.toJsonTree(
+                                    prefixDetailsSpinnerArray, new TypeToken<List<String>>() {
+                                    }.getType());
+                            editor.putString("SALUTATION_" + storePreference.getStringValue(GlobalData.SALUTATION_MODEL),
+                                    jsonElement.toString()).apply();
+
+                            mGroupAdapter = new ArrayAdapter<>(context, R.layout.spinner_text_left, R.id.spinner_text, prefixDetailsSpinnerArray);
+                            spnPrefix.setAdapter(mGroupAdapter);
+                        } else {
+                            getLocal();
+                        }
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                        finish();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                            finish();
+                        }
+                    } else {
+                        prefixDetailsSpinnerArray.add("-");
+                        mGroupAdapter = new ArrayAdapter<>(context, R.layout.spinner_text_left, R.id.spinner_text, prefixDetailsSpinnerArray);
+                        spnPrefix.setAdapter(mGroupAdapter);
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<GetAllSalutationModel> call, Throwable t) {
+                getLocal();
+            }
+        });
+    }
+
+    private void initViews() {
+        context = this;
+        spnPrefix = findViewById(R.id.spn_select_from);
+        prefixDetailsSpinnerArray = new ArrayList<>();
+        LinearLayout llout_get_started = findViewById(R.id.llout_get_started);
+        Button btn_get_started = findViewById(R.id.btn_get_started);
+        btn_get_started.setOnClickListener(this);
+        llout_get_started.setOnClickListener(this);
+        storePreference = new StorePreference(this);
+
+        edtEmail = findViewById(R.id.edtEmail);
+        edtFirstName = findViewById(R.id.edtFirstName);
+        edtLastName = findViewById(R.id.edt_last_name);
+        edtMobileNumber = findViewById(R.id.edtMobNumer);
+        //  hideKeyboard(this);
+//        edtMobileNumber.setShowSoftInputOnFocus(false);
+//        edtEmail.setShowSoftInputOnFocus(false);
+//        edtFirstName.setShowSoftInputOnFocus(false);
+//        edtLastName.setShowSoftInputOnFocus(false);
+
+        txtAgeFirst = findViewById(R.id.txtAgeFirst);
+        txtAgeSecond = findViewById(R.id.txtAgeSecond);
+        txtAgeThird = findViewById(R.id.txtAgeThird);
+        txtAgeFour = findViewById(R.id.txtAgeFour);
+        txtAgeFive = findViewById(R.id.txtAgeFive);
+        txtAgeFive.setOnClickListener(this);
+        txtAgeFour.setOnClickListener(this);
+        txtAgeThird.setOnClickListener(this);
+        txtAgeSecond.setOnClickListener(this);
+        txtAgeFirst.setOnClickListener(this);
+        progressDialog = new TransparentProgressDialog(ProductExploreDetailsActivity.this);
+        LinearLayout whole_layout = findViewById(R.id.whole_lin_layout);
+        whole_layout.setOnClickListener(this);
+        restService = ((MainApplication) getApplication()).getClient();
+    }
+
+    @Override
+    public void onBackPressed() {
+        if (doubleBackToExitPressedOnce) {
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+                finishAffinity();
+            } else {
+                System.exit(0);
+                finish();
+            }
+            return;
+        }
+        this.doubleBackToExitPressedOnce = true;
+        Toast.makeText(this, "Please click again to exit", Toast.LENGTH_SHORT).show();
+        new Handler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                doubleBackToExitPressedOnce = false;
+            }
+        }, 2000);
+
+    }
+
+    private void loadVideo() {
+        media_Controller = new MediaController(this);
+        dm = new DisplayMetrics();
+        this.getWindowManager().getDefaultDisplay().getMetrics(dm);
+        int height = dm.heightPixels;
+        int width = dm.widthPixels;
+    }
+
+    @Override
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.llout_get_started:
+                currentTime = String.valueOf(System.currentTimeMillis());
+                currentTime = GlobalData.user.getData().getEmp_code() + currentTime;
+                storePreference.setString(GlobalData.CURRENTTIME, currentTime);
+                sendOfflineDataToServer();
+                fieldValidation();
+                break;
+            case R.id.whole_lin_layout:
+//                hideKeyboard(ProductExploreDetailsActivity.this);
+                break;
+            case R.id.btn_get_started:
+                currentTime = String.valueOf(System.currentTimeMillis());
+                currentTime = GlobalData.user.getData().getEmp_code() + currentTime;
+                storePreference.setString(GlobalData.CURRENTTIME, currentTime);
+                sendOfflineDataToServer();
+                fieldValidation();
+                break;
+            case R.id.txtAgeFirst:
+                clickSelectedAgeRange(txtAgeFirst, txtAgeSecond, txtAgeThird, txtAgeFour, txtAgeFive);
+                ageRange = txtAgeFirst.getText().toString();
+                break;
+            case R.id.txtAgeSecond:
+                clickSelectedAgeRange(txtAgeSecond, txtAgeFirst, txtAgeThird, txtAgeFour, txtAgeFive);
+                ageRange = txtAgeSecond.getText().toString();
+                break;
+            case R.id.txtAgeThird:
+                clickSelectedAgeRange(txtAgeThird, txtAgeFirst, txtAgeSecond, txtAgeFour, txtAgeFive);
+                ageRange = txtAgeThird.getText().toString();
+                break;
+            case R.id.txtAgeFour:
+                clickSelectedAgeRange(txtAgeFour, txtAgeFirst, txtAgeSecond, txtAgeThird, txtAgeFive);
+                ageRange = txtAgeFour.getText().toString();
+                break;
+            case R.id.txtAgeFive:
+                clickSelectedAgeRange(txtAgeFive, txtAgeFirst, txtAgeSecond, txtAgeThird, txtAgeFour);
+                ageRange = txtAgeFive.getText().toString();
+                break;
+            default:
+        }
+    }
+
+    private void hideKeyboard(Activity activity) {
+        InputMethodManager inputMethodManager =
+                (InputMethodManager) this.getSystemService(
+                        Activity.INPUT_METHOD_SERVICE);
+        Objects.requireNonNull(inputMethodManager).hideSoftInputFromWindow(
+                Objects.requireNonNull(activity.getCurrentFocus()).getWindowToken(), 0);
+    }
+
+    private void fieldValidation() {
+        if (edtFirstName.getText().toString().equalsIgnoreCase("")) {
+            CommonMethods.showToast(context, "Enter your name.").show();
+        } else if (edtMobileNumber.getText().toString().equalsIgnoreCase("")) {
+            CommonMethods.showToast(context, "Enter your mobile number.").show();
+        } else if (!Patterns.PHONE.matcher(edtMobileNumber.getText().toString()).matches()) {
+            CommonMethods.showToast(context, "Enter your valid mobile number.").show();
+        } else if (edtMobileNumber.getText().length() < 10) {
+            CommonMethods.showToast(context, "Enter your valid mobile number.").show();
+        }
+//        else if (edtEmail.getText().toString().equalsIgnoreCase("")) {
+//            GlobalData.showToast(this, "Enter E-mail address", Toast.LENGTH_LONG).show();
+//        }
+//        else if(!validateEmailID(edtEmail.getText().toString())){
+////            GlobalData.showToast(this, "Please enter your valid email id", Toast.LENGTH_LONG).show();
+////        }
+        else if (ageRange.equalsIgnoreCase("")) {
+            CommonMethods.showToast(context, "Select age range.").show();
+        } else {
+            storePreference.setString(GlobalData.PRODUCT_NAME, edtFirstName.getText().toString().trim());
+            if (CommonMethods.isNetworkAvailable(this)) {
+                sendOfflineDataToServer();
+                sendDetailsToServer();
+            } else {
+                insertDetailsToServer();
+            }
+        }
+    }
+
+    public void hideSoftKeyboard() {
+        if (getCurrentFocus() != null) {
+            InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
+            Objects.requireNonNull(inputMethodManager).hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
+        }
+    }
+
+    private void sendOfflineDataToServer() {
+        SendAllExploreDetailsModel detailsModel = new SendAllExploreDetailsModel();
+        CustomerDetailsAdapter customerDetailsAdapter = new CustomerDetailsAdapter(ProductExploreDetailsActivity.this);
+        getAllOfflineData = customerDetailsAdapter.getAllDataFromDB();
+        List<SendAllCustomerData> allCustomerData = new ArrayList<>();
+        if (getAllOfflineData != null && getAllOfflineData.size() > 0) {
+            detailsModel.setEmp_code(GlobalData.user.getData().getEmp_code());
+            detailsModel.setSmpin(GlobalData.user.getData().getSmpin());
+            detailsModel.setMobile("");
+            for (int i = 0; i < getAllOfflineData.size(); i++) {
+                Log.e("Name", getAllOfflineData.get(i).getFirstname());
+                SendAllCustomerData customerData = new SendAllCustomerData();
+                customerData.setSalutation(getAllOfflineData.get(i).getSalutation());
+                customerData.setAge(getAllOfflineData.get(i).getAge());
+                customerData.setEmail(getAllOfflineData.get(i).getEmail());
+                customerData.setFirstname(getAllOfflineData.get(i).getFirstname());
+                customerData.setLastname(getAllOfflineData.get(i).getLastname());
+                customerData.setMobile(getAllOfflineData.get(i).getMobile());
+                customerData.setUid(getAllOfflineData.get(i).getUid());
+                allCustomerData.add(customerData);
+            }
+            if (allCustomerData.size() > 0)
+                detailsModel.setCustomerData(allCustomerData);
+            restService.sendAllExploreDetails(detailsModel).enqueue(new Callback<GetAllCustomerDetailsResponse>() {
+                @Override
+                public void onResponse(Call<GetAllCustomerDetailsResponse> call, Response<GetAllCustomerDetailsResponse> response) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    if (response.body() != null) {
+                        if (response.body().getStatus() == 200) {
+                            CommonDBHelper.getInstance(getApplicationContext()).deleteTableValues(TableConstants.TABLE_CUSTOMER_DETAILS);
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        } else {
+                            CommonMethods.showToast(context, response.body().getMessage()).show();
+                        }
+                    }
+                }
+
+                @Override
+                public void onFailure(Call<GetAllCustomerDetailsResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                }
+            });
+        }
+    }
+
+    public static void hideKeyboardFrom(Context context, View view) {
+        InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
+        Objects.requireNonNull(imm).hideSoftInputFromWindow(view.getWindowToken(), 0);
+    }
+
+    private void insertDetailsToServer() {
+        CustomerDetailsAdapter customerDetailsAdapter = new CustomerDetailsAdapter(ProductExploreDetailsActivity.this);
+        if (!CustomerDetailsAdapter.checkRecordExists(edtMobileNumber.getText().toString())) {
+            customerDetailsAdapter.insertLoginDetails(currentTime, spnPrefix.getSelectedItem().toString(), edtFirstName.getText().toString(), edtMobileNumber.getText().toString(), edtEmail.getText().toString(), ageRange);
+            startActivity(new Intent(ProductExploreDetailsActivity.this, ProductHomeActivity.class));
+        } else {
+            startActivity(new Intent(ProductExploreDetailsActivity.this, ProductHomeActivity.class));
+        }
+    }
+
+    private void sendDetailsToServer() {
+        progressDialog.show();
+        restService.sendAllExploreDetails(buildConfigData()).enqueue(new Callback<GetAllCustomerDetailsResponse>() {
+            @Override
+            public void onResponse(Call<GetAllCustomerDetailsResponse> call, Response<GetAllCustomerDetailsResponse> response) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                if (response.body() != null) {
+                    if (response.body().getStatus() == 200) {
+                        storePreference.setString(GlobalData.DETAIL_NAME, edtFirstName.getText().toString());
+                        storePreference.setString(GlobalData.DETAIL_EMAIL, edtEmail.getText().toString());
+                        storePreference.setString(GlobalData.DETAIL_MOBILE, edtMobileNumber.getText().toString());
+                        if (response.body().getIs_exist() == 1) {
+                            openPopup(response.body().getModel_data());
+                        } else {
+                            startActivity(new Intent(ProductExploreDetailsActivity.this, ProductHomeActivity.class));
+                        }
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    } else {
+                        CommonMethods.showToast(context, response.body().getMessage()).show();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<GetAllCustomerDetailsResponse> call, Throwable t) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+            }
+        });
+
+    }
+
+    public void openPopup(ModelData data) {
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.model_view_popup);
+        aDialog.setCancelable(true);
+        TextView model_name = aDialog.findViewById(R.id.model_name);
+        TextView description = aDialog.findViewById(R.id.description);
+        model_name.setText(data.getTitle());
+        description.setText(String.format("%s %s", getResources().getString(R.string.msg_text), data.getModel_name().trim()));
+        aDialog.show();
+        ImageView img_model;
+        img_model = aDialog.findViewById(R.id.img_close);
+        Glide.with(context).load(data.getModel_image_url())
+                .thumbnail(Glide.with(context).load(R.drawable.gif_loader))
+                .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                        .placeholder(R.drawable.placeholder)).into(img_model);
+        img_model.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                aDialog.dismiss();
+            }
+        });
+        Button btnYes = aDialog.findViewById(R.id.btn_continue);
+        btnYes.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                aDialog.dismiss();
+                startActivity(new Intent(ProductExploreDetailsActivity.this, ProductHomeActivity.class));
+                finish();
+
+            }
+        });
+    }
+
+    private SendAllExploreDetailsModel buildConfigData() {
+        SendAllExploreDetailsModel detailsModel = new SendAllExploreDetailsModel();
+        detailsModel.setEmp_code(GlobalData.user.getData().getEmp_code());
+        detailsModel.setSmpin(GlobalData.user.getData().getSmpin());
+        detailsModel.setMobile(edtMobileNumber.getText().toString().trim());
+        List<SendAllCustomerData> allCustomerData = new ArrayList<>();
+        SendAllCustomerData customerData = new SendAllCustomerData();
+        customerData.setSalutation(spnPrefix.getSelectedItem().toString());
+        customerData.setAge(ageRange);
+        customerData.setEmail(edtEmail.getText().toString());
+        customerData.setFirstname(edtFirstName.getText().toString());
+        customerData.setLastname(edtLastName.getText().toString());
+        customerData.setMobile(edtMobileNumber.getText().toString());
+        customerData.setUid(currentTime);
+        allCustomerData.add(customerData);
+        detailsModel.setCustomerData(allCustomerData);
+        return detailsModel;
+    }
+
+    private void clickSelectedAgeRange(TextView txtAgeFirst, TextView txtAgeSecond, TextView txtAgeThird, TextView txtAgeFour, TextView txtAgeFive) {
+        txtAgeFirst.setBackground(ContextCompat.getDrawable(context, R.drawable.edt_border));
+        txtAgeSecond.setBackground(ContextCompat.getDrawable(context, R.drawable.edt_unselected_border));
+        txtAgeThird.setBackground(ContextCompat.getDrawable(context, R.drawable.edt_unselected_border));
+        txtAgeFour.setBackground(ContextCompat.getDrawable(context, R.drawable.edt_unselected_border));
+        txtAgeFive.setBackground(ContextCompat.getDrawable(context, R.drawable.edt_unselected_border));
+    }
+}

+ 301 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ProductExplorerActivity.java

@@ -0,0 +1,301 @@
+package com.cygnusa.hyperm;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.view.View;
+import android.view.Window;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.swipe.OnSwipeItemSelectedListener;
+import com.cygnusa.hyperm.swipe.SwipeItem;
+import com.cygnusa.hyperm.swipe.SwipeSelector;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.CommonMethods;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.GetAllExploreImageList;
+import com.cygnusa.hyperm.wrappers.GetAllExploreModel;
+
+import java.util.List;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class ProductExplorerActivity extends AppCompatActivity implements View.OnClickListener, OnSwipeItemSelectedListener {
+
+    Button btnNext;
+    SwipeSelector swipeSelector;
+    StorePreference storePreference;
+    String selectedModel = "1";
+    GetAllExploreModel getAllExploreModel;
+    ApiService restService;
+    ProgressBar progressBar;
+    ImageView img_home, img_close, img_broucher, img_rating;
+    ImageView layout1;
+    private TextView txtModelName;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+        restService = ((MainApplication) getApplication()).getClient();
+        initViews();
+        if (GlobalData.user.getData() != null)
+            if (GlobalData.user.getData().getRole().equalsIgnoreCase("16")) {
+                img_home.setVisibility(View.VISIBLE);
+                layout1.setVisibility(View.GONE);
+                img_rating.setVisibility(View.VISIBLE);
+                img_broucher.setVisibility(View.VISIBLE);
+                img_close.setVisibility(View.VISIBLE);
+            } else {
+                img_home.setVisibility(View.VISIBLE);
+                layout1.setVisibility(View.VISIBLE);
+                img_rating.setVisibility(View.GONE);
+                img_broucher.setVisibility(View.GONE);
+                img_close.setVisibility(View.GONE);
+            }
+    }
+
+    @Override
+    public void onBackPressed() {
+        if (GlobalData.user.getData().getRole().equalsIgnoreCase("16")) {
+            startActivity(new Intent(ProductExplorerActivity.this, ProductWelcomeScreenActivity.class));
+            finish();
+        } else {
+            super.onBackPressed();
+        }
+    }
+
+    private void initViews() {
+        btnNext = findViewById(R.id.btnNext);
+        btnNext.setOnClickListener(this);
+        storePreference = new StorePreference(this);
+        txtModelName = findViewById(R.id.txtModelName);
+        progressBar = findViewById(R.id.progress);
+        progressBar.setVisibility(View.GONE);
+        getAllExploreModel = new GetAllExploreModel();
+        swipeSelector = findViewById(R.id.swipeSelector);
+        swipeSelector.setOnItemSelectedListener(this);
+        img_home = findViewById(R.id.img_home);
+        img_home.setOnClickListener(this);
+        img_close = findViewById(R.id.img_close);
+        img_close.setOnClickListener(this);
+        img_broucher = findViewById(R.id.imgBroucher);
+        img_broucher.setOnClickListener(this);
+        img_rating = findViewById(R.id.img_rating);
+        img_rating.setOnClickListener(this);
+        layout1 = findViewById(R.id.fabEnquiry);
+        layout1.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                startActivity(new Intent(ProductExplorerActivity.this, HyperMEnquiryForm.class));
+            }
+        });
+        if (CommonMethods.isNetworkAvailable(this)) {
+            getAllExploreImageDataList();
+        } else {
+            checkLocalExplorerFile();
+        }
+    }
+
+    private void getAllExploreImageDataList() {
+        progressBar.setVisibility(View.VISIBLE);
+        restService.getAllExploreImage().enqueue(new Callback<GetAllExploreModel>() {
+            @Override
+            public void onResponse(@NonNull Call<GetAllExploreModel> call, @NonNull Response<GetAllExploreModel> response) {
+                progressBar.setVisibility(View.GONE);
+                SharedPreferences pref = getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+                SharedPreferences.Editor editor = pref.edit();
+                if (response.body() != null && response.body().getStatus() == 200) {
+                    List<GetAllExploreImageList> data = response.body().getData();
+                    if (data != null && data.size() > 0) {
+                        Gson gson = new Gson();
+                        JsonElement jsonElement = gson.toJsonTree(
+                                data, new TypeToken<List<GetAllExploreImageList>>() {
+                                }.getType());
+                        editor.putString("EXPLORE_DATA", jsonElement.toString()).apply();
+
+                        storePreference.setString(GlobalData.SELECTED_MODEL, data.get(0).getModelId());
+                        storePreference.setString(GlobalData.SELECTED_MODEL_NAME, data.get(0).getModelName());
+                        txtModelName.setText(data.get(0).getModelName());
+
+                        SwipeItem[] swipeItems = new SwipeItem[data.size()];
+                        for (int i = 0; i < data.size(); i++) {
+
+                            SwipeItem item = new SwipeItem(data.get(i).getModelName(), data.get(i).getModelImageUrl(), data.get(i).getModelId());
+                            swipeItems[i] = item;
+                        }
+                        swipeSelector.setItems(swipeItems);
+                    } else {
+                        checkLocalExplorerFile();
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                        finish();
+                    }
+                } else {
+                    checkLocalExplorerFile();
+                }
+            }
+
+            @Override
+            public void onFailure(Call<GetAllExploreModel> call, Throwable t) {
+                progressBar.setVisibility(View.GONE);
+                checkLocalExplorerFile();
+            }
+        });
+    }
+
+    private void checkLocalExplorerFile() {
+        SharedPreferences pref = getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+        if (pref.getString("EXPLORE_DATA", null) != null) {
+            Gson gson = new Gson();
+            List<GetAllExploreImageList> data = gson.fromJson(
+                    pref.getString("EXPLORE_DATA", null),
+                    new TypeToken<List<GetAllExploreImageList>>() {
+                    }.getType());
+            SwipeItem[] swipeItems = new SwipeItem[Objects.requireNonNull(data).size()];
+            for (int i = 0; i < data.size(); i++) {
+                storePreference.setString(GlobalData.SELECTED_MODEL, data.get(0).getModelId());
+                storePreference.setString(GlobalData.SELECTED_MODEL_NAME, data.get(0).getModelName());
+                txtModelName.setText(data.get(0).getModelName());
+                SwipeItem item = new SwipeItem(data.get(i).getModelName(), data.get(i).getModelImageUrl(), data.get(i).getModelId());
+                swipeItems[i] = item;
+            }
+            swipeSelector.setItems(swipeItems);
+        } else {
+            Toast.makeText(this, "No data found", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void openCloseAlertBox() {
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.popup_alert_close);
+        aDialog.setCancelable(true);
+        TextView aAlertMessage = aDialog.findViewById(R.id.txt_alert_message);
+        aAlertMessage.setText("Dear " + storePreference.getStringValue(GlobalData.PRODUCT_NAME));
+        aDialog.show();
+        Button btnYes = aDialog.findViewById(R.id.btn_yes);
+        Button btnNo = aDialog.findViewById(R.id.btn_no);
+        btnYes.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                openFeedbackAlertBox();
+                aDialog.dismiss();
+            }
+        });
+        btnNo.setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View arg0) {
+                // TODO Auto-generated method stub
+                aDialog.dismiss();
+            }
+
+        });
+    }
+
+    private void openFeedbackAlertBox() {
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.popup_alert_feedback);
+        aDialog.setCancelable(true);
+        TextView aAlertMessage = aDialog.findViewById(R.id.txt_alert_message);
+        aAlertMessage.setText("Dear " + storePreference.getStringValue(GlobalData.PRODUCT_NAME));
+        aDialog.show();
+        TextView txtSkip;
+        ImageView imgClose;
+        imgClose = aDialog.findViewById(R.id.img_close);
+        txtSkip = aDialog.findViewById(R.id.txtSkip);
+        imgClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                aDialog.dismiss();
+            }
+        });
+        txtSkip.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                aDialog.dismiss();
+                startActivity(new Intent(ProductExplorerActivity.this, ProductExploreDetailsActivity.class));
+                finish();
+            }
+        });
+
+        Button btnYes = aDialog.findViewById(R.id.btn_yes);
+        btnYes.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                startActivity(new Intent(ProductExplorerActivity.this, ProductFeedbackFormActivity.class));
+                aDialog.dismiss();
+            }
+        });
+    }
+
+
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()) {
+            case R.id.btnNext:
+                startActivity(new Intent(this, MainActivity.class));
+                break;
+            case R.id.img_close:
+                openCloseAlertBox();
+                break;
+            case R.id.imgBroucher:
+                startActivity(new Intent(this, HyperMEnquiryForm.class));
+                break;
+            case R.id.img_rating:
+                startActivity(new Intent(this, ProductFeedbackFormActivity.class));
+                break;
+            case R.id.img_home:
+                if (GlobalData.user.getData().getRole().equalsIgnoreCase("16")) {
+                    startActivity(new Intent(ProductExplorerActivity.this, ProductWelcomeScreenActivity.class));
+                } else {
+                    onBackPressed();
+                }
+                break;
+            default:
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+    }
+
+    @Override
+    public void onItemSelected(SwipeItem item) {
+        int modelId = Integer.parseInt(item.getDescription());
+        storePreference.setString(GlobalData.SELECTED_MODEL, item.getDescription());
+        txtModelName.setText(item.getValue());
+        storePreference.setString(GlobalData.SELECTED_MODEL_NAME, item.getValue());
+    }
+}

+ 352 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ProductFeedbackFormActivity.java

@@ -0,0 +1,352 @@
+package com.cygnusa.hyperm;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import android.view.View;
+import android.view.Window;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Button;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.adapter.ProductFeedbackListAdapter;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.CommonMethods;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.wrappers.AnswerResponse;
+import com.cygnusa.hyperm.wrappers.CustomerFeedbackModel;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.FeedbackAnswerArrayModel;
+import com.cygnusa.hyperm.wrappers.FeedbackDataList;
+import com.cygnusa.hyperm.wrappers.ProductFeedback;
+import com.cygnusa.hyperm.wrappers.ProductFeedbackResponse;
+import com.cygnusa.hyperm.wrappers.SingleTon;
+import com.tylersuehr.esr.EmptyStateRecyclerView;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class ProductFeedbackFormActivity extends AppCompatActivity
+        implements View.OnClickListener {
+    ImageButton backButton;
+    Button submitBtn;
+    ImageView imgBroucher, img_close;
+    EmptyStateRecyclerView rcv_feedback_form;
+    ApiService restService;
+    ProductFeedbackListAdapter adapter;
+    ArrayList<ProductFeedback> FEEDBACK_QUESTIONS = new ArrayList<>();
+    LinearLayoutManager linearLayoutManager;
+    private TransparentProgressDialog progressDialog;
+    StorePreference storePreference;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_product_feedback_form);
+        backButton = findViewById(R.id.backButton);
+        backButton.setOnClickListener(this);
+        imgBroucher = findViewById(R.id.imgBroucher);
+        imgBroucher.setOnClickListener(this);
+        submitBtn = findViewById(R.id.submitButton);
+        submitBtn.setOnClickListener(this);
+        img_close = findViewById(R.id.img_close);
+        img_close.setOnClickListener(this);
+
+        storePreference = new StorePreference(this);
+        restService = ((MainApplication) getApplication()).getClient();
+        rcv_feedback_form = findViewById(R.id.surveyListView);
+        rcv_feedback_form.setHasFixedSize(true);
+        rcv_feedback_form.setItemAnimator(new SlideInLeftAnimator());
+        linearLayoutManager = new LinearLayoutManager(getBaseContext());
+        rcv_feedback_form.setLayoutManager(linearLayoutManager);
+        if (CommonMethods.isNetworkAvailable(this)) {
+            getAllFeedbackQuestions();
+            getAllOfflineAnswerSendToServer();
+
+        } else {
+            getLocal();
+        }
+    }
+    private void hideKeyboard(Activity activity) {
+        InputMethodManager inputMethodManager =
+                (InputMethodManager) activity.getSystemService(
+                        Activity.INPUT_METHOD_SERVICE);
+        inputMethodManager.hideSoftInputFromWindow(
+                activity.getCurrentFocus().getWindowToken(), 0);
+    }
+
+    private void getLocal() {
+        SharedPreferences pref = Objects.requireNonNull(ProductFeedbackFormActivity.this).getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+        if (pref.getString("FEEDBACK_QUESTIONS_" + storePreference.getStringValue(GlobalData.FEEDBACK_MODEL), null) != null) {
+            Gson gson = new Gson();
+            FEEDBACK_QUESTIONS = gson.fromJson(
+                    pref.getString("FEEDBACK_QUESTIONS_" + storePreference.getStringValue(GlobalData.FEEDBACK_MODEL), null),
+                    new TypeToken<ArrayList<ProductFeedback>>() {
+                    }.getType());
+            if (FEEDBACK_QUESTIONS != null) {
+                adapter = new ProductFeedbackListAdapter(ProductFeedbackFormActivity.this, FEEDBACK_QUESTIONS);
+                rcv_feedback_form.setAdapter(adapter);
+            }
+        } else {
+            Toast.makeText(ProductFeedbackFormActivity.this, "No data found", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void getAllFeedbackQuestions() {
+        restService.getAllFeedbackData().enqueue(new Callback<ProductFeedbackResponse>() {
+            @Override
+            public void onResponse(Call<ProductFeedbackResponse> call, Response<ProductFeedbackResponse> response) {
+                if (response.body() != null && response.body().getStatus() == 200) {
+                    SharedPreferences pref = Objects.requireNonNull(ProductFeedbackFormActivity.this).getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+                    SharedPreferences.Editor editor = pref.edit();
+                    if (response.body().getData() != null && response.body().getTotal() > 0) {
+                        FEEDBACK_QUESTIONS = response.body().getData();
+                        Gson gson = new Gson();
+                        JsonElement jsonElement = gson.toJsonTree(
+                                FEEDBACK_QUESTIONS, new TypeToken<ArrayList<ProductFeedback>>() {
+                                }.getType());
+                        editor.putString("FEEDBACK_QUESTIONS_" + storePreference.getStringValue(GlobalData.FEEDBACK_MODEL),
+                                jsonElement.toString()).apply();
+
+                        adapter = new ProductFeedbackListAdapter(ProductFeedbackFormActivity.this, FEEDBACK_QUESTIONS);
+                        rcv_feedback_form.setAdapter(adapter);
+                    } else {
+                        GlobalData.showToast(getBaseContext(), "No data found.", Toast.LENGTH_SHORT).show();
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    CommonMethods.showToast(ProductFeedbackFormActivity.this, response.body().getMessage()).show();
+                } else if (response.body() != null) {
+                    GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                }
+            }
+
+            @Override
+            public void onFailure(Call<ProductFeedbackResponse> call, Throwable t) {
+                GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+        });
+    }
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+    }
+
+    private void onSubmitAnswer() {
+        if (ProductFeedbackListAdapter.feedbackAnsArr != null && ProductFeedbackListAdapter.feedbackAnsArr.size() > 0) {
+
+            progressDialog = new TransparentProgressDialog(ProductFeedbackFormActivity.this);
+            progressDialog.show();
+
+            restService.sendFeedBack(buildConfigData()).enqueue(new Callback<AnswerResponse>() {
+                @Override
+                public void onResponse(Call<AnswerResponse> call, Response<AnswerResponse> response) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        CommonMethods.showToast(ProductFeedbackFormActivity.this, getResources().getString(R.string.message)).show();
+                        startActivity(new Intent(ProductFeedbackFormActivity.this, ProductExploreDetailsActivity.class));
+                        finish();
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        CommonMethods.showToast(ProductFeedbackFormActivity.this, response.body().getMessage()).show();
+                        GlobalData.canLogout = true;
+                        startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                            finish();
+                        }
+                    }
+                }
+
+                @Override
+                public void onFailure(Call<AnswerResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Kindly give atleast one feedback!", Toast.LENGTH_SHORT).show();
+        }
+
+    }
+
+    private CustomerFeedbackModel buildConfigData() {
+        CustomerFeedbackModel customerFeedbackModel = new CustomerFeedbackModel();
+        customerFeedbackModel.setSmpin(GlobalData.user.getData().getSmpin());
+        customerFeedbackModel.setEmpCode(GlobalData.user.getData().getEmp_code());
+        FeedbackDataList feedbackDataLists = new FeedbackDataList();
+        List<FeedbackDataList> feedbackDataListList = new ArrayList<>();
+        List<FeedbackAnswerArrayModel> feedbackDataList = ProductFeedbackListAdapter.feedbackAnsArr;
+        FeedbackAnswerArrayModel answerArrayModel;
+        List<FeedbackAnswerArrayModel> answerArrayModelList = new ArrayList<>();
+        if (feedbackDataList.size() > 0) {
+            for (int i = 0; i < feedbackDataList.size(); i++) {
+                answerArrayModel = new FeedbackAnswerArrayModel();
+                answerArrayModel.setQid(feedbackDataList.get(i).getQid());
+                answerArrayModel.setSurveyRating(feedbackDataList.get(i).getSurveyRating());
+                answerArrayModelList.add(answerArrayModel);
+            }
+        }
+        feedbackDataLists.setUid(storePreference.getStringValue(GlobalData.CURRENTTIME));
+        feedbackDataLists.setFeedbackAnsArr(answerArrayModelList);
+        feedbackDataListList.add(feedbackDataLists);
+        customerFeedbackModel.setCustomerData(feedbackDataListList);
+        return customerFeedbackModel;
+    }
+
+    private void openAlertBox() {
+
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.popup_alert_close);
+        aDialog.setCancelable(true);
+        TextView aAlertMessage = aDialog.findViewById(R.id.txt_alert_message);
+        aAlertMessage.setText("Dear " + storePreference.getStringValue(GlobalData.PRODUCT_NAME));
+        aDialog.show();
+        Button btnYes = aDialog.findViewById(R.id.btn_yes);
+        Button btnNo = aDialog.findViewById(R.id.btn_no);
+        btnYes.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                startActivity(new Intent(ProductFeedbackFormActivity.this, ProductExploreDetailsActivity.class));
+                finish();
+                aDialog.dismiss();
+            }
+        });
+        btnNo.setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View arg0) {
+                // TODO Auto-generated method stub
+                aDialog.dismiss();
+            }
+
+        });
+
+    }
+
+    @Override
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.backButton:
+                onBackPressed();
+                break;
+            case R.id.imgBroucher:
+                startActivity(new Intent(ProductFeedbackFormActivity.this, HyperMEnquiryForm.class));
+                finish();
+                break;
+            case R.id.submitButton:
+                if (CommonMethods.isNetworkAvailable(this)) {
+                    getAllOfflineAnswerSendToServer();
+                    onSubmitAnswer();
+                } else {
+                    onSubmitLocalAnswer();
+                }
+                break;
+            case R.id.img_close:
+                openAlertBox();
+                break;
+            default:
+        }
+    }
+
+    private void getAllOfflineAnswerSendToServer() {
+        CustomerFeedbackModel customerFeedbackModel = new CustomerFeedbackModel();
+        if (SingleTon.getInstance().feedbackModel.getCustomerData() != null && SingleTon.getInstance().feedbackModel.getCustomerData().size() > 0) {
+            customerFeedbackModel = SingleTon.getInstance().feedbackModel;
+        }
+        if (customerFeedbackModel.getCustomerData() != null && customerFeedbackModel.getCustomerData().size() > 0) {
+            restService.sendFeedBack(customerFeedbackModel).enqueue(new Callback<AnswerResponse>() {
+                @Override
+                public void onResponse(Call<AnswerResponse> call, Response<AnswerResponse> response) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        SingleTon.getInstance().feedbackModel = new CustomerFeedbackModel();
+                        CommonMethods.showToast(ProductFeedbackFormActivity.this, response.body().getMessage()).show();
+                        startActivity(new Intent(ProductFeedbackFormActivity.this, ProductExplorerActivity.class));
+                        finish();
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        CommonMethods.showToast(ProductFeedbackFormActivity.this, response.body().getMessage()).show();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    }
+                }
+
+                @Override
+                public void onFailure(Call<AnswerResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+
+        }
+    }
+
+    private void onSubmitLocalAnswer() {
+        CustomerFeedbackModel customerFeedbackModel = new CustomerFeedbackModel();
+        customerFeedbackModel.setSmpin(GlobalData.user.getData().getSmpin());
+        customerFeedbackModel.setEmpCode(GlobalData.user.getData().getEmp_code());
+        FeedbackDataList feedbackDataLists = new FeedbackDataList();
+        List<FeedbackAnswerArrayModel> feedbackDataList = ProductFeedbackListAdapter.feedbackAnsArr;
+        FeedbackAnswerArrayModel answerArrayModel;
+        List<FeedbackAnswerArrayModel> answerArrayModelList = new ArrayList<>();
+        if (feedbackDataList.size() > 0) {
+            for (int i = 0; i < feedbackDataList.size(); i++) {
+                answerArrayModel = new FeedbackAnswerArrayModel();
+                answerArrayModel.setQid(feedbackDataList.get(i).getQid());
+                answerArrayModel.setSurveyRating(feedbackDataList.get(i).getSurveyRating());
+                answerArrayModelList.add(answerArrayModel);
+            }
+        }
+        feedbackDataLists.setUid(storePreference.getStringValue(GlobalData.CURRENTTIME));
+        feedbackDataLists.setFeedbackAnsArr(answerArrayModelList);
+        SingleTon.getInstance().feedbackDataLists.add(feedbackDataLists);
+        customerFeedbackModel.setCustomerData(SingleTon.getInstance().feedbackDataLists);
+        SingleTon.getInstance().feedbackModel = customerFeedbackModel;
+        startActivity(new Intent(ProductFeedbackFormActivity.this, ProductExplorerActivity.class));
+        finish();
+    }
+}

+ 61 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ProductHomeActivity.java

@@ -0,0 +1,61 @@
+package com.cygnusa.hyperm;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import androidx.appcompat.app.AppCompatActivity;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.StorePreference;
+
+public class ProductHomeActivity extends AppCompatActivity {
+    Handler handler;
+    TextView txtFname;
+    private StorePreference storePreference;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_product_home);
+        ImageView imageView = findViewById(R.id.bgImg);
+        Glide.with(this).load(R.drawable.welcome).into(imageView);
+        ImageView imageView1 = findViewById(R.id.bgImg1);
+        Glide.with(this).load(R.drawable.place_holder).into(imageView1);
+        ImageView bgImg2 = findViewById(R.id.bgImg2);
+        Glide.with(this).load(R.drawable.logo_trans).into(bgImg2);
+        initViews();
+    }
+
+    private void initViews() {
+        storePreference = new StorePreference(this);
+        handler = new Handler();
+        txtFname = findViewById(R.id.firstname);
+        String upperString = "";
+        if (storePreference.getStringValue(GlobalData.PRODUCT_NAME) != null || !storePreference.getStringValue(GlobalData.PRODUCT_NAME).equalsIgnoreCase(""))
+            txtFname.setText(firstLetterCaps(storePreference.getStringValue(GlobalData.PRODUCT_NAME)));
+
+        handler.postDelayed(new Runnable() {
+
+            @Override
+            public void run() {
+
+                startExploreMoreActivity();
+            }
+        }, 3000);
+    }
+     public String firstLetterCaps ( String data )
+    {
+        String firstLetter = data.substring(0,1).toUpperCase();
+        String restLetters = data.substring(1).toLowerCase();
+        return firstLetter + restLetters;
+    }
+
+
+    private void startExploreMoreActivity() {
+        startActivity(new Intent(ProductHomeActivity.this, ProductWelcomeScreenActivity.class));
+        finish();
+    }
+}

+ 356 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ProductVideoViewActivity.java

@@ -0,0 +1,356 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.content.pm.ActivityInfo;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.media.MediaPlayer;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.StrictMode;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.videoview.UniversalMediaController;
+import com.cygnusa.hyperm.videoview.UniversalVideoView;
+import com.cygnusa.hyperm.wrappers.MyTopic;
+import com.cygnusa.hyperm.wrappers.ProductVideos;
+import com.cygnusa.hyperm.wrappers.TrainingCategory;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.security.InvalidKeyException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Calendar;
+import java.util.Objects;
+
+import javax.crypto.Cipher;
+import javax.crypto.CipherInputStream;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.spec.SecretKeySpec;
+
+
+public class ProductVideoViewActivity extends AppCompatActivity {
+    public static final String HASH_ALGORITHM = "SHA-256";
+    public static ProductVideos CONTENT = new ProductVideos();
+    public static MyTopic TOPIC = new MyTopic();
+    public static TrainingCategory TRAINING_ID;
+    public static String tempfilename = "temp";
+    public static ProductVideos content = new ProductVideos();
+    public int total;
+    public String encryptKey = "Hyperm";
+    public File decryptFile = null;
+    TextView title;
+    UniversalVideoView videoView;
+    UniversalMediaController mMediaController;
+    View mVideoLayout;
+    View appBarLayout;
+    Toolbar toolbar;
+    ApiService restService;
+    ProgressBar progressBar;
+    String type;
+    Handler handler = new Handler();
+    Calendar c;
+    private int mSeekPosition;
+    private int cachedHeight;
+    private boolean isFullscreenMode;
+    private boolean isFirst = true;
+
+    public static SecretKeySpec generateKey(final String password) throws NoSuchAlgorithmException {
+        final MessageDigest digest = MessageDigest.getInstance(HASH_ALGORITHM);
+        byte[] bytes = password.getBytes(StandardCharsets.UTF_8);
+        digest.update(bytes, 0, bytes.length);
+        byte[] key = digest.digest();
+        return new SecretKeySpec(key, "AES");
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.fragment_video_view);
+        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
+        setupWindowAnimations();
+        Bundle extras = getIntent().getExtras();
+        if (extras != null) {
+            type = extras.getString("type");
+        }
+        restService = ((MainApplication) getApplication()).getClient();
+
+        File f = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null), ".HYPERM");
+        if (!f.exists()) {
+            f.mkdirs();
+        }
+
+        File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null) + "/" + ".HYPERM", "VIDEO");
+        if (!f1.exists()) {
+            f1.mkdirs();
+        }
+        mVideoLayout = findViewById(R.id.video_layout);
+        appBarLayout = findViewById(R.id.appBarLayout);
+        mMediaController = findViewById(R.id.media_controller);
+
+        title = findViewById(R.id.title);
+        videoView = findViewById(R.id.videoView);
+        mVideoLayout = findViewById(R.id.video_layout);
+        progressBar = findViewById(R.id.progressBar);
+        progressBar.setVisibility(View.VISIBLE);
+
+        title.setText(CONTENT.getTitle());
+        title.setSelected(true);
+        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
+        StrictMode.setThreadPolicy(policy);
+
+        toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.white), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        new Handler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                loadContentFile();
+            }
+        }, 1000);
+    }
+
+    public void decrypt(String pathstr, Runnable runnable) throws IOException, NoSuchAlgorithmException,
+            NoSuchPaddingException, InvalidKeyException {
+
+        FileInputStream fis = new FileInputStream(pathstr);
+        decryptFile = File.createTempFile(tempfilename, ".mp4", this.getCacheDir());
+        FileOutputStream fos = new FileOutputStream(decryptFile);
+        SecretKeySpec sks = generateKey(encryptKey);
+        @SuppressLint("GetInstance")
+        Cipher cipher = Cipher.getInstance("AES");
+        cipher.init(Cipher.DECRYPT_MODE, sks);
+        CipherInputStream cis = new CipherInputStream(fis, cipher);
+        int b;
+        byte[] d = new byte[1024];
+        while ((b = cis.read(d)) != -1) {
+            fos.write(d, 0, b);
+        }
+        fos.flush();
+        fos.close();
+        cis.close();
+        runnable.run();
+    }
+
+
+    public void loadContentFile() {
+        try {
+            title.setText(CONTENT.getTitle());
+            mVideoLayout.post(new Runnable() {
+                @Override
+                public void run() {
+                    int width = mVideoLayout.getWidth();
+                    cachedHeight = (int) (width * 405f / 720f);
+                    ViewGroup.LayoutParams videoLayoutParams = mVideoLayout.getLayoutParams();
+                    videoLayoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+                    videoLayoutParams.height = cachedHeight;
+                    mVideoLayout.setLayoutParams(videoLayoutParams);
+                    String fileName = Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                            + "/" + ".HYPERM/VIDEO/" + CONTENT.getContentid() + "_" + CONTENT.getVersion() + ".mp4";
+                    if (new File(fileName).exists()) {
+                        // saveTopicData();
+                        try {
+                            decrypt(fileName, new Runnable() {
+                                @Override
+                                public void run() {
+                                    if (decryptFile != null) {
+                                        try {
+                                            Uri videoUri = Uri.parse(decryptFile.getAbsolutePath());
+                                            videoView.setVideoURI(videoUri);
+                                        } catch (Exception e) {
+                                            e.printStackTrace();
+                                        }
+                                    }
+                                }
+                            });
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    } else {
+                        videoView.setVideoPath(CONTENT.getFile_url().trim());
+                    }
+
+                    videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
+                        @Override
+                        public void onPrepared(MediaPlayer mp) {
+                            if (isFirst) {
+                                isFirst = false;
+                                videoView.requestFocus();
+                                videoView.start();
+                            } else {
+                                videoView.seekTo(1000);
+                                mMediaController.showComplete();
+                            }
+                        }
+                    });
+
+                    videoView.setMediaController(mMediaController);
+                    videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
+                        @Override
+                        public void onCompletion(MediaPlayer mp) {
+                            try {
+                                String mName = Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                                        + "/" + ".HYPERM/VIDEO/" + CONTENT.getContentid() + "_" + CONTENT.getVersion() + ".mp4";
+                                videoView.closePlayer();
+                                if (new File(mName).exists()) {
+                                    decrypt(mName, new Runnable() {
+                                        @Override
+                                        public void run() {
+                                            if (decryptFile != null) {
+                                                try {
+                                                    Uri videoUri = Uri.parse(decryptFile.getAbsolutePath());
+                                                    videoView.setVideoURI(videoUri);
+                                                } catch (Exception e) {
+                                                    e.printStackTrace();
+                                                }
+                                            }
+                                        }
+                                    });
+                                } else {
+                                    videoView.setVideoPath(CONTENT.getFile_url().trim());
+                                }
+
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    });
+
+                    videoView.setVideoViewCallback(new UniversalVideoView.VideoViewCallback() {
+                        @Override
+                        public void onScaleChange(boolean isFullscreen) {
+                            isFullscreenMode = isFullscreen;
+                            if (isFullscreen) {
+                                ViewGroup.LayoutParams layoutParams = mVideoLayout.getLayoutParams();
+                                layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+                                layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
+                                mVideoLayout.setLayoutParams(layoutParams);
+
+                            } else {
+                                ViewGroup.LayoutParams layoutParams = mVideoLayout.getLayoutParams();
+                                layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+                                layoutParams.height = cachedHeight;
+                                mVideoLayout.setLayoutParams(layoutParams);
+
+                            }
+                            switchTitleBar(!isFullscreen);
+                        }
+
+                        @Override
+                        public void onPause(MediaPlayer mediaPlayer) {
+                            if (videoView != null && videoView.isPlaying()) {
+                                mSeekPosition = videoView.getCurrentPosition();
+                                videoView.pause();
+                            }
+                        }
+
+                        @Override
+                        public void onStart(MediaPlayer mediaPlayer) {
+                            progressBar.setVisibility(View.GONE);
+
+                        }
+
+                        @Override
+                        public void onBufferingStart(MediaPlayer mediaPlayer) {
+                            progressBar.setVisibility(View.GONE);
+                        }
+
+                        @Override
+                        public void onBufferingEnd(MediaPlayer mediaPlayer) {
+
+                        }
+
+                    });
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            progressBar.setVisibility(View.GONE);
+        }
+    }
+
+    private void switchTitleBar(boolean show) {
+        androidx.appcompat.app.ActionBar supportActionBar = getSupportActionBar();
+        if (supportActionBar != null) {
+            if (show) {
+                supportActionBar.show();
+            } else {
+                supportActionBar.hide();
+            }
+        }
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        if (isFullscreenMode) {
+            videoView.setFullscreen(false);
+        } else {
+            super.onBackPressed();
+            this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+
+
+    }
+
+    @Override
+    protected void onSaveInstanceState(@NonNull Bundle outState) {
+        super.onSaveInstanceState(outState);
+        outState.putInt("SEEK_POSITION_KEY", mSeekPosition);
+    }
+
+    @Override
+    protected void onRestoreInstanceState(Bundle outState) {
+        super.onRestoreInstanceState(outState);
+        mSeekPosition = outState.getInt("SEEK_POSITION_KEY");
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+}

+ 249 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ProductWelcomeScreenActivity.java

@@ -0,0 +1,249 @@
+package com.cygnusa.hyperm;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.Window;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.adapter.ProductListAdapter;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.CommonMethods;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.GetAllExploreImageList;
+import com.cygnusa.hyperm.wrappers.GetAllExploreModel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class ProductWelcomeScreenActivity extends AppCompatActivity implements View.OnClickListener {
+    ApiService restService;
+    private GridView gridView;
+    private ProductListAdapter productAdapter;
+    String selectedModel = "1";
+    ProgressBar progressBar;
+    StorePreference storePreference;
+    List<GetAllExploreImageList> listData = new ArrayList<>();
+    private ImageView img_close, img_broucher, img_rating;
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_welcome);
+        restService = ((MainApplication) getApplication()).getClient();
+        initViews();
+    }
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+    private void initViews() {
+        progressBar = findViewById(R.id.progress);
+        progressBar.setVisibility(View.GONE);
+        img_close = findViewById(R.id.img_close);
+        img_close.setOnClickListener(this);
+        img_broucher = findViewById(R.id.imgBroucher);
+        img_broucher.setOnClickListener(this);
+        img_rating = findViewById(R.id.img_rating);
+        img_rating.setOnClickListener(this);
+        gridView = (GridView) findViewById(R.id.gridView);
+        storePreference = new StorePreference(this);
+        storePreference.setString(GlobalData.SELECTED_MODEL, selectedModel);
+        setupWindowAnimations();
+        if (CommonMethods.isNetworkAvailable(this)) {
+            getAllExploreImageDataList();
+        } else {
+            checkLocalExplorerFile();
+        }
+        gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
+                if(position==listData.size()){
+
+                }else {
+                    Intent intent = new Intent(ProductWelcomeScreenActivity.this, ProductExplorerActivity.class);
+                    storePreference.setString(GlobalData.SELECTED_MODEL_NAME, listData.get(position).getModelName());
+                    storePreference.setString(GlobalData.SELECTED_MODEL, listData.get(position).getModelId());
+                    storePreference.setInt(GlobalData.SELECTID, position);
+                    startActivity(intent);
+                }
+            }
+        });
+    }
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            startActivity(new Intent(this, ProductExploreDetailsActivity.class));
+        }
+        return super.onOptionsItemSelected(item);
+    }
+    @Override
+    public void onBackPressed() {
+        if (GlobalData.user.getData().getRole().equalsIgnoreCase("16")) {
+            startActivity(new Intent(ProductWelcomeScreenActivity.this, ProductExploreDetailsActivity.class));
+            finish();
+        } else {
+            super.onBackPressed();
+        }
+    }
+    private void getAllExploreImageDataList() {
+        progressBar.setVisibility(View.VISIBLE);
+        restService.getAllExploreImage().enqueue(new Callback<GetAllExploreModel>() {
+            @Override
+            public void onResponse(@NonNull Call<GetAllExploreModel> call, @NonNull Response<GetAllExploreModel> response) {
+                progressBar.setVisibility(View.GONE);
+                SharedPreferences pref = getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+                SharedPreferences.Editor editor = pref.edit();
+                if (response.body() != null && response.body().getStatus() == 200) {
+                    listData = response.body().getData();
+                    if (listData != null && listData.size() > 0) {
+                        Gson gson = new Gson();
+                        JsonElement jsonElement = gson.toJsonTree(
+                                listData, new TypeToken<List<GetAllExploreImageList>>() {
+                                }.getType());
+                        editor.putString("EXPLORE_WELCOME_DATA", jsonElement.toString()).apply();
+                        productAdapter = new ProductListAdapter(ProductWelcomeScreenActivity.this, listData);
+                        gridView.setAdapter(productAdapter);
+                    } else {
+                        checkLocalExplorerFile();
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                        finish();
+                    }
+                } else {
+                    checkLocalExplorerFile();
+                }
+            }
+
+            @Override
+            public void onFailure(Call<GetAllExploreModel> call, Throwable t) {
+                progressBar.setVisibility(View.GONE);
+                checkLocalExplorerFile();
+            }
+        });
+    }
+    private void checkLocalExplorerFile() {
+        SharedPreferences pref = getSharedPreferences("PRODUCT_MODULE", Context.MODE_PRIVATE);
+        if (pref.getString("EXPLORE_WELCOME_DATA", null) != null) {
+            Gson gson = new Gson();
+            List<GetAllExploreImageList> data = gson.fromJson(
+                    pref.getString("EXPLORE_WELCOME_DATA", null),
+                    new TypeToken<List<GetAllExploreImageList>>() {
+                    }.getType());
+            listData=data;
+            productAdapter = new ProductListAdapter(ProductWelcomeScreenActivity.this, data);
+            gridView.setAdapter(productAdapter);
+
+        } else {
+            Toast.makeText(this, "No data found", Toast.LENGTH_SHORT).show();
+        }
+    }
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()) {
+            case R.id.img_close:
+                openCloseAlertBox();
+                break;
+            case R.id.imgBroucher:
+                startActivity(new Intent(this, HyperMEnquiryForm.class));
+                break;
+            case R.id.img_rating:
+                startActivity(new Intent(this, ProductFeedbackFormActivity.class));
+                break;
+            default:
+        }
+    }
+    private void openCloseAlertBox() {
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.popup_alert_close);
+        aDialog.setCancelable(true);
+        TextView aAlertMessage = aDialog.findViewById(R.id.txt_alert_message);
+        aAlertMessage.setText("Dear " + storePreference.getStringValue(GlobalData.PRODUCT_NAME));
+        aDialog.show();
+        Button btnYes = aDialog.findViewById(R.id.btn_yes);
+        Button btnNo = aDialog.findViewById(R.id.btn_no);
+        btnYes.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                openFeedbackAlertBox();
+                aDialog.dismiss();
+            }
+        });
+        btnNo.setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View arg0) {
+                // TODO Auto-generated method stub
+                aDialog.dismiss();
+            }
+
+        });
+    }
+    private void openFeedbackAlertBox() {
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.popup_alert_feedback);
+        aDialog.setCancelable(true);
+        TextView aAlertMessage = aDialog.findViewById(R.id.txt_alert_message);
+        aAlertMessage.setText("Dear " + storePreference.getStringValue(GlobalData.PRODUCT_NAME));
+        aDialog.show();
+        TextView txtSkip;
+        ImageView imgClose;
+        imgClose = aDialog.findViewById(R.id.img_close);
+        txtSkip = aDialog.findViewById(R.id.txtSkip);
+        imgClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                aDialog.dismiss();
+            }
+        });
+        txtSkip.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                aDialog.dismiss();
+                startActivity(new Intent(ProductWelcomeScreenActivity.this, ProductExploreDetailsActivity.class));
+                finish();
+            }
+        });
+
+        Button btnYes = aDialog.findViewById(R.id.btn_yes);
+        btnYes.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                startActivity(new Intent(ProductWelcomeScreenActivity.this, ProductFeedbackFormActivity.class));
+                aDialog.dismiss();
+            }
+        });
+    }
+}

+ 165 - 0
Android/app/src/main/java/com/cygnusa/hyperm/RedeemPointsCategoryActivity.java

@@ -0,0 +1,165 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Handler;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.StaggeredGridLayoutManager;
+import androidx.appcompat.widget.Toolbar;
+import android.view.MenuItem;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.adapter.RedeemPointListAdapter;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.RedeemCategory;
+import com.cygnusa.hyperm.wrappers.RedeemCategoryListResponse;
+import com.tylersuehr.esr.EmptyStateRecyclerView;
+import com.tylersuehr.esr.TextStateDisplay;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class RedeemPointsCategoryActivity extends AppCompatActivity {
+    private EmptyStateRecyclerView redeemList;
+    RedeemPointListAdapter adapter;
+    TransparentProgressDialog progressDialog;
+    ApiService restService;
+    RedeemCategory Categories = new RedeemCategory();
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_redeem);
+        restService = ((MainApplication) getApplication()).getClient();
+        redeemList = findViewById(R.id.redeemList);
+        redeemList.setHasFixedSize(true);
+        redeemList.setItemAnimator(new SlideInLeftAnimator());
+        StaggeredGridLayoutManager gridLayoutManager =
+                new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
+        redeemList.setLayoutManager(gridLayoutManager);
+        redeemList.setStateDisplay(EmptyStateRecyclerView.STATE_EMPTY,
+                new TextStateDisplay(this, "No data available", ""));
+        redeemList.post(new Runnable() {
+            @Override
+            public void run() {
+               //startActivity(new Intent(RedeemPointsCategoryActivity.this, RedeemProductListActivity.class));
+                getCategoryList(true);
+            }
+        });
+
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setNavigationIcon(R.mipmap.back);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+    }
+    protected void onResume() {
+        super.onResume();
+
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+    private void getCategoryList(boolean canLoadProgress) {
+        if (new UtilService().isNetworkAvailable(RedeemPointsCategoryActivity.this)) {
+            if (canLoadProgress) {
+                progressDialog = new TransparentProgressDialog(RedeemPointsCategoryActivity.this);
+                progressDialog.show();
+               // progressBar.setVisibility(View.GONE);
+            } else {
+               // progressBar.setVisibility(View.VISIBLE);
+            }
+
+            restService.getRedeemCategoryList().enqueue(new Callback<RedeemCategoryListResponse>() {
+                @Override
+                public void onResponse(Call<RedeemCategoryListResponse> call, Response<RedeemCategoryListResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                 //   progressBar.setVisibility(View.GONE);
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+
+                        if (adapter == null) {
+                            Categories = response.body().getData();
+                            adapter = new RedeemPointListAdapter(RedeemPointsCategoryActivity.this,  Categories);
+                            redeemList.setAdapter(adapter);
+                        } else {
+                           // Categories.addAll(response.body().getData());
+
+                        }
+
+//                        if (Categories.getRoot_category(). == 0) {
+//                            redeemList.invokeState(EmptyStateRecyclerView.STATE_EMPTY);
+//                        } else {
+//                            redeemList.invokeState(EmptyStateRecyclerView.STATE_OK);
+//                        }
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(RedeemPointsCategoryActivity.this, message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                            finish();
+                        }
+                    }
+
+
+                }
+
+                @Override
+                public void onFailure(Call<RedeemCategoryListResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                   // progressBar.setVisibility(View.GONE);
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            confirmClose();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void confirmClose() {
+        new Handler(MyWallet.callbackOrderHistory).sendEmptyMessage(0);
+        finish();
+        RedeemPointsCategoryActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+}

+ 510 - 0
Android/app/src/main/java/com/cygnusa/hyperm/RedeemProductDetailsActivity.java

@@ -0,0 +1,510 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.text.SpannableString;
+import android.text.style.UnderlineSpan;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.adapter.RedeemProductListAdapter;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.OrderStatus;
+import com.cygnusa.hyperm.wrappers.ProductListDetails;
+import com.cygnusa.hyperm.wrappers.RedeemProductDetails;
+import com.cygnusa.hyperm.wrappers.RedeemProductDetailsResponse;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class RedeemProductDetailsActivity extends AppCompatActivity {
+    private RecyclerView redeemList;
+    RedeemProductListAdapter adapter;
+    TransparentProgressDialog progressDialog;
+    ApiService restService;
+    private LinearLayoutManager linearLayoutManager;
+    private ImageView productImage;
+    private TextView productTitle, desc, productPrice, earnedPoints, header;
+    RedeemProductDetails productDetailsResponse = new RedeemProductDetails();
+    Button btnPurchase;
+    public static ProductListDetails productList = new ProductListDetails();
+    private LinearLayout priceListView;
+    public String[] priceDenominations;
+    public ArrayList<String> priceDenominationsFinal = new ArrayList<>();
+    public ArrayList<MyViewHolderPrice> PRICE_HOLDER = new ArrayList<>();
+    public String strPrice = "0";
+    public EditText editPrice;
+    public LinearLayout rangeLayout, slabLayout;
+    int minAmount = 0, maxAmount = 0, enteredAmount = 0;
+    public OrderStatus orderStatus = new OrderStatus();
+    String typePrice = "";
+    Integer iCurrentAmount = 0;
+    private String strTermsnContions;
+    AlertDialog.Builder alertDialogBuilder;
+    AlertDialog alertDialog;
+    private TextView txtTermsnConditions, title;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.redeem_product_details);
+        setupUI(findViewById(R.id.bgLayout));
+
+        restService = ((MainApplication) getApplication()).getClient();
+        productImage = findViewById(R.id.product_image);
+        header = findViewById(R.id.title);
+        productTitle = findViewById(R.id.productTitle);
+        editPrice = findViewById(R.id.edit_price);
+        rangeLayout = findViewById(R.id.range);
+        slabLayout = findViewById(R.id.slab);
+        productPrice = findViewById(R.id.redeem_price);
+        earnedPoints = findViewById(R.id.total_earned_points);
+        desc = findViewById(R.id.productDesc);
+        btnPurchase = findViewById(R.id.btn_purchase);
+        getProductDetails(true);
+        iCurrentAmount = Integer.parseInt(MyWallet.strCurrentAmount);
+        //  Amount = findViewById(R.id.redeem_price);
+        priceListView = (LinearLayout) findViewById(R.id.priceList);
+        txtTermsnConditions = (TextView) findViewById(R.id.terms_link);
+        SpannableString loginText = new SpannableString("Terms and Conditions");
+        loginText.setSpan(new UnderlineSpan(), 0, loginText.length(), 0);
+        txtTermsnConditions.setText(loginText);
+        txtTermsnConditions.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent i = new Intent(RedeemProductDetailsActivity.this, TermsandConditions.class);
+                i.putExtra("tnc", productDetailsResponse.getTnc_web() + "");
+                startActivity(i);
+            }
+        });
+        btnPurchase.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (!typePrice.equalsIgnoreCase("")) {
+                    if (typePrice.equalsIgnoreCase("Range")) {
+                        if (editPrice.getText().toString() == null || editPrice.getText().toString().equalsIgnoreCase("")) {
+                            GlobalData.showToast(RedeemProductDetailsActivity.this, "Enter amount", Toast.LENGTH_SHORT).show();
+                            return;
+                        }
+
+
+                        if (!editPrice.getText().toString().equalsIgnoreCase("")) {
+                            enteredAmount = Integer.parseInt(editPrice.getText().toString());
+                            if (enteredAmount <= maxAmount && enteredAmount >= minAmount) {
+
+                                if (enteredAmount <= iCurrentAmount) {
+                                    productOrder(true, editPrice.getText().toString());
+                                } else {
+                                    GlobalData.showToast(RedeemProductDetailsActivity.this, "Entered amount should be less than available balance", Toast.LENGTH_SHORT).show();
+                                    return;
+                                }
+
+                            } else {
+                                GlobalData.showToast(RedeemProductDetailsActivity.this, "Enter amount should be in limit", Toast.LENGTH_SHORT).show();
+                                return;
+                            }
+
+
+                        }
+                    } else {
+
+                        if (strPrice == null || strPrice.equalsIgnoreCase("")) {
+                            GlobalData.showToast(RedeemProductDetailsActivity.this, "Select slab amount", Toast.LENGTH_SHORT).show();
+                            return;
+                        }
+                        enteredAmount = Integer.parseInt(strPrice);
+                        if (enteredAmount <= maxAmount && enteredAmount >= minAmount) {
+                            productOrder(true, strPrice);
+                        } else {
+                            GlobalData.showToast(RedeemProductDetailsActivity.this, "Entered amount should be in limit", Toast.LENGTH_SHORT).show();
+                        }
+                    }
+
+                }
+
+            }
+        });
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setNavigationIcon(R.mipmap.back);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+
+    }
+
+    protected void onResume() {
+        super.onResume();
+
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    activity.getCurrentFocus().getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(RedeemProductDetailsActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void productOrder(boolean canLoadProgress, String price) {
+        if (new UtilService().isNetworkAvailable(RedeemProductDetailsActivity.this)) {
+            if (canLoadProgress) {
+                progressDialog = new TransparentProgressDialog(RedeemProductDetailsActivity.this);
+                progressDialog.show();
+                // progressBar.setVisibility(View.GONE);
+            } else {
+                // progressBar.setVisibility(View.VISIBLE);
+            }
+
+            try {
+                HashMap<String, String> map = new HashMap<>();
+                map.put("product_id", productDetailsResponse.getId());
+                map.put("product_price", price);
+
+                restService.postProductOrder(map).enqueue(new Callback<OrderStatus>() {
+                    @Override
+                    public void onResponse(Call<OrderStatus> call, Response<OrderStatus> response) {
+
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        //   progressBar.setVisibility(View.GONE);
+                        orderStatus = response.body();
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+
+                            showInstructions(orderStatus.getType() + "");
+
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                        }
+
+                    }
+
+                    @Override
+                    public void onFailure(Call<OrderStatus> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        // progressBar.setVisibility(View.GONE);
+                        GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    public void arrayList(String s) {
+        priceDenominations = s.split(",");
+
+    }
+
+    public void updateList() {
+
+        priceListView.removeAllViews();
+        int indexListSize = priceDenominationsFinal.size();
+        if (indexListSize < 1) {
+            return;
+        }
+        for (int i = 0; i < indexListSize; i++) {
+            MyViewHolderPrice holder = new MyViewHolderPrice(this, LayoutInflater.from(this).inflate(R.layout.price_text_item, null, false));
+            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
+            params.setMargins(0, 0, 0, 15);
+            holder.getView().setId(i);
+            holder.txtPrice.setText(priceDenominationsFinal.get(i));
+            priceListView.addView(holder.getView(), params);
+            PRICE_HOLDER.add(holder);
+            holder.getView().setOnClickListener(new onDayClick());
+            //  strPrice =priceDenominations[0];
+        }
+
+    }
+
+    private void showInstructions(String type) {
+        View view = LayoutInflater.from(RedeemProductDetailsActivity.this).inflate(
+                R.layout.profile_success, null);
+        TextView textHead = (TextView) view.findViewById(R.id.textHead);
+        ImageView successImage = (ImageView) view.findViewById(R.id.success);
+        TextView text1 = (TextView) view.findViewById(R.id.text1);
+        TextView text2 = (TextView) view.findViewById(R.id.text2);
+        TextView text3 = (TextView) view.findViewById(R.id.text3);
+        text3.setVisibility(View.GONE);
+        textHead.setVisibility(View.GONE);
+        if (type.trim().equalsIgnoreCase("1")) {
+            successImage.setImageDrawable(getResources().getDrawable(R.drawable.success));
+            text1.setText("Your order has been");
+            text2.setText("placed successfully");
+        } else {
+            successImage.setImageDrawable(getResources().getDrawable(R.drawable.success_orange));
+
+            text1.setText("Your order placed");
+            text2.setText("Status will be updated soon!");
+        }
+
+        view.findViewById(R.id.btn_ok).setOnClickListener(
+                new View.OnClickListener() {
+
+                    @Override
+                    public void onClick(View v) {
+                        startActivity(new Intent(RedeemProductDetailsActivity.this, RedeemProductListActivity.class));
+                        finish();
+                    }
+                });
+
+        alertDialogBuilder = new AlertDialog.Builder(RedeemProductDetailsActivity.this);
+        alertDialogBuilder.setCancelable(false);
+        alertDialogBuilder.setView(view);
+        alertDialog = alertDialogBuilder.create();
+        alertDialog.show();
+    }
+
+    public class onDayClick implements View.OnClickListener {
+        @Override
+        public void onClick(View v) {
+            for (int id = 0; id < priceListView.getChildCount(); id++) {
+                LinearLayout child = (LinearLayout) priceListView.getChildAt(id);
+                TextView txt = (TextView) child.getChildAt(0);
+                txt.setTextColor(getResources().getColor(R.color.btn_bg_color));
+                txt.setBackgroundResource(R.drawable.border_grey);
+            }
+            LinearLayout child = (LinearLayout) priceListView.getChildAt(v.getId());
+            TextView txt = (TextView) child.getChildAt(0);
+            txt.setBackgroundResource(R.drawable.fill_color);
+            txt.setTextColor(getResources().getColor(R.color.material_white));
+            strPrice = priceDenominationsFinal.get(v.getId());
+
+        }
+    }
+
+    public class MyViewHolderPrice {
+
+        TextView txtPrice;
+        View convertView;
+
+        MyViewHolderPrice(Context context, View view) {
+            convertView = view;
+            txtPrice = (TextView) view.findViewById(R.id.price_denominations);
+            view.setTag(this);
+        }
+
+        public View getView() {
+            return convertView;
+        }
+    }
+
+
+    private void getProductDetails(boolean canLoadProgress) {
+        if (new UtilService().isNetworkAvailable(RedeemProductDetailsActivity.this)) {
+            if (canLoadProgress) {
+                progressDialog = new TransparentProgressDialog(RedeemProductDetailsActivity.this);
+                progressDialog.show();
+                // progressBar.setVisibility(View.GONE);
+            } else {
+                // progressBar.setVisibility(View.VISIBLE);
+            }
+
+            restService.getProductDetails(productList.getId()).enqueue(new Callback<RedeemProductDetailsResponse>() {
+                @Override
+                public void onResponse(Call<RedeemProductDetailsResponse> call, Response<RedeemProductDetailsResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        productDetailsResponse = response.body().getData();
+                        setProductDetails();
+
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        }
+                    }
+
+
+                }
+
+                @Override
+                public void onFailure(Call<RedeemProductDetailsResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    // progressBar.setVisibility(View.GONE);
+
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    @SuppressLint("SetTextI18n")
+    private void setProductDetails() {
+
+        txtTermsnConditions.setVisibility(View.VISIBLE);
+        minAmount = Integer.parseInt(productDetailsResponse.getMin_custom_price());
+        maxAmount = Integer.parseInt(productDetailsResponse.getMax_custom_price());
+        header.setText(productDetailsResponse.getName());
+        if (productDetailsResponse.getPrice_type().equalsIgnoreCase("Range")) {
+
+            slabLayout.setVisibility(View.GONE);
+            rangeLayout.setVisibility(View.VISIBLE);
+            if (iCurrentAmount < Integer.parseInt(productDetailsResponse.getMax_custom_price())) {
+                editPrice.setHint(productDetailsResponse.getMin_custom_price() + " to " + MyWallet.strCurrentAmount);
+            } else {
+                editPrice.setHint(productDetailsResponse.getMin_custom_price() + " to " + productDetailsResponse.getMax_custom_price());
+            }
+            priceListView.setVisibility(View.GONE);
+
+        } else if (productDetailsResponse.getPrice_type().equalsIgnoreCase("Slab")) {
+            if (productDetailsResponse.getCustom_denominations() != null) {
+
+                arrayList(productDetailsResponse.getCustom_denominations());
+                for (int i = 0; i < priceDenominations.length; i++) {
+                    int iAmount = Integer.parseInt(priceDenominations[i]);
+                    if (iCurrentAmount > iAmount) {
+                        priceDenominationsFinal.add(priceDenominations[i]);
+                    }
+                }
+            }
+            slabLayout.setVisibility(View.VISIBLE);
+            rangeLayout.setVisibility(View.GONE);
+            priceListView.setVisibility(View.VISIBLE);
+            updateList();
+        }
+
+        if (productDetailsResponse.getPrice_type() != null) {
+            typePrice = productDetailsResponse.getPrice_type();
+        }
+
+        productTitle.setText(productDetailsResponse.getName());
+        productPrice.setText(productDetailsResponse.getMin_custom_price() + " to " + productDetailsResponse.getMax_custom_price());
+        //  earnedPoints.setText("Available Points:"+"5000");
+        desc.setText(productDetailsResponse.getDescription());
+        Glide.with(this).load(productDetailsResponse.getImages())
+                .thumbnail(Glide.with(this).load(R.drawable.gif_loader))
+                .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                        .placeholder(R.drawable.placeholder).error(R.drawable.placeholder)).into(productImage);
+
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        confirmClose();
+
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            confirmClose();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void confirmClose() {
+        startActivity(new Intent(RedeemProductDetailsActivity.this, RedeemProductListActivity.class));
+        finish();
+        RedeemProductDetailsActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+}

+ 219 - 0
Android/app/src/main/java/com/cygnusa/hyperm/RedeemProductListActivity.java

@@ -0,0 +1,219 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.MenuItem;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.adapter.RedeemProductListAdapter;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.RedeemCategoryListResponse;
+import com.cygnusa.hyperm.wrappers.RedeemProduct;
+import com.cygnusa.hyperm.wrappers.RedeemProductResponse;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class RedeemProductListActivity extends AppCompatActivity {
+    private RecyclerView redeemList;
+    RedeemProductListAdapter adapter;
+    TransparentProgressDialog progressDialog;
+    ApiService restService;
+    private LinearLayoutManager linearLayoutManager;
+    RedeemProduct productList = new RedeemProduct();
+    TextView header;
+    private StorePreference storePreference;
+    String cate_id = "";
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_redeem_product_list);
+        restService = ((MainApplication) getApplication()).getClient();
+        redeemList = findViewById(R.id.redeemProductList);
+        header = findViewById(R.id.title);
+        redeemList.setHasFixedSize(true);
+        redeemList.setItemAnimator(new SlideInLeftAnimator());
+        linearLayoutManager = new LinearLayoutManager(getBaseContext());
+        redeemList.setLayoutManager(linearLayoutManager);
+
+        getCategoryList(true);
+
+        storePreference = new StorePreference(this);
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setNavigationIcon(R.mipmap.back);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+
+    }
+
+    private void getCategoryList(boolean canLoadProgress) {
+        if (new UtilService().isNetworkAvailable(RedeemProductListActivity.this)) {
+            if (canLoadProgress) {
+                progressDialog = new TransparentProgressDialog(RedeemProductListActivity.this);
+                progressDialog.show();
+                // progressBar.setVisibility(View.GONE);
+            } else {
+                // progressBar.setVisibility(View.VISIBLE);
+            }
+
+            restService.getRedeemCategoryList().enqueue(new Callback<RedeemCategoryListResponse>() {
+                @Override
+                public void onResponse(Call<RedeemCategoryListResponse> call, Response<RedeemCategoryListResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    //   progressBar.setVisibility(View.GONE);
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        cate_id = response.body().getData().getRoot_category().getCategory_id();
+                        redeemList.post(new Runnable() {
+                            @Override
+                            public void run() {
+                                // startActivity(new Intent(RedeemProductListActivity.this, RedeemProductDetailsActivity.class));
+                                getProductList(true, cate_id);
+                            }
+                        });
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(RedeemProductListActivity.this, message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                            finish();
+                        }
+                    }
+
+
+                }
+
+                @Override
+                public void onFailure(Call<RedeemCategoryListResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    // progressBar.setVisibility(View.GONE);
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    protected void onResume() {
+        super.onResume();
+
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            confirmClose();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void getProductList(boolean canLoadProgress, String cate_id) {
+        if (new UtilService().isNetworkAvailable(RedeemProductListActivity.this)) {
+            if (canLoadProgress) {
+                progressDialog = new TransparentProgressDialog(RedeemProductListActivity.this);
+                progressDialog.show();
+                // progressBar.setVisibility(View.GONE);
+            } else {
+                // progressBar.setVisibility(View.VISIBLE);
+            }
+
+            restService.getRedeemCategoryProductList(cate_id).enqueue(new Callback<RedeemProductResponse>() {
+                @Override
+                public void onResponse(Call<RedeemProductResponse> call, Response<RedeemProductResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        productList = response.body().getData();
+                        header.setText(productList.getName());
+                        adapter = new RedeemProductListAdapter(RedeemProductListActivity.this, productList);
+                        redeemList.setAdapter(adapter);
+
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        //  GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message != null)
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                    }
+
+
+                }
+
+                @Override
+                public void onFailure(Call<RedeemProductResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    // progressBar.setVisibility(View.GONE);
+
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void confirmClose() {
+        finish();
+        RedeemProductListActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+}

+ 218 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ResetPasswordActivity.java

@@ -0,0 +1,218 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import android.text.TextUtils;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+
+import java.util.HashMap;
+import java.util.regex.Pattern;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class ResetPasswordActivity extends AppCompatActivity {
+  EditText newPassword, confirmPassword;
+  ApiService restService;
+  TransparentProgressDialog progressDialog;
+  // String PASSWORD_PATTERN = "((?=.*[a-zA-Z0-9]).{8,32})";
+  String PASSWORD_PATTERN = "((?=.*\\d)(?=.*[a-z,A-Z]).{8,30})";
+  AlertDialog.Builder alertDialogBuilder;
+  AlertDialog alertDialog;
+  String userName;
+  TextView mTitle;
+
+  public static void hideSoftKeyboard(Activity activity) {
+    try {
+      InputMethodManager inputMethodManager =
+              (InputMethodManager) activity.getSystemService(
+                      Activity.INPUT_METHOD_SERVICE);
+      inputMethodManager.hideSoftInputFromWindow(
+              activity.getCurrentFocus().getWindowToken(), 0);
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+
+  @Override
+  protected void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+
+    setContentView(R.layout.activity_set_password);
+    GlobalData.openDatabase(ResetPasswordActivity.this);
+    setupWindowAnimations();
+    setupUI(findViewById(R.id.bgLayout));
+    Bundle extras = getIntent().getExtras();
+    if (extras != null) {
+      userName = extras.getString("username");
+    }
+
+    restService = ((MainApplication) getApplication()).getClient();
+    newPassword = findViewById(R.id.newPassword);
+    confirmPassword = findViewById(R.id.confirmPassword);
+    mTitle=   findViewById(R.id.title);
+
+    findViewById(R.id.continueButton).setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View view) {
+        attemptLogin();
+      }
+    });
+    mTitle.setText("RESET PASSWORD");
+    Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+    backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+    ImageView imageView = findViewById(R.id.back_btn);
+    imageView.setImageDrawable(backArrow);
+    imageView.setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View view) {
+        finish();
+        overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+      }
+    });
+
+//        Toolbar toolbar = findViewById(R.id.toolbar);
+//        setSupportActionBar(toolbar);
+//        toolbar.setTitle("");
+//        getSupportActionBar().setTitle("");
+//        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+//        getSupportActionBar().setDisplayShowHomeEnabled(true);
+  }
+
+  private void setupWindowAnimations() {
+    this.overridePendingTransition(R.anim.animation_enter,
+            R.anim.animation_leave);
+  }
+
+  @Override
+  public boolean onOptionsItemSelected(MenuItem item) {
+    if (item.getItemId() == android.R.id.home) {
+      startActivity(new Intent(getBaseContext(), LoginActivity.class));
+      finish();
+    }
+    return super.onOptionsItemSelected(item);
+  }
+
+  @Override
+  public void onBackPressed() {
+    startActivity(new Intent(getBaseContext(), ForgotPasswordActivity.class));
+    finish();
+  }
+
+  private void attemptLogin() {
+    String nPassword = newPassword.getText().toString().trim();
+    String cPassword = confirmPassword.getText().toString().trim();
+    if (TextUtils.isEmpty(nPassword) && TextUtils.isEmpty(cPassword)) {
+      GlobalData.showToast(getBaseContext(), "Please fill in all necessary fields.", Toast.LENGTH_SHORT).show();
+    } else if (TextUtils.isEmpty(nPassword)) {
+      GlobalData.showToast(getBaseContext(), "Please enter the new password", Toast.LENGTH_SHORT).show();
+    } else if (TextUtils.isEmpty(cPassword)) {
+      GlobalData.showToast(getBaseContext(), "Please enter the confirm password", Toast.LENGTH_SHORT).show();
+    } else if (!nPassword.equals(cPassword)) {
+      GlobalData.showToast(getBaseContext(), "The entered passwords does not match", Toast.LENGTH_SHORT).show();
+    } else if (!Pattern.compile(PASSWORD_PATTERN).matcher(cPassword).matches()) {
+      GlobalData.showToast(getBaseContext(), "The password must have at least 8 characters, " +
+              " and its alphanumeric." +
+              "", Toast.LENGTH_LONG).show();
+    } else {
+      if (new UtilService().isNetworkAvailable(ResetPasswordActivity.this)) {
+        progressDialog = new TransparentProgressDialog(ResetPasswordActivity.this);
+        progressDialog.show();
+
+        try {
+          HashMap<String, String> map = new HashMap<>();
+          map.put("new_password", nPassword);
+          map.put("type", "change");
+          map.put("username", userName);
+          restService.changePassword(map).enqueue(new Callback<ErrorResponse>() {
+            @Override
+            public void onResponse(Call<ErrorResponse> call, Response<ErrorResponse> response) {
+
+              if (progressDialog != null && progressDialog.isShowing()) {
+                progressDialog.dismiss();
+              }
+
+              if (response.body() != null && response.body().getStatus() == 200) {
+
+                //  GlobalData.showToast(getBaseContext(), "Your password is created successfully", Toast.LENGTH_SHORT).show();
+                Intent i = new Intent(ResetPasswordActivity.this, LoginActivity.class);
+                startActivity(i);
+                finish();
+              } else if (response.body() != null) {
+                GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+              } else if (response.errorBody() != null) {
+                Gson gson = new Gson();
+                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+              }
+            }
+
+            @Override
+            public void onFailure(Call<ErrorResponse> call, Throwable t) {
+              if (progressDialog != null && progressDialog.isShowing()) {
+                progressDialog.dismiss();
+              }
+              GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+          });
+
+        } catch (Exception e) {
+          e.printStackTrace();
+        }
+      } else {
+        GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+      }
+    }
+  }
+
+
+  public void setupUI(View view) {
+    try {
+      if (!(view instanceof EditText)) {
+        view.setOnTouchListener(new View.OnTouchListener() {
+          @SuppressLint("ClickableViewAccessibility")
+          public boolean onTouch(View v, MotionEvent event) {
+            hideSoftKeyboard(ResetPasswordActivity.this);
+            return false;
+          }
+        });
+      }
+
+      if (view instanceof ViewGroup) {
+        for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+          View innerView = ((ViewGroup) view).getChildAt(i);
+          setupUI(innerView);
+        }
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+
+}
+

+ 256 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ReviewActivity.java

@@ -0,0 +1,256 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ImageButton;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentStatePagerAdapter;
+import androidx.viewpager.widget.ViewPager;
+
+import com.google.gson.Gson;
+import com.ogaclejapan.smarttablayout.SmartTabLayout;
+import com.cygnusa.hyperm.fragments.ReviewFragment;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.CustomViewPager;
+import com.cygnusa.hyperm.util.DepthPageTransformerNew;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.AssessmentList;
+import com.cygnusa.hyperm.wrappers.AssessmentScore;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.ReviewQuestion;
+import com.cygnusa.hyperm.wrappers.ReviewResponse;
+
+import java.util.ArrayList;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class ReviewActivity extends AppCompatActivity {
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    TextView title;
+    public static AssessmentList ASSESSMENT = new AssessmentList();
+    public static AssessmentScore ASSESSMENT_SCORE = new AssessmentScore();
+
+    ArrayList<ReviewQuestion> REVIEW_QUESTIONS = new ArrayList<>();
+    CustomViewPager viewPager;
+    SmartTabLayout indicatorTab;
+    ImageButton previous, next;
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_review);
+        setupWindowAnimations();
+        restService = ((MainApplication) getApplication()).getClient();
+        title = findViewById(R.id.title);
+        viewPager = findViewById(R.id.viewPager);
+        indicatorTab = findViewById(R.id.indicatorTab);
+        previous = findViewById(R.id.previous);
+        next = findViewById(R.id.next);
+        title.setText(ASSESSMENT.getAssessmentname());
+        title.setSelected(true);
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        viewPager.post(new Runnable() {
+            @Override
+            public void run() {
+                getReviewQuistion();
+            }
+        });
+
+        previous.setEnabled(false);
+        next.setEnabled(false);
+
+        viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            @Override
+            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+
+            }
+
+            @Override
+            public void onPageSelected(int position) {
+                if (position == 0) {
+                    previous.setEnabled(false);
+                    next.setEnabled(true);
+                } else if (position == REVIEW_QUESTIONS.size() - 1) {
+                    previous.setEnabled(true);
+                    next.setEnabled(false);
+                    ReviewFragment.submitButton.setVisibility(View.VISIBLE);
+                } else {
+                    previous.setEnabled(true);
+                    next.setEnabled(true);
+                }
+            }
+
+            @Override
+            public void onPageScrollStateChanged(int state) {
+
+            }
+        });
+
+        previous.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (viewPager.getCurrentItem() > 0) {
+                    viewPager.setCurrentItem(viewPager.getCurrentItem() - 1, true);
+                }
+            }
+        });
+
+        next.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (viewPager.getCurrentItem() < REVIEW_QUESTIONS.size() - 1) {
+                    viewPager.setCurrentItem(viewPager.getCurrentItem() + 1, true);
+                }
+            }
+        });
+
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            ReviewActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+
+    @Override
+    public void onBackPressed() {
+        finish();
+        ReviewActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void getReviewQuistion() {
+        if (new UtilService().isNetworkAvailable(ReviewActivity.this)) {
+            progressDialog = new TransparentProgressDialog(ReviewActivity.this);
+            progressDialog.show();
+
+            restService.getReviewQuistion(ASSESSMENT_SCORE.getResult_id()).enqueue(new Callback<ReviewResponse>() {
+                @Override
+                public void onResponse(Call<ReviewResponse> call, Response<ReviewResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        REVIEW_QUESTIONS = response.body().getData();
+                        setReviewQuistion();
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        }
+                    }
+                }
+
+                @Override
+                public void onFailure(Call<ReviewResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void setReviewQuistion() {
+        viewPager.setPageTransformer(true, new DepthPageTransformerNew());
+        viewPager.setAdapter(new ReviewQuistionAdapter(getSupportFragmentManager()));
+        indicatorTab.setViewPager(viewPager);
+        viewPager.setPagingEnabled(true);
+        if (REVIEW_QUESTIONS.size() > 0) {
+            previous.setEnabled(false);
+            next.setEnabled(true);
+            if (REVIEW_QUESTIONS.size() == 1) {
+                ReviewFragment.submitButton.setVisibility(View.VISIBLE);
+            }
+        }
+        viewPager.setOffscreenPageLimit(REVIEW_QUESTIONS.size());
+    }
+
+
+    public class ReviewQuistionAdapter extends FragmentStatePagerAdapter {
+
+        private ReviewQuistionAdapter(FragmentManager fm) {
+            super(fm);
+        }
+
+        @Override
+        public Fragment getItem(int position) {
+            ReviewFragment fragment = new ReviewFragment();
+            fragment.setReviewQuestion(getApplicationContext(), REVIEW_QUESTIONS.get(position));
+            fragment.setQuestionNo(String.valueOf((position + 1)));
+            return fragment;
+        }
+
+        @Override
+        public int getCount() {
+            return REVIEW_QUESTIONS.size();
+        }
+
+
+        @Override
+        public CharSequence getPageTitle(int position) {
+            return String.valueOf((position + 1));
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+}

ファイルの差分が大きいため隠しています
+ 1407 - 0
Android/app/src/main/java/com/cygnusa/hyperm/SEHomeActivity.java


+ 36 - 0
Android/app/src/main/java/com/cygnusa/hyperm/SendQuestionsModel.java

@@ -0,0 +1,36 @@
+package com.cygnusa.hyperm;
+
+import java.util.List;
+
+public class SendQuestionsModel {
+
+    private String qid;
+    private String aqid;
+    private List<String> options = null;
+    private final static long serialVersionUID = -8913103511927611128L;
+
+    public String getQid() {
+        return qid;
+    }
+
+    public void setQid(String qid) {
+        this.qid = qid;
+    }
+
+    public String getAqid() {
+        return aqid;
+    }
+
+    public void setAqid(String aqid) {
+        this.aqid = aqid;
+    }
+
+    public List<String> getOptions() {
+        return options;
+    }
+
+    public void setOptions(List<String> options) {
+        this.options = options;
+    }
+
+}

+ 239 - 0
Android/app/src/main/java/com/cygnusa/hyperm/SetNewPasswordActivity.java

@@ -0,0 +1,239 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import android.text.TextUtils;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+
+import java.util.HashMap;
+import java.util.regex.Pattern;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class SetNewPasswordActivity extends AppCompatActivity {
+    EditText newPassword, confirmPassword;
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    // String PASSWORD_PATTERN = "((?=.*[a-zA-Z0-9]).{8,32})";
+    String PASSWORD_PATTERN = "((?=.*\\d)(?=.*[a-z,A-Z]).{8,30})";
+    AlertDialog.Builder alertDialogBuilder;
+    AlertDialog alertDialog;
+    String userName;
+    public  static String accessToken;
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    activity.getCurrentFocus().getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_set_password);
+        GlobalData.openDatabase(SetNewPasswordActivity.this);
+        setupWindowAnimations();
+        setupUI(findViewById(R.id.bgLayout));
+        Bundle extras = getIntent().getExtras();
+        if (extras != null) {
+            userName = extras.getString("username");
+
+        }
+
+        restService = ((MainApplication) getApplication()).getClient();
+        newPassword = findViewById(R.id.newPassword);
+        confirmPassword = findViewById(R.id.confirmPassword);
+
+
+        findViewById(R.id.continueButton).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                attemptLogin();
+            }
+        });
+
+//        Toolbar toolbar = findViewById(R.id.toolbar);
+//        setSupportActionBar(toolbar);
+//        toolbar.setTitle("");
+//        getSupportActionBar().setTitle("");
+//        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+//        getSupportActionBar().setDisplayShowHomeEnabled(true);
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            startActivity(new Intent(getBaseContext(), LoginActivity.class));
+            finish();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        startActivity(new Intent(getBaseContext(), SignUpActivity.class));
+        finish();
+    }
+
+    private void attemptLogin() {
+        String nPassword = newPassword.getText().toString().trim();
+        String cPassword = confirmPassword.getText().toString().trim();
+        if (TextUtils.isEmpty(nPassword) && TextUtils.isEmpty(cPassword)) {
+            GlobalData.showToast(getBaseContext(), "Please fill in all necessary fields.", Toast.LENGTH_SHORT).show();
+        } else if (TextUtils.isEmpty(nPassword)) {
+            GlobalData.showToast(getBaseContext(), "Please enter the new password", Toast.LENGTH_SHORT).show();
+        } else if (TextUtils.isEmpty(cPassword)) {
+            GlobalData.showToast(getBaseContext(), "Please enter the confirm password", Toast.LENGTH_SHORT).show();
+        } else if (!nPassword.equals(cPassword)) {
+            GlobalData.showToast(getBaseContext(), "The entered passwords does not match", Toast.LENGTH_SHORT).show();
+        } else if (!Pattern.compile(PASSWORD_PATTERN).matcher(cPassword).matches()) {
+            GlobalData.showToast(getBaseContext(), "The password must have at least 8 characters, " +
+                    " and its alphanumeric." +
+                    "", Toast.LENGTH_LONG).show();
+        } else {
+            if (new UtilService().isNetworkAvailable(SetNewPasswordActivity.this)) {
+                progressDialog = new TransparentProgressDialog(SetNewPasswordActivity.this);
+                progressDialog.show();
+
+                try {
+                    HashMap<String, String> map = new HashMap<>();
+                    map.put("new_password", nPassword);
+                    map.put("type", "register");
+                    map.put("username", userName);
+                    restService.changePassword(map).enqueue(new Callback<ErrorResponse>() {
+                        @Override
+                        public void onResponse(Call<ErrorResponse> call, Response<ErrorResponse> response) {
+
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+
+                            if (response.body() != null && response.body().getStatus() == 200) {
+                                ((MainApplication) getApplication()).addAccessToken(String.format("Bearer %s", response.body().getAccess_token()));
+                                accessToken=response.body().getAccess_token();
+                                restService = ((MainApplication) getApplication()).getClient();
+                                //  GlobalData.showToast(getBaseContext(), "Your password is created successfully", Toast.LENGTH_SHORT).show();
+                                showInstructions();
+                            } else if (response.body() != null) {
+                                GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                            } else if (response.errorBody() != null) {
+                                Gson gson = new Gson();
+                                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            }
+                        }
+
+                        @Override
+                        public void onFailure(Call<ErrorResponse> call, Throwable t) {
+                            if (progressDialog != null && progressDialog.isShowing()) {
+                                progressDialog.dismiss();
+                            }
+
+                            GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                        }
+                    });
+
+                } catch (Exception e) {
+
+                    e.printStackTrace();
+                }
+            } else {
+                GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+            }
+        }
+    }
+
+    private void showInstructions() {
+        View view = LayoutInflater.from(SetNewPasswordActivity.this).inflate(
+                R.layout.signup_instruction_popup, null);
+        TextView textHead = (TextView) view.findViewById(R.id.textHead);
+        TextView text1 = (TextView) view.findViewById(R.id.text1);
+        TextView text2 = (TextView) view.findViewById(R.id.text2);
+        TextView text3 = (TextView) view.findViewById(R.id.text3);
+        TextView text4 = (TextView) view.findViewById(R.id.text4);
+        text2.setVisibility(View.INVISIBLE);
+        text3.setVisibility(View.INVISIBLE);
+        text4.setVisibility(View.INVISIBLE);
+        textHead.setText("Fill in the mandatory fields");
+        text1.setText("You are one step closer to complete the registration");
+        text1.setGravity(Gravity.CENTER);
+        view.findViewById(R.id.btn_ok).setOnClickListener(
+                new View.OnClickListener() {
+
+                    @Override
+                    public void onClick(View v) {
+                        alertDialog.dismiss();
+                        startActivity(new Intent(getBaseContext(), MainProfileActivity.class));
+                        finish();
+                    }
+                });
+
+        alertDialogBuilder = new AlertDialog.Builder(SetNewPasswordActivity.this);
+        alertDialogBuilder.setCancelable(false);
+        alertDialogBuilder.setView(view);
+        alertDialog = alertDialogBuilder.create();
+        alertDialog.show();
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(SetNewPasswordActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}
+

+ 300 - 0
Android/app/src/main/java/com/cygnusa/hyperm/SettingsActivity.java

@@ -0,0 +1,300 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.NotificationManager;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.media.AudioManager;
+import android.media.MediaPlayer;
+import android.media.RingtoneManager;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import androidx.core.app.NotificationCompat;
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.Switch;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.LanguageResponse;
+import com.cygnusa.hyperm.wrappers.Languages;
+
+import java.util.ArrayList;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class SettingsActivity extends AppCompatActivity {
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    TextView mTextLanguageSelection;
+    ImageView mImageLangSelection;
+    private AlertDialog.Builder builder;
+    SharedPreferences preferences;
+    SharedPreferences.Editor editor;
+    ArrayList<Languages> MY_CONTENTS = new ArrayList<>();
+    ArrayList<String> LanguageList = new ArrayList<>();
+    ArrayList<String> LanguageCode = new ArrayList<>();
+    String language;
+    LinearLayout layoutLanguage;
+    String userType;
+    Switch notificationSound,notificationVibrate;
+    boolean vibrate,sound;
+    private NotificationManager notificationManager;
+    private NotificationCompat.Builder notificationBuilder;
+
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_settings);
+        setupWindowAnimations();
+        Bundle extras = getIntent().getExtras();
+        if (extras != null) {
+            userType = extras.getString("usertype");
+        }
+        restService = ((MainApplication) getApplication()).getClient();
+        mTextLanguageSelection = findViewById(R.id.textLanguage);
+        mImageLangSelection = findViewById(R.id.imgLanguage);
+        layoutLanguage = findViewById(R.id.layout);
+        language = this.getSharedPreferences("LANGUAGE", Context.MODE_PRIVATE).getString("DEFAULT", "en_us");
+        if (userType.equalsIgnoreCase("am")) {
+            layoutLanguage.setVisibility(View.GONE);
+        }
+        mTextLanguageSelection.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                showLanguageSelectionList();
+            }
+        });
+        mImageLangSelection.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                mTextLanguageSelection.performClick();
+            }
+        });
+        getLanguageContents();
+
+        preferences = getApplicationContext().getSharedPreferences("MySettings", 0); // 0 - for private mode
+        editor = preferences.edit();
+
+        notificationSound = (Switch) findViewById(R.id.notificationSoundSwitch);
+        notificationSound.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                // TODO Auto-generated method stub
+                if (buttonView.isChecked()){
+                    editor.putBoolean("sound", true);
+                    editor.commit();
+                }
+                else{
+                    editor.putBoolean("sound", false);
+                    editor.commit();
+                }
+            }
+        });
+        notificationVibrate = (Switch) findViewById(R.id.notificationVibrateSwitch);
+        notificationVibrate.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                // TODO Auto-generated method stub
+                if (buttonView.isChecked()){
+                    editor.putBoolean("vibrate", true);
+                    editor.commit();
+                }
+                else{
+                    editor.putBoolean("vibrate", false);
+                    editor.commit();
+                }
+            }
+        });
+        preferences = getSharedPreferences("MySettings",
+                Context.MODE_PRIVATE);
+        if(preferences.getBoolean("vibrate",true)){
+            notificationVibrate.setChecked(true);
+        }else {
+            notificationVibrate.setChecked(false);
+        }
+
+        if(preferences.getBoolean("sound",true)){
+            notificationSound.setChecked(true);
+        }else {
+            notificationSound.setChecked(false);
+        }
+
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+    }
+
+    private void getLanguageContents() {
+        if (new UtilService().isNetworkAvailable(SettingsActivity.this)) {
+
+            progressDialog = new TransparentProgressDialog(SettingsActivity.this);
+            progressDialog.show();
+
+
+            restService.getLanguage().enqueue(new Callback<LanguageResponse>() {
+                @Override
+                public void onResponse(Call<LanguageResponse> call, Response<LanguageResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+
+
+                        MY_CONTENTS = response.body().getData();
+                        setLanguageList();
+                        for (int i = 0; i < LanguageCode.size(); i++) {
+                            if (LanguageCode.get(i).equalsIgnoreCase(language)) {
+                                mTextLanguageSelection.setText(LanguageList.get(i).trim());
+                            }
+                        }
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        }
+                    }
+
+                    new Handler().postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            if (getPreferences(MODE_PRIVATE).getBoolean("ContentListActivity", true)) {
+                                // showHelpScreen();
+                                getPreferences(MODE_PRIVATE).edit().putBoolean("ContentListActivity", false).apply();
+                            }
+                        }
+                    }, 1000);
+                }
+
+                @Override
+                public void onFailure(Call<LanguageResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    private void setLanguageList() {
+        LanguageList.clear();
+        LanguageCode.clear();
+        for (int i = 0; i < MY_CONTENTS.size(); i++) {
+            LanguageList.add(MY_CONTENTS.get(i).getLanguage_title());
+            LanguageCode.add(MY_CONTENTS.get(i).getLanguage_code());
+        }
+    }
+
+    private static NotificationCompat.Builder buildNotificationCommon(Context _context) {
+        NotificationCompat.Builder builder = new NotificationCompat.Builder(_context)
+                .setWhen(System.currentTimeMillis());
+        //Vibration
+        builder.setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 });
+
+        //LED
+        builder.setLights(Color.RED, 3000, 3000);
+
+        //Ton
+      //  builder.setSound(Uri.parse("uri://sadfasdfasdf.mp3"));
+
+        return builder;
+    }
+    private void beep(int volume)
+    {
+        AudioManager manager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
+        manager.setStreamVolume(AudioManager.STREAM_MUSIC, volume, 0);
+        Uri notification = RingtoneManager
+                .getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
+        MediaPlayer player = MediaPlayer.create(getApplicationContext(), notification);
+        player.start();
+    }
+    private void showLanguageSelectionList() {
+
+        builder = new AlertDialog.Builder(SettingsActivity.this);
+        builder.setTitle("SELECT LANGUAGE")
+                .setItems(LanguageList.toArray(new String[LanguageList.size()]), new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialogInterface, int i) {
+                        preferences = getSharedPreferences("LANGUAGE",
+                                Context.MODE_PRIVATE);
+                        editor = preferences.edit();
+                        editor.putString("DEFAULT", LanguageCode.get(i));
+                        mTextLanguageSelection.setText(LanguageList.get(i));
+                        editor.apply();
+                        dialogInterface.dismiss();
+                    }
+                });
+
+        builder.create().show();
+
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        finish();
+        overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+}
+

+ 131 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ShowQrCodeClass.java

@@ -0,0 +1,131 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.MenuItem;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.QrCodeResponse;
+
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class ShowQrCodeClass extends AppCompatActivity {
+
+    TextView txtTrainingDate, txtTrainingTitle, txtTrainingDuration;
+    ImageView imgScan;
+    private ApiService apiService;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_show_qr_code);
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        initViews();
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            onBackPressed();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void initViews() {
+        txtTrainingDate = findViewById(R.id.txtTrainingDate);
+        txtTrainingTitle = findViewById(R.id.txtTrainingTitle);
+        txtTrainingDuration = findViewById(R.id.txtTrainingDuration);
+        apiService = ((MainApplication) getApplication()).getClient();
+        imgScan = findViewById(R.id.imgQR);
+
+        getQrCodeData();
+
+        //GlobalData.mSingleDataLists.getScheduleId()
+    }
+
+    private void getQrCodeData() {
+        apiService.getQrCodeImage(GlobalData.user.getData().getSmpin()).enqueue(new Callback<QrCodeResponse>() {
+            @Override
+            public void onResponse(Call<QrCodeResponse> call, Response<QrCodeResponse> response) {
+                if (response.body() != null) {
+                    if (response.body().getMessage().equalsIgnoreCase("Success")) {
+                        if (response.body().getData() != null) {
+                            Glide.with(ShowQrCodeClass.this).load(response.body().getData().getLink())
+                                    .thumbnail(Glide.with(ShowQrCodeClass.this).load(R.drawable.placeholder))
+                                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                                            .placeholder(R.drawable.placeholder)).into(imgScan);
+
+                            txtTrainingDate.setText(response.body().getData().getStartDate());
+                            txtTrainingTitle.setText(response.body().getData().getTitle());
+                            txtTrainingDuration.setText(String.valueOf(response.body().getData().getDuration()));
+                        }
+                    } else {
+                        GlobalData.toast(ShowQrCodeClass.this, response.body().getResponseText());
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<QrCodeResponse> call, Throwable t) {
+                if (t.getMessage() != null) {
+                    Log.e("Tmeaasge", t.getMessage());
+                }
+            }
+        });
+    }
+}
+
+

+ 586 - 0
Android/app/src/main/java/com/cygnusa/hyperm/SignUpActivity.java

@@ -0,0 +1,586 @@
+package com.cygnusa.hyperm;
+
+import android.Manifest;
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.os.Build;
+import android.os.Bundle;
+
+import androidx.core.app.ActivityCompat;
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import android.text.SpannableString;
+import android.text.TextUtils;
+import android.text.style.UnderlineSpan;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.pinview.PinView;
+import com.cygnusa.hyperm.tooltip.Tooltip;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.OtpResponse;
+import com.cygnusa.hyperm.wrappers.SignupResponse;
+import com.cygnusa.hyperm.wrappers.UserResponse;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class SignUpActivity extends AppCompatActivity {
+  public OtpResponse errorResponse = new OtpResponse();
+  public SignupResponse signup = new SignupResponse();
+  public UserResponse user = new UserResponse();
+  public int counter;
+  ApiService restService;
+  TransparentProgressDialog progressDialog;
+  AlertDialog.Builder alertDialogBuilder;
+  AlertDialog alertDialog;
+  PinView pinview;
+  private EditText mEditUserName;
+
+  public static void hideSoftKeyboard(Activity activity) {
+    try {
+      InputMethodManager inputMethodManager =
+              (InputMethodManager) activity.getSystemService(
+                      Activity.INPUT_METHOD_SERVICE);
+      inputMethodManager.hideSoftInputFromWindow(
+              activity.getCurrentFocus().getWindowToken(), 0);
+
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+
+
+  @Override
+  protected void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+    setContentView(R.layout.acitivity_signup);
+    setupWindowAnimations();
+    setupUI(findViewById(R.id.bgLayout));
+    restService = ((MainApplication) getApplication()).getClient();
+    mEditUserName = findViewById(R.id.username_signup);
+    findViewById(R.id.sign_up_button).setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View view) {
+        signUp();
+      }
+    });
+    TextView textView = (TextView) findViewById(R.id.alreadyRegistered);
+    SpannableString content = new SpannableString("Login");
+    content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
+    textView.setText(content);
+
+    findViewById(R.id.alreadyRegistered).setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View view) {
+        finish();
+        overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+      }
+    });
+
+    findViewById(R.id.info).setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View view) {
+        String header = "If you are dealer staff enter the SMPIN for registering and logging into the system\n" +
+                "\nIf you are HYPER-M staff enter your Employee ID for registering and logging into the system";
+        View mView = LayoutInflater.from(SignUpActivity.this).inflate(R.layout.login_tooltip_text, null);
+        TextView text = mView.findViewById(R.id.text11);
+        text.setText(header);
+        Tooltip.TooltipView tooltip = Tooltip.make(SignUpActivity.this,
+                new Tooltip.Builder(101)
+                        .anchor(view, Tooltip.Gravity.TOP)
+                        .closePolicy(new Tooltip.ClosePolicy()
+                                .insidePolicy(true, false)
+                                .outsidePolicy(true, false), 0)
+                        .activateDelay(800)
+                        .withStyleId(R.style.ToolTipLayoutCustomStyle)
+                        .showDelay(300)
+                        .text("")
+                        .setBgColor(getResources().getColor(R.color.bg_color))
+                        .view(mView)
+                        .maxWidth(300)
+                        .withArrow(true)
+                        .build()
+        );
+        tooltip.setTextColor(Color.YELLOW);
+        tooltip.show();
+      }
+    });
+
+    checkPermission();
+
+  }
+  private void checkPermission() {
+    if (Build.VERSION.SDK_INT >= 23) {
+      ArrayList<String> listPermissionsNeeded = new ArrayList<>();
+      if (checkSelfPermission(Manifest.permission.READ_SMS) == PackageManager.PERMISSION_DENIED) {
+        listPermissionsNeeded
+                .add(android.Manifest.permission.READ_SMS);
+        listPermissionsNeeded
+                .add(android.Manifest.permission.READ_SMS);
+      }
+
+      if (!listPermissionsNeeded.isEmpty())
+        ActivityCompat.requestPermissions(this, listPermissionsNeeded
+                .toArray(new String[listPermissionsNeeded.size()]), 1);
+
+    }
+  }
+
+  private void signUp() {
+    String userName = mEditUserName.getText().toString().trim();
+    boolean cancel = false;
+    View focusView = null;
+    if (TextUtils.isEmpty(userName)) {
+      GlobalData.showToast(getBaseContext(), "Please enter the SMPIN/Employee ID", Toast.LENGTH_SHORT).show();
+      focusView = mEditUserName;
+      cancel = true;
+    }
+
+    if (cancel) {
+      focusView.requestFocus();
+    } else {
+      if (new UtilService().isNetworkAvailable(SignUpActivity.this)) {
+        progressDialog = new TransparentProgressDialog(SignUpActivity.this);
+        progressDialog.show();
+
+        try {
+          HashMap<String, String> map = new HashMap<>();
+          map.put("username", userName);
+
+          restService.SignUp(map).enqueue(new Callback<SignupResponse>() {
+            @Override
+            public void onResponse(Call<SignupResponse> call, Response<SignupResponse> response) {
+              signup = response.body();
+              if (progressDialog != null && progressDialog.isShowing()) {
+                progressDialog.dismiss();
+              }
+              if (signup != null && signup.getStatus() == 200) {
+                showPopup(signup.getData().getMobile());
+              } else if (signup != null) {
+                GlobalData.showToast(getBaseContext(), signup.getMessage(), Toast.LENGTH_SHORT).show();
+              } else if (response.errorBody() != null) {
+                Gson gson = new Gson();
+                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+              }
+            }
+
+            @Override
+            public void onFailure(Call<SignupResponse> call, Throwable t) {
+              if (progressDialog != null && progressDialog.isShowing()) {
+                progressDialog.dismiss();
+              }
+              GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+          });
+
+        } catch (Exception e) {
+          e.printStackTrace();
+        }
+      } else {
+        GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+      }
+    }
+  }
+
+  public void sentOtp() {
+    if (new UtilService().isNetworkAvailable(SignUpActivity.this)) {
+      progressDialog = new TransparentProgressDialog(SignUpActivity.this);
+      progressDialog.show();
+
+      try {
+        HashMap<String, String> map = new HashMap<>();
+        map.put("username", signup.getData().getUsername());
+        map.put("device_type","android");
+        restService.sentOtp(map).enqueue(new Callback<OtpResponse>() {
+          @Override
+          public void onResponse(Call<OtpResponse> call, Response<OtpResponse> response) {
+            errorResponse = response.body();
+
+            if (progressDialog != null && progressDialog.isShowing()) {
+              progressDialog.dismiss();
+            }
+            if (errorResponse != null && errorResponse.getStatus() == 200) {
+              showOtpPopUp(signup.getData().getMobile(), errorResponse.getData().getOtp_expiry());
+            } else if (errorResponse != null) {
+              GlobalData.showToast(getBaseContext(), errorResponse.getMessage(), Toast.LENGTH_SHORT).show();
+            } else if (response.errorBody() != null) {
+              Gson gson = new Gson();
+              ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+              GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+            }
+          }
+
+          @Override
+          public void onFailure(Call<OtpResponse> call, Throwable t) {
+            if (progressDialog != null && progressDialog.isShowing()) {
+              progressDialog.dismiss();
+            }
+
+            GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+          }
+        });
+
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
+    } else {
+      GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+    }
+  }
+
+  public void reSentOtp() {
+    if (new UtilService().isNetworkAvailable(SignUpActivity.this)) {
+      progressDialog = new TransparentProgressDialog(SignUpActivity.this);
+      progressDialog.show();
+      try {
+        HashMap<String, String> map = new HashMap<>();
+        map.put("username", signup.getData().getUsername());
+
+        restService.sentOtp(map).enqueue(new Callback<OtpResponse>() {
+          @Override
+          public void onResponse(Call<OtpResponse> call, Response<OtpResponse> response) {
+            errorResponse = response.body();
+            if (progressDialog != null && progressDialog.isShowing()) {
+              progressDialog.dismiss();
+            }
+            if (errorResponse != null && errorResponse.getStatus() == 200) {
+              showOtpPopUp(signup.getData().getMobile(), errorResponse.getData().getOtp_expiry());
+            } else if (errorResponse != null) {
+              GlobalData.showToast(getBaseContext(), errorResponse.getMessage(), Toast.LENGTH_SHORT).show();
+            } else if (response.errorBody() != null) {
+              Gson gson = new Gson();
+              ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+              GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+            }
+
+
+          }
+
+          @Override
+          public void onFailure(Call<OtpResponse> call, Throwable t) {
+            if (progressDialog != null && progressDialog.isShowing()) {
+              progressDialog.dismiss();
+            }
+            GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+          }
+        });
+
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
+    } else {
+      GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+    }
+
+  }
+
+
+  private void showPopup(final String mobileNo) {
+
+    if (mobileNo == null || mobileNo.trim().isEmpty()) {
+      GlobalData.showToast(getBaseContext(), "Invalid Mobile Number", Toast.LENGTH_SHORT).show();
+      return;
+    }
+
+
+    View view = LayoutInflater.from(SignUpActivity.this).inflate(
+            R.layout.signup_alert_window, null);
+
+
+    view.findViewById(R.id.btn_yes).setOnClickListener(
+            new View.OnClickListener() {
+
+              @Override
+              public void onClick(View v) {
+                alertDialog.dismiss();
+
+                sentOtp();
+              }
+            });
+    view.findViewById(R.id.btn_no).setOnClickListener(
+            new View.OnClickListener() {
+
+              @Override
+              public void onClick(View v) {
+                alertDialog.dismiss();
+                showInstructions();
+              }
+            });
+
+    String strLast3digit = mobileNo.substring(mobileNo.length() - 3);
+    String strFirst2digit = mobileNo.substring(0, 2);
+    TextView mobileNumTextView = view.findViewById(R.id.mobileNo);
+    String alterStr = new StringBuilder(mobileNo).replace(2, 7, "XXXXX").toString();
+    mobileNumTextView.setText(alterStr);
+
+
+    alertDialogBuilder = new AlertDialog.Builder(SignUpActivity.this);
+    alertDialogBuilder.setCancelable(false);
+    alertDialogBuilder.setView(view);
+    alertDialog = alertDialogBuilder.create();
+    alertDialog.show();
+  }
+
+  private void showInstructions() {
+    View view = LayoutInflater.from(SignUpActivity.this).inflate(
+            R.layout.signup_instruction_popup, null);
+
+    view.findViewById(R.id.btn_ok).setOnClickListener(
+            new View.OnClickListener() {
+
+              @Override
+              public void onClick(View v) {
+                alertDialog.dismiss();
+
+              }
+            });
+
+    alertDialogBuilder = new AlertDialog.Builder(SignUpActivity.this);
+    alertDialogBuilder.setCancelable(false);
+    alertDialogBuilder.setView(view);
+    alertDialog = alertDialogBuilder.create();
+    alertDialog.show();
+  }
+
+  private void showOtpPopUp(String mobileNo, String otpexpirytime) {
+    if (mobileNo == null || mobileNo.trim().isEmpty()) {
+      GlobalData.showToast(getBaseContext(), "Invalid Mobile Number", Toast.LENGTH_SHORT).show();
+      return;
+    }
+    View view = LayoutInflater.from(SignUpActivity.this).inflate(
+            R.layout.otp_popup, null);
+
+    pinview = (PinView) view.findViewById(R.id.pinView);
+
+
+    TextView mobileNumTextView = view.findViewById(R.id.mobileNo);
+    final TextView resentOtpTxt = view.findViewById(R.id.resentOtp);
+    resentOtpTxt.setEnabled(false);
+    resentOtpTxt.setAlpha(0.5f);
+
+    final TextView count_time = view.findViewById(R.id.count_time);
+    view.findViewById(R.id.btn_cancel).setOnClickListener(
+            new View.OnClickListener() {
+              @Override
+              public void onClick(View v) {
+                alertDialog.dismiss();
+              }
+            });
+    resentOtpTxt.setOnClickListener(
+            new View.OnClickListener() {
+              @Override
+              public void onClick(View v) {
+                alertDialog.dismiss();
+                reSentOtp();
+              }
+            });
+    view.findViewById(R.id.btn_submit).setOnClickListener(
+            new View.OnClickListener() {
+              @Override
+              public void onClick(View v) {
+                if (pinview.getText().toString().equalsIgnoreCase("")) {
+                  GlobalData.showToast(getBaseContext(), "Please enter Valid OTP", Toast.LENGTH_SHORT).show();
+                  return;
+                }
+                otpValidation(pinview.getText().toString());
+
+              }
+            });
+
+    int millsec = Integer.parseInt(otpexpirytime) * 60 * 1000;
+    new android.os.CountDownTimer(millsec, 1000) {
+      public void onTick(long millisUntilFinished) {
+
+        String formattedTime = String.format("%02d:%02d Sec",
+                TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % TimeUnit.HOURS.toMinutes(1),
+                TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % TimeUnit.MINUTES.toSeconds(1));
+        count_time.setText(formattedTime);
+        counter++;
+      }
+
+      public void onFinish() {
+        count_time.setText("00:00");
+        resentOtpTxt.setEnabled(true);
+        resentOtpTxt.setAlpha(1f);
+      }
+    }.start();
+
+    Paint p = new Paint();
+    p.setColor(getResources().getColor(R.color.btn_bg_color));
+    resentOtpTxt.setPaintFlags(resentOtpTxt.getPaintFlags() | p.UNDERLINE_TEXT_FLAG);
+    String alterStr = new StringBuilder(mobileNo).replace(2, 7, "XXXXX").toString();
+    mobileNumTextView.setText(alterStr);
+    alertDialogBuilder = new AlertDialog.Builder(SignUpActivity.this);
+    alertDialogBuilder.setCancelable(false);
+    alertDialogBuilder.setView(view);
+    alertDialog = alertDialogBuilder.create();
+    alertDialog.show();
+    setupUI(alertDialog.getWindow().getDecorView());
+    view.setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View view) {
+        try {
+          InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+          imm.hideSoftInputFromWindow(pinview.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
+        } catch (Exception e) {
+          e.printStackTrace();
+        }
+
+
+      }
+    });
+  }
+
+  private void otpValidation(String otp) {
+
+    boolean cancel = false;
+    View focusView = null;
+    if (pinview.getText().toString().length() < 4) {
+      GlobalData.showToast(getBaseContext(), "please enter 4 digits", Toast.LENGTH_SHORT).show();
+      focusView = pinview;
+      cancel = true;
+    }
+    if (cancel) {
+      focusView.requestFocus();
+    } else {
+      if (new UtilService().isNetworkAvailable(SignUpActivity.this)) {
+        progressDialog = new TransparentProgressDialog(SignUpActivity.this);
+        progressDialog.show();
+        try {
+          HashMap<String, String> map = new HashMap<>();
+          map.put("otp", otp);
+          map.put("type", "register");
+          map.put("username", signup.getData().getUsername());
+
+          restService.OtpValidation(map).enqueue(new Callback<UserResponse>() {
+            @Override
+            public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+              user = response.body();
+              if (progressDialog != null && progressDialog.isShowing()) {
+                progressDialog.dismiss();
+              }
+
+              if (user != null && user.getStatus() == 200) {
+                getSharedPreferences("FCM_TOKEN", Context.MODE_PRIVATE)
+                        .edit().putString("FCM_TOKEN_ID", "").apply();
+                if (Build.VERSION.SDK_INT >= 23) {
+                  if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
+                          == PackageManager.PERMISSION_GRANTED) {
+                    File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                            + "/" + ".HYPERM", "PDF");
+                    if (f1.exists()) {
+                      f1.delete();
+                    }
+                  }
+                }else {
+                  File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                          + "/" + ".HYPERM", "PDF");
+                  if (f1.exists()) {
+                    f1.delete();
+                  }
+                }
+                ((MainApplication) getApplication()).addAccessToken(String.format("Bearer %s", user.getAccess_token().trim()));
+                restService = ((MainApplication) getApplication()).getClient();
+                Intent i = new Intent(SignUpActivity.this, SetNewPasswordActivity.class);
+                i.putExtra("username", signup.getData().getUsername());
+                startActivity(i);
+                finish();
+
+              } else if (user != null) {
+                GlobalData.showToast(getBaseContext(), user.getMessage(), Toast.LENGTH_SHORT).show();
+
+              } else if (response.errorBody() != null) {
+                Gson gson = new Gson();
+                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+
+              }
+
+
+            }
+
+            @Override
+            public void onFailure(Call<UserResponse> call, Throwable t) {
+              if (progressDialog != null && progressDialog.isShowing()) {
+                progressDialog.dismiss();
+              }
+              GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+          });
+
+        } catch (Exception e) {
+          e.printStackTrace();
+        }
+      } else {
+        GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+      }
+    }
+
+  }
+
+
+  @Override
+  public void onBackPressed() {
+    super.onBackPressed();
+    this.overridePendingTransition(R.anim.animation_f_enter,
+            R.anim.animation_f_leave);
+  }
+
+  private void setupWindowAnimations() {
+    this.overridePendingTransition(R.anim.animation_enter,
+            R.anim.animation_leave);
+  }
+
+  public void setupUI(View view) {
+    try {
+      if (!(view instanceof EditText)) {
+        view.setOnTouchListener(new View.OnTouchListener() {
+          @SuppressLint("ClickableViewAccessibility")
+          public boolean onTouch(View v, MotionEvent event) {
+            hideSoftKeyboard(SignUpActivity.this);
+            return false;
+          }
+        });
+      }
+
+      if (view instanceof ViewGroup) {
+        for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+          View innerView = ((ViewGroup) view).getChildAt(i);
+          setupUI(innerView);
+        }
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+
+}

+ 252 - 0
Android/app/src/main/java/com/cygnusa/hyperm/SplashScreen.java

@@ -0,0 +1,252 @@
+package com.cygnusa.hyperm;
+
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.os.Bundle;
+import android.os.Handler;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.UserResponse;
+
+import java.io.File;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class SplashScreen extends AppCompatActivity {
+
+    Handler handler = new Handler();
+    TransparentProgressDialog progressDialog;
+    ApiService restService;
+    boolean canGoNotification = false;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_splash_screen);
+        ImageView splashLogo = findViewById(R.id.splashLogo);
+        setupWindowAnimations();
+
+        Glide.with(this).load(R.drawable.hyperm_logo).transition(DrawableTransitionOptions.withCrossFade()).into(splashLogo);
+
+        if (getIntent().getExtras() != null) {
+            canGoNotification = getIntent().getBooleanExtra("canGoNotification", false);
+            if (!canGoNotification) {
+                canGoNotification = !getIntent().getExtras().getString("message", "").isEmpty();
+            }
+        }
+
+        restService = ((MainApplication) getApplication()).getClient();
+        GlobalData.openDatabase(SplashScreen.this);
+
+        Cursor cursor = GlobalData.sdb.rawQuery("select * from session", null);
+        if (cursor.getCount() == 0) {
+            GlobalData.user = null;
+            handler.postDelayed(new Runnable() {
+
+                @Override
+                public void run() {
+                    goLogin();
+                }
+            }, 5000);
+        } else {
+            cursor.moveToFirst();
+            Gson gson = new Gson();
+            GlobalData.user = gson.fromJson(
+                    cursor.getString(cursor.getColumnIndex("user")),
+                    new TypeToken<UserResponse>() {
+                    }.getType());
+            try {
+                ((MainApplication) getApplication()).addAccessToken(String.format("Bearer %s", GlobalData.user.getAccess_token().trim()));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            restService = ((MainApplication) getApplication()).getClient();
+            checkToken();
+        }
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        try {
+            handler.removeCallbacksAndMessages(null);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void checkToken() {
+        if (new UtilService().isNetworkAvailable(SplashScreen.this)) {
+            progressDialog = new TransparentProgressDialog(SplashScreen.this);
+            progressDialog.show();
+
+            try {
+                restService.getProfile().enqueue(new Callback<UserResponse>() {
+                    @Override
+                    public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            if (response.body().getData() != null
+                                    && response.body().getData().getIs_password_expired().trim().equalsIgnoreCase("1")) {
+                                GlobalData.showToast(SplashScreen.this, "Your password is expired, please create new password", Toast.LENGTH_SHORT).show();
+                                startActivity(new Intent(getBaseContext(), SetNewPasswordActivity.class));
+                                finish();
+                            } else {
+                                if (GlobalData.user.getData().getIs_profile_updated().equalsIgnoreCase("0")) {
+                                    goProfile();
+                                } else {
+                                    goHome();
+                                }
+                            }
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            goLogin();
+                        } else {
+                            goLogin();
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<UserResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                goLogin();
+            }
+        } else {
+            handler.postDelayed(new Runnable() {
+
+                @Override
+                public void run() {
+                    if (GlobalData.user == null || GlobalData.user.getData().getIs_profile_updated().equalsIgnoreCase("0")) {
+
+                        goLogin();
+                    } else {
+                        if (GlobalData.user.getData().getIs_profile_updated().equalsIgnoreCase("0")) {
+                            goProfile();
+                        } else {
+                            goHome();
+                        }
+
+                    }
+                }
+            }, 5000);
+        }
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    private void goLogin() {
+        getSharedPreferences("FCM_TOKEN", Context.MODE_PRIVATE)
+                .edit().putString("FCM_TOKEN_ID", "").apply();
+        GlobalData.sdb.delete("session", null, null);
+        GlobalData.sdb.delete("topic", null, null);
+
+
+        if (getPreferences(MODE_PRIVATE).getBoolean("IndroScreen", true)) {
+            getPreferences(MODE_PRIVATE).edit().putBoolean("IndroScreen", false).apply();
+            startActivity(new Intent(getBaseContext(), IndroScreen.class));
+            finish();
+        } else {
+            startActivity(new Intent(getBaseContext(), LoginActivity.class));
+            finish();
+        }
+    }
+
+    public void deleteLocalFiles() {
+        String fileName = Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                + "/" + ".HYPERM/VIDEO";
+        File dir = new File(fileName);
+
+        if (dir.isDirectory()) {
+            String[] children = dir.list();
+            for (String aChildren : children) {
+                new File(dir, aChildren).delete();
+            }
+        }
+        File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null) + "/" + ".HYPERM", "PDF");
+        if (f1.isDirectory()) {
+            String[] children = dir.list();
+            for (String aChildren : children) {
+                new File(dir, aChildren).delete();
+            }
+        }
+    }
+
+    private void goHome() {
+        GlobalData.canLogout = false;
+        Intent intent = null;
+        if (GlobalData.user.getData().getRole().equalsIgnoreCase("4")
+                || GlobalData.user.getData().getRole().equalsIgnoreCase("6")
+                || GlobalData.user.getData().getRole().equalsIgnoreCase("7")
+                || GlobalData.user.getData().getRole().equalsIgnoreCase("5")
+                || GlobalData.user.getData().getRole().equalsIgnoreCase("3")
+                || GlobalData.user.getData().getRole().equalsIgnoreCase("14")) {
+            intent = new Intent(getBaseContext(),
+                    AMHomeActivity.class);
+            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+            intent.putExtra("canGoNotification", canGoNotification);
+            startActivity(intent);
+            finish();
+
+        } else if (GlobalData.user.getData().getRole().equalsIgnoreCase("15")) {
+            intent = new Intent(getBaseContext(),
+                    SEHomeActivity.class);
+            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+            intent.putExtra("canGoNotification", canGoNotification);
+            startActivity(intent);
+            finish();
+        } else if (GlobalData.user.getData().getRole().equalsIgnoreCase("16")) {
+            GlobalData.showToast(getBaseContext(), "You don’t have required permission to log in to the STAR app", Toast.LENGTH_LONG).show();
+        } else {
+            intent = new Intent(getBaseContext(),
+                    HomeActivity.class);
+            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+            intent.putExtra("canGoNotification", canGoNotification);
+            startActivity(intent);
+            finish();
+        }
+    }
+
+    private void goProfile() {
+        Intent intent = new Intent(getBaseContext(),
+                MainProfileActivity.class);
+        startActivity(intent);
+        finish();
+    }
+}

+ 488 - 0
Android/app/src/main/java/com/cygnusa/hyperm/SurveyActivity.java

@@ -0,0 +1,488 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.DialogInterface;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.FrameLayout;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.adapter.SurveyQuestionAdapter;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.AnswerResponse;
+import com.cygnusa.hyperm.wrappers.AssessmentQuestion;
+import com.cygnusa.hyperm.wrappers.AssessmentQuestionResponse;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.HitCountModel;
+import com.cygnusa.hyperm.wrappers.Survey;
+import com.cygnusa.hyperm.wrappers.SurveyAnswer;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class SurveyActivity extends AppCompatActivity {
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    TextView title;
+    ListView surveyListView;
+
+    public static Survey ASSESSMENT = new Survey();
+    public static String TRAINING_ID = "";
+
+    ArrayList<AssessmentQuestion> ASSESSMENT_QUESTIONS = new ArrayList<>();
+    Button submitButton;
+    String START_TIME = "";
+    String END_TIME = "";
+    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    boolean isReview = false;
+    SurveyQuestionAdapter adapter;
+
+    String fromTime, toTime, finalTime;
+    Calendar c;
+    SimpleDateFormat df;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_survey);
+        setupWindowAnimations();
+        setupUI(findViewById(R.id.bgLayout));
+        restService = ((MainApplication) getApplication()).getClient();
+        title = findViewById(R.id.title);
+        submitButton = findViewById(R.id.submitButton);
+        isReview = ASSESSMENT.getStatus().trim().equalsIgnoreCase("3");
+        surveyListView = findViewById(R.id.surveyListView);
+
+        if (isReview) {
+            submitButton.setVisibility(View.GONE);
+            ((FrameLayout) submitButton.getParent()).setVisibility(View.GONE);
+        } else {
+            ((FrameLayout) submitButton.getParent()).setVisibility(View.VISIBLE);
+            submitButton.setVisibility(View.VISIBLE);
+        }
+
+        title.setText(ASSESSMENT.getAssessmentname());
+        title.setSelected(true);
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setNavigationIcon(R.mipmap.back);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        getCurrentTime();
+
+        surveyListView.post(new Runnable() {
+            @Override
+            public void run() {
+                if (isReview) {
+                    getSurveyReview();
+                } else {
+                    getSurveyQuestion();
+                }
+            }
+        });
+
+        submitButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getToTime();
+                onSubmitAnswer();
+            }
+        });
+    }
+
+    private void getCurrentTime() {
+        c = Calendar.getInstance();
+        System.out.println("fromTime " + c.getTime());
+
+        df = new SimpleDateFormat("HH:mm:ss");
+        fromTime = df.format(c.getTime());
+        Log.e("fromTime", fromTime);
+    }
+
+
+    private void confirmClose() {
+        new AlertDialog.Builder(SurveyActivity.this)
+                .setMessage("Are you sure you want to exit?")
+                .setPositiveButton("Yes",
+                        new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(
+                                    DialogInterface dialog,
+                                    int which) {
+                                getToTime();
+                                finish();
+                                SurveyActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                                        R.anim.animation_f_leave);
+                            }
+                        }).setNegativeButton("No", null).show();
+    }
+
+    private void getToTime() {
+
+        c = Calendar.getInstance();
+        System.out.println("toTime " + c.getTime());
+
+        df = new SimpleDateFormat("HH:mm:ss");
+        toTime = df.format(c.getTime());
+        Log.e("toTime", toTime);
+
+        finalTime = UtilService.getTimeInterval(this, df, fromTime, toTime);
+
+        if (StorePreference.getInstance(this).getBooleanValue(GlobalData.ISDSELOGIN))
+            sendHitCountToServer();
+
+    }
+
+
+    private void sendHitCountToServer() {
+        restService.sendAllHitCount(buildConfigData()).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+                    Log.e("responeHit", response.body().getMessage());
+                } else {
+                    Log.e("responeHit", response.body().getMessage());
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+                if (t.getMessage() != null) {
+                    Log.e("responeHit", t.getMessage());
+                }
+            }
+        });
+    }
+
+    private HitCountModel buildConfigData() {
+        HitCountModel hitCountModel = new HitCountModel();
+        hitCountModel.setPage("Feedback");
+//        hitCountModel.setAssettopicid(Integer.valueOf(ASSESSMENT.getAssessmentid()));
+//        hitCountModel.setCateid(Integer.parseInt(ASSESSMENT.getAssettypeid()));
+        hitCountModel.setViewtime("0");
+        return hitCountModel;
+    }
+
+
+    private void onSubmitAnswer() {
+        if (ASSESSMENT_QUESTIONS != null && ASSESSMENT_QUESTIONS.size() > 0) {
+            ArrayList<SurveyAnswer> answers = new ArrayList<>();
+            END_TIME = format.format(new Date());
+            for (AssessmentQuestion question : ASSESSMENT_QUESTIONS) {
+                SurveyAnswer answer = new SurveyAnswer();
+                answer.setAqid(question.getAqid());
+                answer.setQid(question.getQid());
+                if (question.getIs_mandatory().trim().equalsIgnoreCase("1")) {
+                    if (question.getQuestiontypeid() != null && question.getQuestiontypeid().trim().equalsIgnoreCase("5")) {
+                        if (!question.isSurveyOptionAnswered()) {
+                            GlobalData.showToast(SurveyActivity.this, "Please answer all mandatory questions", Toast.LENGTH_SHORT).show();
+                            return;
+                        }
+                    } else if (question.getQuestiontypeid() != null && question.getQuestiontypeid().trim().equalsIgnoreCase("6")) {
+                        if (!question.isSurveyOptionAnswered()) {
+                            GlobalData.showToast(SurveyActivity.this, "Please answer all mandatory questions", Toast.LENGTH_SHORT).show();
+                            return;
+                        }
+                    } else if (!question.isSurveyAnswered()) {
+                        GlobalData.showToast(SurveyActivity.this, "Please answer all mandatory questions", Toast.LENGTH_SHORT).show();
+                        return;
+                    }
+
+                    if (question.getQuestiontypeid() != null && question.getQuestiontypeid().trim().equalsIgnoreCase("3")) {
+                        answer.setSurvey_rating(question.getSurveyAnswer());
+                    } else if (question.getQuestiontypeid() != null && question.getQuestiontypeid().trim().equalsIgnoreCase("4")) {
+                        answer.setSurvey_text(question.getSurveyAnswer());
+                    } else if (question.getQuestiontypeid() != null && question.getQuestiontypeid().trim().equalsIgnoreCase("5")) {
+                        answer.setOptions(question.getSurveyOptionAnswer());
+                    } else if (question.getQuestiontypeid() != null && question.getQuestiontypeid().trim().equalsIgnoreCase("6")) {
+                        answer.setOptions(question.getSurveyOptionAnswer());
+                    }
+                } else {
+                    if (question.getQuestiontypeid() != null && question.getQuestiontypeid().trim().equalsIgnoreCase("3")) {
+                        answer.setSurvey_rating(question.getSurveyAnswer());
+                    } else if (question.getQuestiontypeid() != null && question.getQuestiontypeid().trim().equalsIgnoreCase("4")) {
+                        answer.setSurvey_text(question.getSurveyAnswer());
+                    } else if (question.getQuestiontypeid() != null && question.getQuestiontypeid().trim().equalsIgnoreCase("5")) {
+                        answer.setOptions(question.getSurveyOptionAnswer());
+                    } else if (question.getQuestiontypeid() != null && question.getQuestiontypeid().trim().equalsIgnoreCase("6")) {
+                        answer.setOptions(question.getSurveyOptionAnswer());
+                    }
+                }
+                answers.add(answer);
+            }
+
+            Gson gson = new Gson();
+            JsonElement jsonElement = gson.toJsonTree(
+                    answers, new TypeToken<ArrayList<SurveyAnswer>>() {
+                    }.getType());
+
+            HashMap<String, String> map = new HashMap<>();
+            map.put("ans_arr", jsonElement.toString());
+            map.put("startdatetime", START_TIME);
+            map.put("enddatetime", END_TIME);
+
+            if (new UtilService().isNetworkAvailable(SurveyActivity.this)) {
+
+                progressDialog = new TransparentProgressDialog(SurveyActivity.this);
+                progressDialog.show();
+
+                restService.postSurvey(ASSESSMENT.getAssessmentid(), map).enqueue(new Callback<AnswerResponse>() {
+                    @Override
+                    public void onResponse(Call<AnswerResponse> call, Response<AnswerResponse> response) {
+
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            GlobalData.showToast(SurveyActivity.this, "Feedback submitted successfully", Toast.LENGTH_SHORT).show();
+                            finish();
+                            SurveyActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                                    R.anim.animation_f_leave);
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                            SurveyActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                                    R.anim.animation_f_leave);
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                                SurveyActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                                        R.anim.animation_f_leave);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<AnswerResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+            } else {
+                GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+            }
+
+        }
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            SurveyActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+
+    @Override
+    public void onBackPressed() {
+        if (isReview) {
+            getToTime();
+            finish();
+            SurveyActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        } else {
+            confirmClose();
+        }
+
+    }
+
+    @SuppressLint("StaticFieldLeak")
+    private void getSurveyQuestion() {
+        if (new UtilService().isNetworkAvailable(SurveyActivity.this)) {
+            progressDialog = new TransparentProgressDialog(SurveyActivity.this);
+            progressDialog.show();
+
+            restService.getSurveyQuistion(ASSESSMENT.getAssessmentid()).enqueue(new Callback<AssessmentQuestionResponse>() {
+                @Override
+                public void onResponse(Call<AssessmentQuestionResponse> call, Response<AssessmentQuestionResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        ASSESSMENT_QUESTIONS = response.body().getData();
+                        setSurveyQuestion();
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        }
+                    }
+                }
+
+                @Override
+                public void onFailure(Call<AssessmentQuestionResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    @SuppressLint("StaticFieldLeak")
+    private void getSurveyReview() {
+        if (new UtilService().isNetworkAvailable(SurveyActivity.this)) {
+            progressDialog = new TransparentProgressDialog(SurveyActivity.this);
+            progressDialog.show();
+
+            restService.getSurveyReviewQuistion(ASSESSMENT.getResult_id()).enqueue(new Callback<AssessmentQuestionResponse>() {
+                @Override
+                public void onResponse(Call<AssessmentQuestionResponse> call, Response<AssessmentQuestionResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        ASSESSMENT_QUESTIONS = response.body().getData();
+                        setSurveyQuestion();
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        }
+                    }
+                }
+
+                @Override
+                public void onFailure(Call<AssessmentQuestionResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    private void setSurveyQuestion() {
+        adapter = new SurveyQuestionAdapter(SurveyActivity.this, ASSESSMENT_QUESTIONS, isReview);
+        surveyListView.setAdapter(adapter);
+
+        START_TIME = format.format(new Date());
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(SurveyActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    activity.getCurrentFocus().getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 414 - 0
Android/app/src/main/java/com/cygnusa/hyperm/TargetSalesActivity.java

@@ -0,0 +1,414 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Handler;
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.appcompat.widget.Toolbar;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.adapter.TargetSalesAdapter;
+import com.cygnusa.hyperm.droppy.DroppyClickCallbackInterface;
+import com.cygnusa.hyperm.droppy.DroppyMenuItem;
+import com.cygnusa.hyperm.droppy.DroppyMenuPopup;
+import com.cygnusa.hyperm.droppy.EasyDialog;
+import com.cygnusa.hyperm.fancyshowcase.FancyShowCaseView;
+import com.cygnusa.hyperm.fancyshowcase.FocusShape;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.MyCallback;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.Survey;
+import com.cygnusa.hyperm.wrappers.TargetSales;
+import com.cygnusa.hyperm.wrappers.TargetSalesResponse;
+import com.tylersuehr.esr.EmptyStateRecyclerView;
+import com.tylersuehr.esr.TextStateDisplay;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Objects;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Response;
+
+
+public class TargetSalesActivity extends AppCompatActivity {
+    EmptyStateRecyclerView targetList;
+    TransparentProgressDialog progressDialog;
+    ApiService restService;
+    ArrayList<TargetSales> My_Target_Sales = new ArrayList<>();
+    ArrayList<Survey> SURVEY_LIST = new ArrayList<>();
+    TargetSalesAdapter adapter;
+    LinearLayoutManager linearLayoutManager;
+    public static String YEAR;
+    public static String MONTH;
+    public static String Date;
+    TextView mSalesDate;
+    ImageView rightMenu;
+    FrameLayout notificationButton;
+    EasyDialog easyDialog;
+    DroppyMenuPopup droppyMenu;
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_target_sales);
+        setupWindowAnimations();
+        setupUI(findViewById(R.id.bgLayout));
+        restService = ((MainApplication) getApplication()).getClient();
+        mSalesDate=findViewById(R.id.salesDate);
+        if(!Date.isEmpty()){
+            mSalesDate.setText("Data as on : "+Date);
+        }
+        targetList = findViewById(R.id.learningPath);
+        targetList.setHasFixedSize(true);
+        targetList.setItemAnimator(new SlideInLeftAnimator());
+        linearLayoutManager = new LinearLayoutManager(this);
+        targetList.setLayoutManager(linearLayoutManager);
+        targetList.setStateDisplay(EmptyStateRecyclerView.STATE_EMPTY,
+                new TextStateDisplay(this, "No data available", ""));
+        rightMenu = findViewById(R.id.rightMenu);
+        notificationButton = findViewById(R.id.notificationButton);
+        initDroppyMenu();
+        rightMenu.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                    easyDialog = new EasyDialog(TargetSalesActivity.this, droppyMenu)
+                            .setLayout(droppyMenu.show())
+                            .setGravity(EasyDialog.GRAVITY_BOTTOM)
+                            .setBackgroundColor(Color.TRANSPARENT, Color.WHITE)
+                            .setLocationByAttachedView(rightMenu)
+                            .setAnimationTranslationShow(EasyDialog.DIRECTION_X, 350,
+                                    GlobalData.width, 0)
+                            .setAnimationTranslationDismiss(EasyDialog.DIRECTION_X, 350, 0,
+                                    GlobalData.width).setTouchOutsideDismiss(true)
+                            .setMatchParent(false).setMarginLeftAndRight(0, 15)
+                            .setOutsideColor(Color.parseColor("#80000000")).show();
+
+            }
+        });
+
+        notificationButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                    goNotificationActivity();
+
+            }
+        });
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setNavigationIcon(R.mipmap.back);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        targetList.post(new Runnable() {
+            @Override
+            public void run() {
+                getTargetedList();
+            }
+        });
+
+    }
+    private void goNotificationActivity() {
+        startActivity(new Intent(getBaseContext(), NotificationActivity.class));
+
+    }
+
+    private void initDroppyMenu() {
+        DroppyMenuPopup.Builder droppyBuilder = new DroppyMenuPopup.Builder(
+                TargetSalesActivity.this, rightMenu);
+        droppyBuilder.addMenuItem(new DroppyMenuItem("Change Password", R.mipmap.icon_change_password))
+                .addSeparator()
+                .addMenuItem(new DroppyMenuItem("Settings", R.mipmap.icon_settings))
+                .addSeparator()
+                .addMenuItem(new DroppyMenuItem("FAQs", R.mipmap.icon_faq))
+                .addSeparator()
+                .addMenuItem(new DroppyMenuItem("About", R.mipmap.icon_about))
+                .addSeparator()
+                .addMenuItem(new DroppyMenuItem("Logout", R.mipmap.icon_logout))
+                .addSeparator()
+                .triggerOnAnchorClick(false);
+        droppyBuilder.setOnClick(new DroppyClickCallbackInterface() {
+            @Override
+            public void call(View v, int id) {
+                easyDialog.dismiss();
+                switch (id) {
+                    case 0:
+                        new Handler().postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                startActivity(new Intent(TargetSalesActivity.this, ChangePasswordActivity.class));
+                            }
+                        }, 300);
+                        break;
+                    case 1:
+                        new Handler().postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                Intent i = new Intent(TargetSalesActivity.this, SettingsActivity.class);
+                                i.putExtra("usertype", "dse");
+                                startActivity(i);
+                            }
+                        }, 300);
+                        break;
+                    case 2:
+                        new Handler().postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                startActivity(new Intent(TargetSalesActivity.this, FaqActivity.class));
+                            }
+                        }, 300);
+                        break;
+                    case 3:
+                        new Handler().postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                startActivity(new Intent(TargetSalesActivity.this, AboutActivity.class));
+                            }
+                        }, 300);
+                        break;
+                    case 4:
+
+                        new AlertDialog.Builder(TargetSalesActivity.this)
+                                .setMessage("Are you sure you want to logout?")
+                                .setPositiveButton("Yes",
+                                        new DialogInterface.OnClickListener() {
+                                            @Override
+                                            public void onClick(
+                                                    DialogInterface dialog,
+                                                    int which) {
+//                                                preferences = getSharedPreferences("UserDetails",
+//                                                        Context.MODE_PRIVATE);
+//                                                editor = preferences.edit();
+//                                                editor.putString("inputUsername", null);
+//                                                editor.putString("inputPassword", null);
+//                                                editor.apply();
+                                                getSharedPreferences("FCM_TOKEN", Context.MODE_PRIVATE)
+                                                        .edit().putString("FCM_TOKEN_ID", "").apply();
+                                                GlobalData.sdb.delete("session", null, null);
+                                                GlobalData.sdb.delete("topic", null, null);
+                                                deleteLocalFiles();
+                                                startActivity(new Intent(getBaseContext(), LoginActivity.class));
+                                                finish();
+                                            }
+                                        }).setNegativeButton("No", null).show();
+                        break;
+
+                }
+
+
+            }
+        });
+        droppyMenu = droppyBuilder.build();
+    }
+    public void deleteLocalFiles(){
+        String fileName = Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                + "/" + ".HYPERM/VIDEO";
+        File dir = new File(fileName);
+
+        if (dir.isDirectory())
+        {
+            String[] children = dir.list();
+            for (int i = 0; i < children.length; i++)
+            {
+                new File(dir, children[i]).delete();
+            }
+        }
+        File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null) + "/" + ".HYPERM", "PDF");
+        if (f1.isDirectory())
+        {
+            String[] children = dir.list();
+            for (int i = 0; i < children.length; i++)
+            {
+                new File(dir, children[i]).delete();
+            }
+        }
+    }
+
+    private void getTargetedList() {
+        if (new UtilService().isNetworkAvailable(this)) {
+            progressDialog = new TransparentProgressDialog(this);
+            progressDialog.show();
+
+            try {
+                restService.getTargetedSales(YEAR, MONTH).enqueue(new MyCallback<TargetSalesResponse>() {
+                    @Override
+                    public void onResponse(Call<TargetSalesResponse> call, Response<TargetSalesResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            My_Target_Sales = response.body().getData();
+                            if (SURVEY_LIST == null) {
+                                SURVEY_LIST = new ArrayList<>();
+                            }
+                            if (My_Target_Sales.size() == 0) {
+                                targetList.invokeState(EmptyStateRecyclerView.STATE_EMPTY);
+                            } else {
+                                targetList.invokeState(EmptyStateRecyclerView.STATE_OK);
+                            }
+                            adapter = new TargetSalesAdapter(TargetSalesActivity.this, My_Target_Sales);
+                            targetList.setAdapter(adapter);
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                            finish();
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(TargetSalesActivity.this, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(TargetSalesActivity.this, message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                                finish();
+                            }
+                        }
+
+
+                    }
+
+                    @Override
+                    public void onFailure(Call<TargetSalesResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(TargetSalesActivity.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                GlobalData.showToast(TargetSalesActivity.this, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+        } else {
+            GlobalData.showToast(TargetSalesActivity.this, "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    public void setupUI(View view) {
+        try {
+            if (!(view instanceof EditText)) {
+                view.setOnTouchListener(new View.OnTouchListener() {
+                    @SuppressLint("ClickableViewAccessibility")
+                    public boolean onTouch(View v, MotionEvent event) {
+                        hideSoftKeyboard(TargetSalesActivity.this);
+                        return false;
+                    }
+                });
+            }
+
+            if (view instanceof ViewGroup) {
+                for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                    View innerView = ((ViewGroup) view).getChildAt(i);
+                    setupUI(innerView);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void hideSoftKeyboard(Activity activity) {
+        try {
+            InputMethodManager inputMethodManager =
+                    (InputMethodManager) activity.getSystemService(
+                            Activity.INPUT_METHOD_SERVICE);
+            inputMethodManager.hideSoftInputFromWindow(
+                    activity.getCurrentFocus().getWindowToken(), 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (adapter != null) {
+            adapter.notifyDataSetChanged();
+        }
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    private void showHelpScreen() {
+        try {
+            View view;
+            if (adapter != null && adapter.getItemCount() > 0) {
+                view = targetList.findViewHolderForAdapterPosition(linearLayoutManager.findFirstVisibleItemPosition()).itemView;
+            } else {
+                view = targetList;
+            }
+            new FancyShowCaseView.Builder(this)
+                    .focusOn(view)
+                    .title("Tap here to view the PDF or Video")
+                    .titleSize(22, 1)
+                    .closeOnTouch(true)
+                    .fitSystemWindows(false)
+                    .focusShape(FocusShape.ROUNDED_RECTANGLE)
+                    .backgroundColor(Color.parseColor("#99000000"))
+                    .build()
+                    .show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            confirmClose();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void confirmClose() {
+        finish();
+        TargetSalesActivity.this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+
+}

+ 83 - 0
Android/app/src/main/java/com/cygnusa/hyperm/TermsandConditions.java

@@ -0,0 +1,83 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import android.text.Html;
+import android.view.MenuItem;
+import android.widget.TextView;
+
+import com.github.mikephil.charting.charts.BarChart;
+import com.cygnusa.hyperm.util.GlobalData;
+
+public class TermsandConditions extends AppCompatActivity {
+    private BarChart mChart;
+    private String strTermsnContions;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_terms);
+        Bundle extras = getIntent().getExtras();
+        if (extras != null) {
+            strTermsnContions = extras.getString("tnc");
+        }
+        TextView about = (TextView)findViewById(R.id.terms_conditions);
+//        String youtContentStr = String.valueOf(Html
+//                .fromHtml("<![CDATA[<body style=\"text-align:justify;color:#222222; \">"
+//                        + strTermsnContions
+//                        + "</body>]]>"));
+
+        String htmlText = "<html><body style=\"text-align:justify\"> %s </body></Html>";
+        about.setText(Html.fromHtml(String.format(String.format(htmlText, strTermsnContions), "text/html", "utf-8")));
+        setupWindowAnimations();
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+    }
+    protected void onResume() {
+        super.onResume();
+
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+    @Override
+    public void onBackPressed() {
+        Intent result = new Intent();
+        setResult(Activity.RESULT_CANCELED, result);
+        finish();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+}

+ 304 - 0
Android/app/src/main/java/com/cygnusa/hyperm/TopicListActivity.java

@@ -0,0 +1,304 @@
+package com.cygnusa.hyperm;
+
+import android.graphics.Color;
+import android.os.Bundle;
+import android.os.Handler;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.appcompat.widget.Toolbar;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.adapter.TopicAdapter;
+import com.cygnusa.hyperm.fancyshowcase.FancyShowCaseView;
+import com.cygnusa.hyperm.fancyshowcase.FocusShape;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.MyCallback;
+import com.cygnusa.hyperm.util.PositionUpdateListener;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.ContentResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.MyContent;
+import com.cygnusa.hyperm.wrappers.MyTopic;
+import com.cygnusa.hyperm.wrappers.TopicDetailResponse;
+import com.tylersuehr.esr.EmptyStateRecyclerView;
+import com.tylersuehr.esr.TextStateDisplay;
+
+import java.util.ArrayList;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class TopicListActivity extends AppCompatActivity implements PositionUpdateListener {
+    ApiService restService;
+    TransparentProgressDialog progressDialog;
+    EmptyStateRecyclerView topicList;
+    TextView title;
+    public static MyTopic MY_TOPICS = new MyTopic();
+    public static String CATEGORY_ID = "";
+    int LAST_CLICKED_POSITION = -1;
+
+    int PAGE = 0;
+    int LIMIT = 10;
+    TopicAdapter adapter = null;
+    ArrayList<MyContent> MY_CONTENT = new ArrayList<>();
+    LinearLayoutManager linearLayoutManager;
+    int TOTAL_RECORD = 0;
+    ProgressBar progressBar;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_topic_list);
+        setupWindowAnimations();
+
+        restService = ((MainApplication) getApplication()).getClient();
+        title = findViewById(R.id.title);
+        topicList = findViewById(R.id.topicList);
+        topicList.setHasFixedSize(true);
+        topicList.setItemAnimator(new SlideInLeftAnimator());
+        linearLayoutManager = new LinearLayoutManager(getBaseContext());
+        topicList.setLayoutManager(linearLayoutManager);
+        title.setText(MY_TOPICS.getTopicname());
+        title.setSelected(true);
+        topicList.addOnScrollListener(recyclerViewOnScrollListener);
+        topicList.setStateDisplay(EmptyStateRecyclerView.STATE_EMPTY,
+                new TextStateDisplay(this, "No data available", ""));
+        progressBar = findViewById(R.id.progressBar);
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+
+        topicList.post(new Runnable() {
+            @Override
+            public void run() {
+                getTrainingTopics(true);
+            }
+        });
+
+        findViewById(R.id.helpIcon).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showHelpScreen();
+            }
+        });
+    }
+
+    private void showHelpScreen() {
+        try {
+            View view = null;
+            if (adapter != null && adapter.getItemCount() > 0) {
+                view = topicList.findViewHolderForAdapterPosition(linearLayoutManager.findFirstVisibleItemPosition()).itemView;
+            } else {
+                view = topicList;
+            }
+            new FancyShowCaseView.Builder(this)
+                    .focusOn(view)
+                    .title("Tap here to view topic contents")
+                    .titleSize(22, 1)
+                    .closeOnTouch(true)
+                    .fitSystemWindows(false)
+                    .focusShape(FocusShape.ROUNDED_RECTANGLE)
+                    .backgroundColor(Color.parseColor("#99000000"))
+                    .build()
+                    .show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    private void getTrainingTopics(boolean canLoadProgress) {
+        if (new UtilService().isNetworkAvailable(TopicListActivity.this)) {
+            if (canLoadProgress) {
+                progressDialog = new TransparentProgressDialog(TopicListActivity.this);
+                progressDialog.show();
+                progressBar.setVisibility(View.GONE);
+            } else {
+                progressBar.setVisibility(View.VISIBLE);
+            }
+
+            restService.getTopicContents(MY_TOPICS.getAssettopicid(), PAGE, LIMIT).enqueue(new Callback<ContentResponse>() {
+                @Override
+                public void onResponse(Call<ContentResponse> call, Response<ContentResponse> response) {
+
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    progressBar.setVisibility(View.GONE);
+
+                    if (response.body() != null && response.body().getStatus() == 200) {
+                        TOTAL_RECORD = Integer.parseInt(response.body().getTotal());
+                        if (adapter == null) {
+                            MY_CONTENT = response.body().getData();
+
+                            adapter = new TopicAdapter(TopicListActivity.this, MY_CONTENT, CATEGORY_ID, TopicListActivity.this);
+                            topicList.setAdapter(adapter);
+                        } else {
+                            MY_CONTENT.addAll(response.body().getData());
+                            adapter.notifyDataSetChanged();
+                        }
+
+                        if (MY_CONTENT.size() == 0) {
+                            topicList.invokeState(EmptyStateRecyclerView.STATE_EMPTY);
+                        } else {
+                            topicList.invokeState(EmptyStateRecyclerView.STATE_OK);
+                        }
+                    } else if (response.body() != null && response.body().getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    } else if (response.errorBody() != null) {
+                        Gson gson = new Gson();
+                        ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                        GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                        if (message.getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        }
+                    }
+
+                    new Handler().postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            if (getPreferences(MODE_PRIVATE).getBoolean("TopicListActivity", true)) {
+                                showHelpScreen();
+                                getPreferences(MODE_PRIVATE).edit().putBoolean("TopicListActivity", false).apply();
+                            }
+                        }
+                    }, 1000);
+                }
+
+                @Override
+                public void onFailure(Call<ContentResponse> call, Throwable t) {
+                    if (progressDialog != null && progressDialog.isShowing()) {
+                        progressDialog.dismiss();
+                    }
+                    progressBar.setVisibility(View.GONE);
+                    GlobalData.showToast(getBaseContext(), "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                }
+            });
+        } else {
+            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+
+    private RecyclerView.OnScrollListener recyclerViewOnScrollListener = new RecyclerView.OnScrollListener() {
+        @Override
+        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
+            super.onScrollStateChanged(recyclerView, newState);
+        }
+
+        @Override
+        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+            super.onScrolled(recyclerView, dx, dy);
+            int visibleItemCount = linearLayoutManager.getChildCount();
+            int totalItemCount = linearLayoutManager.getItemCount();
+            int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition();
+
+            if (progressBar.getVisibility() != View.VISIBLE) {
+                if ((visibleItemCount + firstVisibleItemPosition) >= totalItemCount
+                        && firstVisibleItemPosition >= 0
+                        && totalItemCount < TOTAL_RECORD) {
+                    PAGE++;
+                    getTrainingTopics(false);
+                }
+            }
+        }
+    };
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (LAST_CLICKED_POSITION != -1) {
+            if (!MY_CONTENT.get(LAST_CLICKED_POSITION).getStatus().trim().equalsIgnoreCase("2")) {
+                getTopicByPosition(LAST_CLICKED_POSITION);
+            }
+            LAST_CLICKED_POSITION = -1;
+        }
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+
+    private void getTopicByPosition(int position) {
+        if (new UtilService().isNetworkAvailable(TopicListActivity.this)) {
+            restService.getTopicDetail(MY_CONTENT.get(position).getContentid())
+                    .enqueue(new MyCallback<TopicDetailResponse>(position) {
+                        @Override
+                        public void onResponse(Call<TopicDetailResponse> call, Response<TopicDetailResponse> response) {
+                            if (response.body() != null && response.body().getStatus() == 200) {
+                                if (response.body().getData() != null) {
+                                    MY_CONTENT.get(id).setStatus(response.body().getData().getTopic_status());
+                                    adapter.notifyDataSetChanged();
+                                }
+                            } else if (response.body() != null && response.body().getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            } else if (response.errorBody() != null) {
+                                Gson gson = new Gson();
+                                ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                                GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                                if (message.getStatus() == 401) {
+                                    GlobalData.canLogout = true;
+                                    finish();
+                                }
+                            }
+                        }
+
+                        @Override
+                        public void onFailure(Call<TopicDetailResponse> call, Throwable t) {
+
+                        }
+                    });
+        }
+    }
+
+    @Override
+    public void onPositionUpdate(int position) {
+        LAST_CLICKED_POSITION = position;
+    }
+
+}

+ 266 - 0
Android/app/src/main/java/com/cygnusa/hyperm/TrainerViewFeedbackActivity.java

@@ -0,0 +1,266 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.fragments.TrainingTrainerFeedback;
+import com.cygnusa.hyperm.fragments.TrainingTrainingFeedback;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.GetAllTrainerTrainingFeedbackSummary;
+import com.cygnusa.hyperm.wrappers.TrainerFeedBackData;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class TrainerViewFeedbackActivity extends AppCompatActivity {
+    private TextView txtTrainingName, txtTrainingStartDate, txtTrainingDuration, txtTrainingEndDate, txtTrainingVenue,
+            txtTrainingTotalPArticipant, smpin, dealerName;
+
+    LinearLayout llout_remaining, llout_buttonLayout;
+    private ImageView imgAttendance;
+    private Button trainingFeedback, trainersFeedback;
+    FragmentManager manager;
+    ApiService restService;
+    TextView txtShowmore;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.activity_trainer_feedback_view);
+
+        initViews();
+
+    }
+
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            onBackPressed();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void initViews() {
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        restService = ((MainApplication) getApplication()).getClient();
+        txtTrainingName = findViewById(R.id.txtTrainingName);
+        txtTrainingStartDate = findViewById(R.id.txtTrainingStartDate);
+        txtTrainingDuration = findViewById(R.id.txtTrainingDuration);
+        txtTrainingEndDate = findViewById(R.id.txtTrainingEndDate);
+        txtTrainingVenue = findViewById(R.id.txtTrainingVenue);
+        txtTrainingTotalPArticipant = findViewById(R.id.txtTrainingTotalPArticipant);
+        llout_remaining = findViewById(R.id.lloutWholeLayout);
+        llout_remaining.setVisibility(View.GONE);
+        txtShowmore = findViewById(R.id.txtShowmore);
+        imgAttendance = findViewById(R.id.imgAttendance);
+        llout_buttonLayout = findViewById(R.id.llout_buttonLayout);
+        llout_buttonLayout.setVisibility(View.GONE);
+
+        trainersFeedback = findViewById(R.id.trainers_feedback);
+        trainingFeedback = findViewById(R.id.training_feedback);
+        manager = getSupportFragmentManager();
+
+        GetAllTrainingTrainingDetails();
+
+
+        trainersFeedback.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                FragmentTransaction transaction = manager.beginTransaction();
+                trainingFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                trainersFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                transaction.replace(R.id.container, new TrainingTrainerFeedback());
+                transaction.commit();
+            }
+        });
+
+        trainingFeedback.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                FragmentTransaction transaction = manager.beginTransaction();
+                trainersFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                trainingFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                transaction.replace(R.id.container, new TrainingTrainingFeedback());
+                transaction.commit();
+            }
+        });
+
+        smpin = findViewById(R.id.smpin);
+        dealerName = findViewById(R.id.txtDealerName);
+        txtTrainingVenue.setSelected(true);
+        dealerName.setSelected(true);
+        txtShowmore.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (txtShowmore.getText().toString().equalsIgnoreCase("Show More")) {
+                    txtShowmore.setText(getResources().getText(R.string.showless));
+                    llout_remaining.setVisibility(View.VISIBLE);
+                } else {
+                    txtShowmore.setText(getResources().getText(R.string.showmore));
+                    llout_remaining.setVisibility(View.GONE);
+                }
+            }
+        });
+
+        setAllData();
+    }
+
+
+    private void GetAllTrainingTrainingDetails() {
+
+        restService.getTrainingTrainingFeedback(GlobalData.DSEFEEDBACKVIEW.getAssessmentid()).enqueue(new Callback<GetAllTrainerTrainingFeedbackSummary>() {
+            @Override
+            public void onResponse(Call<GetAllTrainerTrainingFeedbackSummary> call, Response<GetAllTrainerTrainingFeedbackSummary> response) {
+                if (response.body() != null) {
+                    if (response.body().getResponse().equalsIgnoreCase("Success")) {
+                        TrainerFeedBackData summaryData = response.body().getTrainerFeedBackDataList();
+                        if (summaryData != null) {
+                            GlobalData.TrainerFeedbackData = summaryData;
+                            FragmentTransaction transaction = manager.beginTransaction();
+                            trainersFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_black));
+                            trainingFeedback.setBackground(getResources().getDrawable(R.drawable.border_login_white));
+                            transaction.replace(R.id.container, new TrainingTrainingFeedback());
+                            transaction.commit();
+
+
+                        } else {
+                            GlobalData.toast(getApplicationContext(), "No data found.");
+                            GlobalData.TrainerFeedbackData = null;
+                            onBackPressed();
+                        }
+                    } else {
+                        GlobalData.toast(getApplicationContext(), response.body().getMessage());
+                        GlobalData.TrainerFeedbackData = null;
+                        onBackPressed();
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getApplicationContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<GetAllTrainerTrainingFeedbackSummary> call, Throwable t) {
+                if (t.getMessage() != null) {
+                    Log.e("tmess", t.getMessage());
+                }
+
+                txtShowmore.setText(getResources().getText(R.string.showmore));
+                llout_remaining.setVisibility(View.GONE);
+            }
+        });
+    }
+
+    private void setAllData() {
+
+        if (GlobalData.DSEFEEDBACKVIEW != null) {
+            txtTrainingName.setText(GlobalData.DSEFEEDBACKVIEW.getTitle());
+
+            String endDate = GlobalData.DSEFEEDBACKVIEW.getEndDate();
+            String startDate = GlobalData.DSEFEEDBACKVIEW.getStartDate();
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startDateString = "", endDateString = "";
+            try {
+                startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+                endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            String endTime = GlobalData.DSEFEEDBACKVIEW.getEndDate();
+            String startTime = GlobalData.DSEFEEDBACKVIEW.getStartDate();
+
+            SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startTimeString = "", endTimeString = "";
+            Date date1, date2;
+            long difference = 0;
+            try {
+                date1 = timeFormat.parse(startTime);
+                date2 = timeFormat.parse(endTime);
+                startTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(startTime)));
+                endTimeString = new SimpleDateFormat("HH:mm", Locale.getDefault()).format(Objects.requireNonNull(timeFormat.parse(endTime)));
+                difference = date1.getTime() - date2.getTime();
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            int days = (int) (difference / (1000 * 60 * 60 * 24));
+            int hours = (int) ((difference - (1000 * 60 * 60 * 24 * days)) / (1000 * 60 * 60));
+            int min = (int) (difference - (1000 * 60 * 60 * 24 * days) - (1000 * 60 * 60 * hours)) / (1000 * 60);
+
+            min = (hours < 0 ? -min : min);
+            Log.i("======= min", " :: " + min);
+
+            txtTrainingStartDate.setText(startDateString);
+            txtTrainingEndDate.setText(endDateString);
+            txtTrainingDuration.setText(GlobalData.DSEFEEDBACKVIEW.getOrganizer_name());
+            txtTrainingVenue.setText(GlobalData.DSEFEEDBACKVIEW.getVenueAddress());
+            txtTrainingTotalPArticipant.setText(GlobalData.DSEFEEDBACKVIEW.getTotal_participants());
+            smpin.setText(GlobalData.DSEFEEDBACKVIEW.getTraining_id());
+
+
+            Glide.with(TrainerViewFeedbackActivity.this).load(GlobalData.DSEFEEDBACKRESPONSEGROUPIMAGE)
+                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                            .placeholder(R.drawable.nodatafound)).into(imgAttendance);
+        }
+    }
+}

+ 763 - 0
Android/app/src/main/java/com/cygnusa/hyperm/VideoViewActivity.java

@@ -0,0 +1,763 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.ProgressDialog;
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.database.Cursor;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.media.MediaPlayer;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.StrictMode;
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import android.text.method.ScrollingMovementMethod;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.MyCallback;
+import com.cygnusa.hyperm.util.StorePreference;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.videoview.UniversalMediaController;
+import com.cygnusa.hyperm.videoview.UniversalVideoView;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ContentFile;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.HitCountModel;
+import com.cygnusa.hyperm.wrappers.MyContent;
+import com.cygnusa.hyperm.wrappers.MyTopic;
+import com.cygnusa.hyperm.wrappers.TrainingCategory;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLConnection;
+import java.security.InvalidKeyException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Objects;
+
+import javax.crypto.Cipher;
+import javax.crypto.CipherInputStream;
+import javax.crypto.CipherOutputStream;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.spec.SecretKeySpec;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class VideoViewActivity extends AppCompatActivity {
+    public static MyContent CONTENT = new MyContent();
+    public static MyTopic TOPIC = new MyTopic();
+    public static TrainingCategory TRAINING_ID;
+    // public static String TRAINING_ID="";
+    public int num;
+    public int total;
+    TextView title, contentTitle, contentDescription, mTextLanguageSelection, txtDownload, txtClear;
+    UniversalVideoView videoView;
+    UniversalMediaController mMediaController;
+    View mBottomLayout;
+    View mVideoLayout;
+    View appBarLayout;
+    ImageView mImageLangSelection, imgDownload, imgClear;
+    Toolbar toolbar;
+    ApiService restService;
+    ProgressBar progressBar;
+    URI uri;
+    private int mSeekPosition;
+    private int cachedHeight;
+    private boolean isFullscreenMode;
+    private AlertDialog.Builder builder;
+    private ProgressDialog pDialog;
+    private ContentFile SELECTED_CONTENT = new ContentFile();
+    String type;
+    private StorePreference storePreference;
+    Handler handler = new Handler();
+    public static final String HASH_ALGORITHM = "SHA-256";
+    public String encryptKey = "Hyperm";
+    public File decryptFile = null;
+    public static String tempfilename = "temp", formattedDate = "";
+    String fromTime, toTime, finalTime;
+    Calendar c;
+    SimpleDateFormat df;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_video_view);
+        setupWindowAnimations();
+        Bundle extras = getIntent().getExtras();
+        if (extras != null) {
+            type = extras.getString("type");
+        }
+        restService = ((MainApplication) getApplication()).getClient();
+
+        File f = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null), ".HYPERM");
+        if (!f.exists()) {
+            f.mkdirs();
+        }
+
+        File f1 = new File(Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null) + "/" + ".HYPERM", "VIDEO");
+        if (!f1.exists()) {
+            f1.mkdirs();
+        }
+
+        mVideoLayout = findViewById(R.id.video_layout);
+        mBottomLayout = findViewById(R.id.bottom_layout);
+        appBarLayout = findViewById(R.id.appBarLayout);
+        mMediaController = findViewById(R.id.media_controller);
+        title = findViewById(R.id.title);
+        videoView = findViewById(R.id.videoView);
+        mTextLanguageSelection = findViewById(R.id.textLanguage);
+        mImageLangSelection = findViewById(R.id.imgLanguage);
+
+        txtDownload = findViewById(R.id.downloadText);
+        imgDownload = findViewById(R.id.download);
+
+        txtClear = findViewById(R.id.clear);
+        imgClear = findViewById(R.id.img_clear);
+
+        txtClear.setAlpha(0.3f);
+        imgClear.setAlpha(0.3f);
+        txtClear.setEnabled(false);
+        imgClear.setEnabled(false);
+
+        mVideoLayout = findViewById(R.id.video_layout);
+        progressBar = findViewById(R.id.progressBar);
+        progressBar.setVisibility(View.VISIBLE);
+        title.setText(CONTENT.getTitle());
+        title.setSelected(true);
+        contentTitle = findViewById(R.id.contentTitle);
+        contentDescription = findViewById(R.id.contentDescription);
+        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
+        StrictMode.setThreadPolicy(policy);
+        storePreference = new StorePreference(this);
+
+        getCurrentTime();
+        mTextLanguageSelection.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                showLanguageSelectionList();
+            }
+        });
+        mImageLangSelection.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                mTextLanguageSelection.performClick();
+            }
+        });
+
+        txtDownload.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                downloadVideo();
+
+            }
+        });
+
+        imgDownload.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                txtDownload.performClick();
+            }
+        });
+
+        txtClear.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+                new AlertDialog.Builder(VideoViewActivity.this)
+                        .setMessage("Are you sure you want to clear?")
+                        .setPositiveButton("Yes",
+                                new DialogInterface.OnClickListener() {
+                                    @Override
+                                    public void onClick(
+                                            DialogInterface dialog,
+                                            int which) {
+//
+                                        clearFileFromDevice();
+
+                                    }
+                                }).setNegativeButton("No", null).show();
+
+
+            }
+        });
+
+        imgClear.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                txtClear.performClick();
+            }
+        });
+
+        toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        getSupportActionBar().setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+        new Handler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                loadContentFile(getContentFile());
+            }
+        }, 1000);
+    }
+
+    private void getCurrentTime() {
+        c = Calendar.getInstance();
+        System.out.println("fromTime " + c.getTime());
+
+        df = new SimpleDateFormat("HH:mm:ss");
+        fromTime = df.format(c.getTime());
+        Log.e("fromTime", fromTime);
+    }
+
+    public boolean isFileAlreadyDownload(ContentFile contentFile) {
+        String fileName = Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                + "/" + ".HYPERM/VIDEO/" + CONTENT.getContentid() + "_" + CONTENT.getVersion()
+                + "_" + contentFile.getLanguage_code() + ".mp4";
+        File f = new File(fileName);
+        return f.exists();
+    }
+
+    public void clearFileFromDevice() {
+        String fileName = Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                + "/" + ".HYPERM/VIDEO/" + CONTENT.getContentid() + "_" + CONTENT.getVersion()
+                + "_" + SELECTED_CONTENT.getLanguage_code() + ".mp4";
+        File f = new File(fileName);
+        if (f.exists()) {
+            f.delete();
+            GlobalData.sdb.execSQL("delete from topic_content where" + " category_id='"
+                    + TRAINING_ID.getCateid() + "' and topic_id='" + TOPIC.getAssettopicid() + "' and content_id='" + CONTENT.getContentid() + "'");
+
+            Cursor cursor = GlobalData.sdb.rawQuery("select * from topic_content where" + " category_id='"
+                    + TRAINING_ID.getCateid() + "' and topic_id='" + TOPIC.getAssettopicid() + "' and content_id='" + CONTENT.getContentid() + "'", null);
+            if (cursor.getCount() == 0) {
+                GlobalData.sdb.execSQL("delete  from topic where" + " category_id='"
+                        + TRAINING_ID.getCateid()
+                        + "' and topic_id='" + TOPIC.getAssettopicid() + "'");
+            }
+            txtDownload.setAlpha(1f);
+            imgDownload.setAlpha(1f);
+            txtDownload.setEnabled(true);
+            imgDownload.setEnabled(true);
+
+            txtClear.setAlpha(0.3f);
+            imgClear.setAlpha(0.3f);
+            imgClear.setEnabled(false);
+            txtClear.setEnabled(false);
+            GlobalData.showToast(getBaseContext(), "File deleted from local storage", Toast.LENGTH_SHORT).show();
+        }
+
+    }
+
+    private void sendHitCountToServer() {
+        restService.sendAllHitCount(buildConfigData()).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+                    Log.e("responeHit", response.body().getMessage());
+                } else {
+                    Log.e("responeHit", response.body().getMessage());
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+                if (t.getMessage() != null) {
+                    Log.e("responeHit", t.getMessage());
+                }
+            }
+        });
+    }
+
+    private HitCountModel buildConfigData() {
+        HitCountModel hitCountModel = new HitCountModel();
+        hitCountModel.setPage("Learning");
+        hitCountModel.setAssettopicid(Integer.valueOf(CONTENT.getAssettopicid()));
+        hitCountModel.setContentid(Integer.valueOf(CONTENT.getContentid()));
+        hitCountModel.setViewtime(finalTime);
+        return hitCountModel;
+    }
+
+    @SuppressLint("StaticFieldLeak")
+    private void downloadVideo() {
+        new AsyncTask<Void, Integer, Void>() {
+            @Override
+            protected void onPreExecute() {
+                super.onPreExecute();
+                try {
+                    pDialog = new ProgressDialog(VideoViewActivity.this);
+                    pDialog.setTitle("");
+                    pDialog.setMessage("Downloading...");
+                    pDialog.setIndeterminate(false);
+                    pDialog.setMax(100);
+                    pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
+                    pDialog.setCancelable(false);
+                    pDialog.show();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+
+
+            @Override
+            protected Void doInBackground(Void... voids) {
+                OutputStream output = null;
+                InputStream input = null;
+                try {
+                    int count;
+                    URL url = new URL(SELECTED_CONTENT.getFile_url());
+                    URLConnection conection = url.openConnection();
+                    conection.connect();
+                    int lenghtOfFile = conection.getContentLength();
+                    input = new BufferedInputStream(url.openStream(),
+                            8192);
+                    String fileName = Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                            + "/" + ".HYPERM/VIDEO/" + CONTENT.getContentid() + "_" + CONTENT.getVersion()
+                            + "_" + SELECTED_CONTENT.getLanguage_code() + ".mp4";
+                    output = new FileOutputStream(fileName);
+                    byte data[] = new byte[1024];
+                    long total = 0;
+                    SecretKeySpec sks = generateKey(encryptKey);
+                    @SuppressLint("GetInstance")
+                    Cipher cipher = Cipher.getInstance("AES");
+                    cipher.init(Cipher.ENCRYPT_MODE, sks);
+                    output = new CipherOutputStream(output, cipher);
+
+                    while ((count = input.read(data)) != -1) {
+                        num++;
+                        total += count;
+                        publishProgress((int) (total * 100 / lenghtOfFile));
+                        output.write(data, 0, count);
+                    }
+                    output.flush();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                } finally {
+                    try {
+                        Objects.requireNonNull(output).close();
+                        Objects.requireNonNull(input).close();
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+                return null;
+            }
+
+            @Override
+            protected void onProgressUpdate(Integer... progress) {
+                super.onProgressUpdate(progress);
+                // Update the ProgressBar
+                pDialog.setProgress(progress[0]);
+            }
+
+            @Override
+            protected void onPostExecute(Void aVoid) {
+                super.onPostExecute(aVoid);
+                pDialog.dismiss();
+             //   GlobalData.showToast(getBaseContext(), "Video saved on local, will sync to server when online", Toast.LENGTH_LONG).show();
+                loadContentFile(SELECTED_CONTENT);
+            }
+
+        }.execute();
+
+    }
+
+    public static SecretKeySpec generateKey(final String password) throws NoSuchAlgorithmException, UnsupportedEncodingException {
+        final MessageDigest digest = MessageDigest.getInstance(HASH_ALGORITHM);
+        byte[] bytes = password.getBytes("UTF-8");
+        digest.update(bytes, 0, bytes.length);
+        byte[] key = digest.digest();
+        return new SecretKeySpec(key, "AES");
+    }
+
+    public void decrypt(String pathstr, String filetype, Runnable runnable) throws IOException, NoSuchAlgorithmException,
+            NoSuchPaddingException, InvalidKeyException {
+
+        FileInputStream fis = new FileInputStream(pathstr);
+        String format = ".pdf";
+        if (filetype.equalsIgnoreCase("pdf")) {
+            format = ".pdf";
+        } else if (filetype.equalsIgnoreCase("mp4")) {
+            format = ".mp4";
+        }
+        decryptFile = File.createTempFile(tempfilename, format, this.getCacheDir());
+        FileOutputStream fos = new FileOutputStream(decryptFile);
+        SecretKeySpec sks = generateKey(encryptKey);
+        Cipher cipher = Cipher.getInstance("AES");
+        cipher.init(Cipher.DECRYPT_MODE, sks);
+        CipherInputStream cis = new CipherInputStream(fis, cipher);
+        int b;
+        byte[] d = new byte[1024];
+        while ((b = cis.read(d)) != -1) {
+            fos.write(d, 0, b);
+        }
+
+        fos.flush();
+        fos.close();
+        cis.close();
+        runnable.run();
+    }
+
+    public void saveTopicData() {
+
+        Cursor cursor = GlobalData.sdb.rawQuery("select * from topic_content where" + " category_id='"
+                + TRAINING_ID.getCateid() + "' and topic_id='" + TOPIC.getAssettopicid() + "' and content_id='" + CONTENT.getContentid() + "'", null);
+        if (cursor.getCount() == 0) {
+
+            Gson gson = new Gson();
+            JsonElement jsonElement = gson.toJsonTree(
+                    CONTENT, new TypeToken<MyContent>() {
+                    }.getType());
+            ContentValues values = new ContentValues();
+            values.put("topic_content", jsonElement.toString());
+            values.put("category_id", TRAINING_ID.getCateid());
+            values.put("topic_id", TOPIC.getAssettopicid());
+            values.put("content_id", CONTENT.getContentid());
+            GlobalData.sdb.insert("topic_content", null, values);
+        }
+        cursor = GlobalData.sdb.rawQuery("select * from topic where" + " category_id='"
+                + TRAINING_ID.getCateid()
+                + "' and topic_id='" + TOPIC.getAssettopicid() + "'", null);
+        if (cursor.getCount() == 0) {
+            Gson gson1 = new Gson();
+            JsonElement jsonElement1 = gson1.toJsonTree(
+                    TOPIC, new TypeToken<MyTopic>() {
+                    }.getType());
+            ContentValues values = new ContentValues();
+            values.put("topic", jsonElement1.toString());
+            values.put("category_id", TRAINING_ID.getCateid());
+            values.put("topic_id", TOPIC.getAssettopicid());
+            GlobalData.sdb.insert("topic", null, values);
+            GlobalData.showToast(getBaseContext(), "Video saved on local, will sync to server when online", Toast.LENGTH_LONG).show();
+        }
+
+//        } else {
+//            GlobalData.showToast(getBaseContext(), "Please check your internet connection", Toast.LENGTH_SHORT).show();
+//        }
+    }
+
+    public void loadContentFile(final ContentFile contentFile) {
+        try {
+            SELECTED_CONTENT = contentFile;
+
+            if (isFileAlreadyDownload(contentFile)) {
+                txtDownload.setAlpha(0.3f);
+                imgDownload.setAlpha(0.3f);
+                txtDownload.setEnabled(false);
+                imgDownload.setEnabled(false);
+                txtClear.setAlpha(1.0f);
+                imgClear.setAlpha(1.0f);
+                txtClear.setEnabled(true);
+                imgClear.setEnabled(true);
+
+            } else {
+                txtDownload.setAlpha(1f);
+                imgDownload.setAlpha(1f);
+                txtDownload.setEnabled(true);
+                imgDownload.setEnabled(true);
+                txtClear.setAlpha(0.3f);
+                imgClear.setAlpha(0.3f);
+                imgClear.setEnabled(false);
+                txtClear.setEnabled(false);
+            }
+            mTextLanguageSelection.setText(SELECTED_CONTENT.getLanguage_title());
+            contentTitle.setText(CONTENT.getTitle());
+            title.setText(CONTENT.getTitle());
+
+            contentDescription.setText(CONTENT.getDescription());
+            contentDescription.setMovementMethod(new ScrollingMovementMethod());
+            mVideoLayout.post(new Runnable() {
+                @Override
+                public void run() {
+                    int width = mVideoLayout.getWidth();
+                    cachedHeight = (int) (width * 405f / 720f);
+                    ViewGroup.LayoutParams videoLayoutParams = mVideoLayout.getLayoutParams();
+                    videoLayoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+                    videoLayoutParams.height = cachedHeight;
+                    mVideoLayout.setLayoutParams(videoLayoutParams);
+                    final String fileName = Objects.requireNonNull(getApplicationContext()).getExternalFilesDir(null)
+                            + "/" + ".HYPERM/VIDEO/" + CONTENT.getContentid() + "_" + CONTENT.getVersion() + "_"
+                            + contentFile.getLanguage_code() + ".mp4";
+                    if (new File(fileName).exists()) {
+                        saveTopicData();
+                        try {
+                            decrypt(fileName, "mp4", new Runnable() {
+                                @Override
+                                public void run() {
+                                    if (decryptFile != null) {
+                                        try {
+                                            Uri videoUri = Uri.parse(decryptFile.getAbsolutePath());
+                                            videoView.setVideoURI(videoUri);
+                                        } catch (Exception e) {
+                                            e.printStackTrace();
+                                        }
+                                    }
+                                }
+                            });
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    } else {
+                        videoView.setVideoPath(contentFile.getFile_url().trim());
+                    }
+
+                    videoView.requestFocus();
+                    videoView.start();
+                    mMediaController.setTitle(CONTENT.getTitle());
+                    videoView.setMediaController(mMediaController);
+                    videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
+                        @Override
+                        public void onCompletion(MediaPlayer mp) {
+                            if (!CONTENT.getStatus().trim().equalsIgnoreCase("2")) {
+                                updateStatus("2");
+                            }
+                        }
+                    });
+
+                    videoView.setVideoViewCallback(new UniversalVideoView.VideoViewCallback() {
+                        @Override
+                        public void onScaleChange(boolean isFullscreen) {
+                            isFullscreenMode = isFullscreen;
+                            if (isFullscreen) {
+                                ViewGroup.LayoutParams layoutParams = mVideoLayout.getLayoutParams();
+                                layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+                                layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
+                                mVideoLayout.setLayoutParams(layoutParams);
+                                mBottomLayout.setVisibility(View.GONE);
+                            } else {
+                                ViewGroup.LayoutParams layoutParams = mVideoLayout.getLayoutParams();
+                                layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+                                layoutParams.height = cachedHeight;
+                                mVideoLayout.setLayoutParams(layoutParams);
+                                mBottomLayout.setVisibility(View.VISIBLE);
+                            }
+                            switchTitleBar(!isFullscreen);
+                        }
+
+                        @Override
+                        public void onPause(MediaPlayer mediaPlayer) {
+                            if (videoView != null && videoView.isPlaying()) {
+                                mSeekPosition = videoView.getCurrentPosition();
+                                videoView.pause();
+                            }
+                        }
+
+                        @Override
+                        public void onStart(MediaPlayer mediaPlayer) {
+                            progressBar.setVisibility(View.GONE);
+                            if (!CONTENT.getStatus().trim().equalsIgnoreCase("1")
+                                    && !CONTENT.getStatus().trim().equalsIgnoreCase("2")) {
+                                updateStatus("1");
+                            }
+                        }
+
+                        @Override
+                        public void onBufferingStart(MediaPlayer mediaPlayer) {
+                            progressBar.setVisibility(View.GONE);
+                        }
+
+                        @Override
+                        public void onBufferingEnd(MediaPlayer mediaPlayer) {
+
+                        }
+
+                    });
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+            progressBar.setVisibility(View.GONE);
+        }
+    }
+
+    public ContentFile getContentFile() {
+        if (CONTENT.getContent_files() == null) {
+            return null;
+        }
+        String language = this.getSharedPreferences("LANGUAGE", Context.MODE_PRIVATE).getString("DEFAULT", "en_us");
+        for (ContentFile file : CONTENT.getContent_files()) {
+            if (file.getLanguage_code().trim().equalsIgnoreCase(language.trim())) {
+                return file;
+            }
+        }
+        return CONTENT.getContent_files().get(0);
+    }
+
+    private ArrayList<String> getContentFile(MyContent item) {
+        if (item.getContent_files() == null) {
+            return null;
+        }
+        ArrayList<String> Language = new ArrayList<>();
+        for (ContentFile file : item.getContent_files()) {
+            Language.add(file.getLanguage_title());
+        }
+        return Language;
+    }
+
+    private void showLanguageSelectionList() {
+        final ArrayList<String> contentFile = getContentFile(CONTENT);
+        builder = new AlertDialog.Builder(VideoViewActivity.this);
+        builder.setTitle("SELECT LANGUAGE")
+                .setItems(contentFile.toArray(new String[contentFile.size()]), new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialogInterface, int i) {
+                        loadContentFile(CONTENT.getContent_files().get(i));
+                        dialogInterface.dismiss();
+                    }
+                });
+
+        builder.create().show();
+
+    }
+
+    private void updateStatus(String status) {
+        CONTENT.setStatus(status);
+        if (new UtilService().isNetworkAvailable(VideoViewActivity.this)) {
+            try {
+                HashMap<String, String> map = new HashMap<>();
+                map.put("contentid", CONTENT.getContentid());
+                map.put("assettopicid", CONTENT.getAssettopicid());
+                map.put("status", status);
+
+                restService.updateContentStaus(map).enqueue(new MyCallback<ErrorResponse>(status) {
+                    @Override
+                    public void onResponse(Call<ErrorResponse> call, Response<ErrorResponse> response) {
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            CONTENT.setStatus(ids);
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(VideoViewActivity.this, message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<ErrorResponse> call, Throwable t) {
+
+                    }
+                });
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private void switchTitleBar(boolean show) {
+        androidx.appcompat.app.ActionBar supportActionBar = getSupportActionBar();
+        if (supportActionBar != null) {
+            if (show) {
+                supportActionBar.show();
+            } else {
+                supportActionBar.hide();
+            }
+        }
+    }
+
+    private void setupWindowAnimations() {
+        this.overridePendingTransition(R.anim.animation_enter,
+                R.anim.animation_leave);
+    }
+
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public void onBackPressed() {
+        if (isFullscreenMode) {
+            videoView.setFullscreen(false);
+        } else {
+            super.onBackPressed();
+            getToTime();
+            this.overridePendingTransition(R.anim.animation_f_enter,
+                    R.anim.animation_f_leave);
+        }
+
+
+    }
+
+    private void getToTime() {
+        c = Calendar.getInstance();
+        System.out.println("toTime " + c.getTime());
+        df = new SimpleDateFormat("HH:mm:ss");
+        toTime = df.format(c.getTime());
+        finalTime = UtilService.getTimeInterval(this,df,fromTime,toTime);
+        if (StorePreference.getInstance(this).getBooleanValue(GlobalData.ISDSELOGIN))
+            sendHitCountToServer();
+    }
+
+    @Override
+    protected void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+        outState.putInt("SEEK_POSITION_KEY", mSeekPosition);
+    }
+
+    @Override
+    protected void onRestoreInstanceState(Bundle outState) {
+        super.onRestoreInstanceState(outState);
+        mSeekPosition = outState.getInt("SEEK_POSITION_KEY");
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (GlobalData.canLogout) {
+            finish();
+        }
+    }
+}

+ 590 - 0
Android/app/src/main/java/com/cygnusa/hyperm/ViewScheduleActivity.java

@@ -0,0 +1,590 @@
+package com.cygnusa.hyperm;
+
+import android.annotation.SuppressLint;
+import android.app.Dialog;
+import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.Typeface;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.github.siyamed.shapeimageview.CircularImageView;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.tooltip.Tooltip;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MainApplication;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.GetCancelOrRescheduleList;
+import com.cygnusa.hyperm.wrappers.Reasons;
+
+import net.danlew.android.joda.JodaTimeAndroid;
+
+import org.joda.time.LocalDate;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+
+import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class ViewScheduleActivity extends AppCompatActivity {
+
+    ParticipantListAdapter dateAdapter;
+    List<String> eTime = new ArrayList<>();
+    List<String> sTime = new ArrayList<>();
+    private TextView txtDate, txtLocation;
+    private TextView txtTrainingStartDate, txtTrainingEndDate, txtTrainingName, txtTrainingUID;
+    private TextView txtDescription, txtTotalParticipant, txtSubmissionDays;
+    private ApiService restService;
+    private List<Reasons> REASONS = new ArrayList<>();
+    private String[] reasonName = {"None"};
+    private String[] reasonId = {"None"};
+    private String reasonIdString = "";
+    private Button btnPublish, btnCancel, btnList, btnModify;
+    private List<Integer> PARTICIPANTIDS = new ArrayList<>();
+    private LinearLayout layoutBtn, layoutDate, lloutModify;
+    private String id1;
+    private String id2;
+    private ImageView imgSchedule;
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        JodaTimeAndroid.init(this);
+        setContentView(R.layout.activity_view_training_schedule);
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+        toolbar.setContentInsetStartWithNavigation(0);
+        toolbar.setTitle("");
+        Objects.requireNonNull(getSupportActionBar()).setTitle("");
+        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+        getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+
+        @SuppressLint("PrivateResource")
+        Drawable backArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_material);
+        backArrow.setColorFilter(getResources().getColor(R.color.btn_bg_color), PorterDuff.Mode.SRC_ATOP);
+        getSupportActionBar().setHomeAsUpIndicator(backArrow);
+
+        restService = ((MainApplication) getApplication()).getClient();
+
+        txtDate = findViewById(R.id.txtDate);
+        txtLocation = findViewById(R.id.txtLocation);
+
+        txtTrainingStartDate = findViewById(R.id.txtTrainingStartDate);
+        txtTrainingEndDate = findViewById(R.id.txtTrainingEndDate);
+        txtTrainingName = findViewById(R.id.txtTrainingName);
+        txtDescription = findViewById(R.id.txtDescription);
+        txtTotalParticipant = findViewById(R.id.txtTotalParticipant);
+        txtSubmissionDays = findViewById(R.id.txtSubmissionDays);
+        txtTrainingUID = findViewById(R.id.txtTrainingUID);
+
+        btnPublish = findViewById(R.id.btnPublish);
+        btnCancel = findViewById(R.id.btnCancel);
+        btnModify = findViewById(R.id.btnModify);
+        btnList = findViewById(R.id.btnList);
+        lloutModify = findViewById(R.id.lloutModify);
+        imgSchedule = findViewById(R.id.imgSchedule);
+
+        if (GlobalData.scheduledDataList.get(0).isTraining_update_status() && GlobalData.scheduledDataList.get(0).getIsActiveHours().equalsIgnoreCase("1"))
+            lloutModify.setVisibility(View.VISIBLE);
+        else
+            lloutModify.setVisibility(View.GONE);
+
+        layoutBtn = findViewById(R.id.layoutBtn);
+        layoutDate = findViewById(R.id.layoutDate);
+
+
+        if (GlobalData.scheduledDataList.get(0).getStatus().equalsIgnoreCase("1")) {
+            layoutBtn.setVisibility(View.GONE);
+        }
+
+        if (GlobalData.scheduledDataList.get(0).getIsDeleted().equalsIgnoreCase("1")) {
+            btnPublish.setVisibility(View.GONE);
+            btnCancel.setText("Training Cancelled");
+            btnCancel.setBackground(getResources().getDrawable(R.drawable.border_full_red));
+            btnCancel.setEnabled(false);
+            imgSchedule.setVisibility(View.GONE);
+            lloutModify.setVisibility(View.GONE);
+            layoutBtn.setVisibility(View.VISIBLE);
+            btnModify.setVisibility(View.GONE);
+        }
+
+        btnList.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if ((GlobalData.scheduledDataList.get(0).getParticipant() != null) && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0)
+                    openPopup();
+                else
+                    GlobalData.toast(ViewScheduleActivity.this, "No Participant List Available");
+
+            }
+        });
+
+        imgSchedule.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if ((GlobalData.scheduledDataList.get(0).getParticipant() != null) && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0)
+                    openPopup();
+                else
+                    GlobalData.toast(ViewScheduleActivity.this, "No Participant List Available");
+            }
+        });
+
+        btnCancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                onBackPressed();
+            }
+        });
+
+        btnPublish.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                try {
+                    sendAllTrainingDatasToServer("1");
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+
+            }
+        });
+
+
+        if (GlobalData.scheduledDataList != null && GlobalData.scheduledDataList.size() > 0) {
+            txtDate.setText(GlobalData.scheduledDataList.get(0).getTitle());
+
+            String startDate = GlobalData.scheduledDataList.get(0).getStartDate();
+            String endDate = GlobalData.scheduledDataList.get(0).getEndDate();
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+            String startDateString = "", endDateString = "";
+            try {
+                startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+                endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            String s = GlobalData.scheduledDataList.get(0).getStartdate();
+            String e = GlobalData.scheduledDataList.get(0).getEnddate();
+
+            LocalDate start = LocalDate.parse(s);
+            LocalDate end = LocalDate.parse(e);
+            List<LocalDate> totalDates = new ArrayList<>();
+            while (!start.isAfter(end)) {
+                totalDates.add(start);
+
+                start = start.plusDays(1);
+            }
+
+            String startTime = GlobalData.scheduledDataList.get(0).getStarttime();
+            String endTime = GlobalData.scheduledDataList.get(0).getEndtime();
+
+            try {
+                JSONArray arrayFromTime = new JSONArray(startTime);
+                for (int i = 0; i < arrayFromTime.length(); i++) {
+                    id1 = (String) arrayFromTime.get(i);
+                    sTime.add(id1);
+                }
+                JSONArray arrayToTime = new JSONArray(endTime);
+                for (int i = 0; i < arrayToTime.length(); i++) {
+                    id2 = (String) arrayToTime.get(i);
+                    eTime.add(id2);
+                }
+            } catch (JSONException e1) {
+                sTime.add(startTime);
+                eTime.add(endTime);
+                e1.printStackTrace();
+            }
+            int trainingDays = Integer.parseInt(GlobalData.scheduledDataList.get(0).getTrainingDays());
+
+            for (int i = 0; i < trainingDays; i++) {
+                TextView txtDays = new TextView(this);
+                txtDays.setTextSize(15);
+                txtDays.setTextColor(Color.parseColor("#00344C"));
+                txtDays.setPadding(0, 0, 0, 0);
+                if (sTime.size() - 1 >= i && eTime.size() - 1 >= i)
+                    txtDays.setText("Day " + (i + 1) + " : " + totalDates.get(i) + " " + sTime.get(i) + " - " + eTime.get(i));
+                txtDays.setTypeface(Typeface.DEFAULT_BOLD);
+                layoutDate.addView(txtDays);
+            }
+
+            txtLocation.setText(GlobalData.scheduledDataList.get(0).getVenueAddress());
+            txtTrainingStartDate.setText(startDateString);
+            txtTrainingEndDate.setText(endDateString);
+            txtDescription.setText(GlobalData.scheduledDataList.get(0).getScheduleName());
+            txtTrainingName.setText(GlobalData.scheduledDataList.get(0).getTitle());
+            if (GlobalData.scheduledDataList.get(0).getParticipant() != null && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0)
+                txtTotalParticipant.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getParticipant().size()));
+            txtSubmissionDays.setText(String.valueOf(GlobalData.scheduledDataList.get(0).getTrainingDays()));
+            txtTrainingUID.setText("TRAINING UID : " + "");
+        }
+
+        getReasons();
+//        getScheduledList();
+
+
+        LinearLayout lloutEdit = findViewById(R.id.lloutEdit);
+
+        txtTrainingUID.setText("TRAINING UID : " + GlobalData.scheduledDataList.get(0).
+
+                getTraining_id());
+
+        if (GlobalData.user.getData().
+
+                getRole().
+
+                equalsIgnoreCase("5")) {
+            lloutEdit.setVisibility(View.VISIBLE);
+        } else {
+            lloutEdit.setVisibility(View.GONE);
+        }
+
+        lloutModify.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                startActivity(new Intent(ViewScheduleActivity.this, ModifyClassRoomActivity.class));
+                finish();
+            }
+        });
+        btnModify.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                startActivity(new Intent(ViewScheduleActivity.this, ModifyClassRoomActivity.class));
+                finish();
+            }
+        });
+    }
+
+    public void openPopup() {
+        final Dialog aDialog = new Dialog(this);
+        aDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        aDialog.setContentView(R.layout.particiapnt_popup);
+        aDialog.setCancelable(true);
+        aDialog.show();
+        TextView textTrainer = aDialog.findViewById(R.id.txtTrainer);
+        textTrainer.setText(GlobalData.scheduledDataList.get(0).getOrganizerName());
+
+        ImageView imgTrainer = aDialog.findViewById(R.id.imgTrainer);
+
+        ImageView close = aDialog.findViewById(R.id.closeButton);
+
+        close.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                aDialog.dismiss();
+            }
+        });
+
+        if (GlobalData.scheduledDataList.get(0).getTrainingGroupImage() != null || !GlobalData.scheduledDataList.get(0).getTrainingGroupImage().isEmpty()) {
+            Glide.with(ViewScheduleActivity.this).load(GlobalData.scheduledDataList.get(0).getTrainingGroupImage())
+                    .thumbnail(Glide.with(ViewScheduleActivity.this).load(R.drawable.gif_loader))
+                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                            .placeholder(R.drawable.placeholder)).into(imgTrainer);
+        } else {
+            Glide.with(ViewScheduleActivity.this).load(R.drawable.placeholder)
+                    .thumbnail(Glide.with(ViewScheduleActivity.this).load(R.drawable.gif_loader))
+                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                            .placeholder(R.drawable.placeholder)).into(imgTrainer);
+        }
+        RecyclerView rcvParticipant = aDialog.findViewById(R.id.rcvParticipant);
+        rcvParticipant.setHasFixedSize(true);
+        rcvParticipant.setItemAnimator(new SlideInLeftAnimator());
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getBaseContext());
+        rcvParticipant.setLayoutManager(linearLayoutManager);
+        dateAdapter = new ParticipantListAdapter();
+        rcvParticipant.setAdapter(dateAdapter);
+    }
+
+    private void getReasons() {
+        if (new UtilService().isNetworkAvailable(Objects.requireNonNull(ViewScheduleActivity.this))) {
+            try {
+                restService.getCancelOrReschedule().enqueue(new Callback<GetCancelOrRescheduleList>() {
+                    @Override
+                    public void onResponse(Call<GetCancelOrRescheduleList> call, Response<GetCancelOrRescheduleList> response) {
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            if (response.body().getReasonsList() != null && response.body().getReasonsList().size() > 0) {
+                                REASONS = response.body().getReasonsList();
+                                reasonName = new String[REASONS.size()];
+                                reasonId = new String[REASONS.size()];
+                                for (int i = 0; i < response.body().getReasonsList().size(); i++) {
+                                    reasonName[i] = REASONS.get(i).getName();
+                                    reasonId[i] = REASONS.get(i).getId();
+                                }
+                            }
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            finish();
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(getBaseContext(), response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                finish();
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<GetCancelOrRescheduleList> call, Throwable t) {
+                    }
+                });
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private void sendAllTrainingDatasToServer(String s) throws JSONException {
+
+        JSONObject assessment = new JSONObject();
+        try {
+            for (int j = 0; j < GlobalData.scheduledDataList.get(0).getAssessment().size(); j++) {
+                assessment.put("name", GlobalData.scheduledDataList.get(0).getAssessment().get(j).getAssessmentname());
+                assessment.put("ques_count", GlobalData.scheduledDataList.get(0).getAssessment().get(j).getTotalQuestion());
+                assessment.put("duration", GlobalData.scheduledDataList.get(0).getAssessment().get(j).getAssessmenttime());
+                assessment.put("assessment", GlobalData.scheduledDataList.get(0).getAssessment().get(j).getAssessmenttype());
+            }
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+        JSONArray jsonArray = new JSONArray();
+        jsonArray.put(assessment);
+
+        JSONObject assessmentObj = new JSONObject();
+        assessmentObj.put("assessments", jsonArray);
+
+        Gson gson = new Gson();
+        JsonElement dseJsonElement = null;
+
+        for (int i = 0; i < GlobalData.scheduledDataList.get(0).getParticipant().size(); i++) {
+            PARTICIPANTIDS.add(Integer.valueOf(GlobalData.scheduledDataList.get(0).getParticipant().get(i).getUserid()));
+        }
+
+        dseJsonElement = gson.toJsonTree(
+                PARTICIPANTIDS, new TypeToken<ArrayList<String>>() {
+                }.getType());
+
+
+        HashMap<String, String> map = new HashMap<>();
+
+        map.put("title", GlobalData.scheduledDataList.get(0).getLvlId());
+        map.put("description", GlobalData.scheduledDataList.get(0).getScheduleName());
+        map.put("startdate", GlobalData.scheduledDataList.get(0).getStartdate());
+        map.put("enddate", GlobalData.scheduledDataList.get(0).getEnddate());
+        map.put("starttime", GlobalData.scheduledDataList.get(0).getStarttime());
+        map.put("endtime", GlobalData.scheduledDataList.get(0).getEndtime());
+        map.put("venue_am", GlobalData.scheduledDataList.get(0).getVenueAm());
+        map.put("schedule_id", GlobalData.scheduledDataList.get(0).getScheduleId());
+
+        map.put("is_feedback", GlobalData.scheduledDataList.get(0).getIsFeedback());
+        map.put("venue_type", GlobalData.scheduledDataList.get(0).getVenueType());
+        map.put("venue_address", GlobalData.scheduledDataList.get(0).getVenueAddress());
+        map.put("venue_dealer", GlobalData.scheduledDataList.get(0).getVenueDealer());
+        map.put("assessments", jsonArray.toString());
+        map.put("dse", dseJsonElement.toString());
+
+        map.put("adhoc_training", GlobalData.scheduledDataList.get(0).getAdhocTraining());
+        map.put("business_segment", GlobalData.scheduledDataList.get(0).getBusinessSegment());
+        map.put("training_other_title", GlobalData.scheduledDataList.get(0).getTrainingOtherTitle());
+        map.put("date_restriction", GlobalData.scheduledDataList.get(0).getDateRestriction());
+        map.put("status", s);
+
+        Log.e("MapValue", map.toString());
+
+        restService.sendAllUpdateTrainingToServer(map).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+                    if (response.body().getResponse().equalsIgnoreCase("Success")) {
+                        GlobalData.toast(ViewScheduleActivity.this, "Published Successfully");
+                        startActivity(new Intent(ViewScheduleActivity.this, ClassRoomTrainerTainingActivity.class));
+                        finish();
+                    } else {
+                        GlobalData.toast(ViewScheduleActivity.this, response.body().getResponseText());
+                    }
+
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                    finish();
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(getBaseContext(), message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                        finish();
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+
+            }
+        });
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        startActivity(new Intent(ViewScheduleActivity.this, ClassRoomTrainerTainingActivity.class));
+        finish();
+        this.overridePendingTransition(R.anim.animation_f_enter,
+                R.anim.animation_f_leave);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            finish();
+            onBackPressed();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private static class ParticipantViewHolder extends RecyclerView.ViewHolder {
+
+        TextView txtName, txtStatus;
+        CircularImageView imgPic;
+        ImageView info;
+
+        public ParticipantViewHolder(@NonNull View itemView) {
+            super(itemView);
+
+            txtName = itemView.findViewById(R.id.txt_Name);
+            txtStatus = itemView.findViewById(R.id.txtStatus);
+            imgPic = itemView.findViewById(R.id.imgPic);
+            info = itemView.findViewById(R.id.info);
+
+        }
+
+    }
+
+    private class ParticipantListAdapter extends RecyclerView.Adapter<ParticipantViewHolder> {
+
+        @NonNull
+        @Override
+        public ParticipantViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+            View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.participant_view_holder, parent, false);
+
+            return new ParticipantViewHolder(v);
+        }
+
+        @Override
+        public void onBindViewHolder(@NonNull ParticipantViewHolder holder, int position) {
+
+            if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getName() == null || GlobalData.scheduledDataList.get(0).getParticipant().get(position).getName().isEmpty()) {
+                holder.txtName.setText("No Name");
+            } else {
+                holder.txtName.setText(GlobalData.scheduledDataList.get(0).getParticipant().get(position).getSmpin() + " " +
+                        GlobalData.scheduledDataList.get(0).getParticipant().get(position).getName());
+            }
+            if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getStatus().equalsIgnoreCase("0")) {
+                holder.txtStatus.setText("Waiting for response");
+                holder.txtStatus.setTextColor(Color.parseColor("#808080"));
+            } else if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getStatus().equalsIgnoreCase("1")) {
+                holder.txtStatus.setText("Acknowledged");
+                holder.txtStatus.setTextColor(Color.parseColor("#348E00"));
+            } else if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getStatus().equalsIgnoreCase("2")) {
+                holder.txtStatus.setText("Declined");
+                holder.info.setVisibility(View.VISIBLE);
+                holder.txtStatus.setTextColor(Color.parseColor("#F90303"));
+            }
+
+            holder.info.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    String header = GlobalData.scheduledDataList.get(0).getParticipant().get(position).getDeclineReasonName() + "/" + GlobalData.scheduledDataList.get(0).getParticipant().get(position).getDeclineReasonDesc();
+                    View mView = LayoutInflater.from(ViewScheduleActivity.this).inflate(R.layout.tooltip_layout, null);
+                    TextView text = mView.findViewById(R.id.text11);
+                    TextView txtReasonTitle = mView.findViewById(R.id.txtReasonTitle);
+                    txtReasonTitle.setText(GlobalData.scheduledDataList.get(0).getParticipant().get(position).getDeclineReasonName());
+                    text.setText(header);
+                    Tooltip.TooltipView tooltip = Tooltip.make(ViewScheduleActivity.this,
+                            new Tooltip.Builder(101)
+                                    .anchor(view, Tooltip.Gravity.TOP)
+                                    .closePolicy(new Tooltip.ClosePolicy()
+                                            .insidePolicy(true, false)
+                                            .outsidePolicy(true, false), 0)
+                                    .activateDelay(300)
+                                    .withStyleId(R.style.ToolTipLayoutCustomStyle)
+                                    .showDelay(300)
+                                    .text("")
+                                    .setBgColor(getResources().getColor(R.color.bg_color))
+                                    .view(mView)
+                                    .maxWidth(300)
+                                    .withArrow(true)
+                                    .build()
+                    );
+                    tooltip.setTextColor(Color.WHITE);
+                    tooltip.show();
+                }
+            });
+
+            if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getProfilePhoto() != null || !GlobalData.scheduledDataList.get(0).getParticipant().get(position).getProfilePhoto().isEmpty()) {
+                Glide.with(ViewScheduleActivity.this).load(GlobalData.scheduledDataList.get(0).getParticipant().get(position).getProfilePhoto())
+                        .thumbnail(Glide.with(ViewScheduleActivity.this).load(R.drawable.gif_loader))
+                        .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                                .placeholder(R.drawable.placeholder)).into(holder.imgPic);
+            } else {
+                Glide.with(ViewScheduleActivity.this).load(R.drawable.placeholder)
+                        .thumbnail(Glide.with(ViewScheduleActivity.this).load(R.drawable.gif_loader))
+                        .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                                .placeholder(R.drawable.placeholder)).into(holder.imgPic);
+            }
+        }
+
+
+        @Override
+        public int getItemCount() {
+            return GlobalData.scheduledDataList.get(0).getParticipant().size();
+        }
+
+    }
+}

+ 377 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/ASMParticipantListAdapter.java

@@ -0,0 +1,377 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.Context;
+import android.content.res.ColorStateList;
+import android.graphics.Color;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.core.content.ContextCompat;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.google.gson.Gson;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.tooltip.Tooltip;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.ReasonList;
+import com.cygnusa.hyperm.wrappers.ReasonListResponse;
+import com.cygnusa.hyperm.wrappers.ScheduleData;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class ASMParticipantListAdapter extends RecyclerView.Adapter<ASMParticipantListAdapter.ViewHolder> {
+
+    private List<ScheduleData> ParticipantList;
+    private Context context;
+    private ApiService restService;
+    private List<ReasonList> REASONS = new ArrayList<>();
+    private String[] reasonName = {"None"};
+    private String[] reasonId = {"None"};
+    private String reasonIdString = "", reasonNameString;
+    private TextView txtDecline;
+    private Dialog dialog;
+    private String dseName, dealerName, amName, userID;
+
+    public ASMParticipantListAdapter(Context context, List<ScheduleData> items, ApiService restClient) {
+        this.ParticipantList = items;
+        this.context = context;
+        this.restService = restClient;
+    }
+
+    @NonNull
+    @Override
+    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.asm_participant_item, parent, false);
+        return new ViewHolder(v);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+        ScheduleData scheduleData = ParticipantList.get(0);
+        holder.view.setTag(scheduleData);
+
+
+        String endDate = GlobalData.scheduledDataList.get(0).getEndDate();
+        String startDate = GlobalData.scheduledDataList.get(0).getStartDate();
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+        String startDateString = "", endDateString = "";
+        try {
+            startDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(startDate)));
+            endDateString = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Objects.requireNonNull(format.parse(endDate)));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        holder.txtDSEName.setText(scheduleData.getParticipant().get(position).getName() + " - "
+                + scheduleData.getParticipant().get(position).getSmpin());
+        holder.txtDealerName.setText(scheduleData.getParticipant().get(position).getDealerName());
+        holder.txtAMName.setText(scheduleData.getParticipant().get(position).getAmName());
+        holder.txtTitle.setText(scheduleData.getTitle());
+        holder.txtTrainerName.setText(scheduleData.getOrganizerName());
+        holder.txtDate.setText(startDateString + " - " + endDateString);
+
+        String trainingResponseStatus = GlobalData.scheduledDataList.get(0).getParticipant().get(position).getStatus();
+
+
+        if (trainingResponseStatus.equalsIgnoreCase("1")) {
+            if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getAcknowledge_by().equalsIgnoreCase("1")) {
+                holder.btnAcknowledge.setText("Acknowledged by AM");
+            } else if (GlobalData.scheduledDataList.get(0).getParticipant().get(position).getAcknowledge_by().equalsIgnoreCase("2")) {
+                holder.btnAcknowledge.setText("Acknowledged by DSE");
+            }
+            ColorStateList colorStateList = ContextCompat.getColorStateList(context, R.color.btn_green);
+            holder.btnAcknowledge.setBackgroundTintList(colorStateList);
+        } else if (trainingResponseStatus.equalsIgnoreCase("2")) {
+            ColorStateList colorStateList = ContextCompat.getColorStateList(context, R.color.btn_red);
+            holder.btnDecline.setBackgroundTintList(colorStateList);
+            holder.txtTitle.setTextColor(Color.parseColor("#F90303"));
+            holder.imgInfo.setVisibility(View.VISIBLE);
+        }
+
+        holder.imgInfo.setTag(position);
+        holder.imgInfo.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                String header = scheduleData.getParticipant().get((Integer) v.getTag()).getDeclineReasonDesc();
+                View mView = LayoutInflater.from(context).inflate(R.layout.tooltip_layout, null);
+                TextView text = mView.findViewById(R.id.text11);
+                TextView txtReasonTitle = mView.findViewById(R.id.txtReasonTitle);
+//                if (scheduleData.getParticipant().get((Integer) v.getTag()).getDeclineReasonName() != null && !scheduleData.getParticipant().get((Integer) v.getTag()).getDeclineReasonName().equalsIgnoreCase(""))
+//                    txtReasonTitle.setText(scheduleData.getParticipant().get((Integer) v.getTag()).getDeclineReasonName());
+                text.setText(header);
+                Tooltip.TooltipView tooltip = Tooltip.make(context,
+                        new Tooltip.Builder(101)
+                                .anchor(v, Tooltip.Gravity.TOP)
+                                .closePolicy(new Tooltip.ClosePolicy()
+                                        .insidePolicy(true, false)
+                                        .outsidePolicy(true, false), 0)
+                                .activateDelay(300)
+                                .withStyleId(R.style.ToolTipLayoutCustomStyle)
+                                .showDelay(300)
+                                .text("")
+                                .setBgColor(context.getResources().getColor(R.color.bg_white))
+                                .view(mView)
+                                .maxWidth(300)
+                                .withArrow(true)
+                                .build()
+                );
+                tooltip.setTextColor(R.color.material_bluegrey800);
+                tooltip.show();
+            }
+        });
+        holder.btnDecline.setTag(position);
+        holder.btnDecline.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (trainingResponseStatus.equalsIgnoreCase("0")) {
+                    openPopup((Integer) v.getTag());
+                }
+            }
+        });
+        holder.btnAcknowledge.setTag(position);
+        holder.btnAcknowledge.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (trainingResponseStatus.equalsIgnoreCase("0")) {
+                    GlobalData.scheduledDataList.get(0).getParticipant().get((Integer) v.getTag()).setAcknowledge_by("1");
+                    sendAcknowledge("1", scheduleData.getParticipant().get((Integer) v.getTag()).getUserid(), "", "", (Integer) v.getTag());
+                }
+            }
+        });
+
+        getReasons();
+    }
+
+    @Override
+    public int getItemCount() {
+        return GlobalData.scheduledDataList.get(0).getParticipant().size();
+    }
+
+    class ViewHolder extends RecyclerView.ViewHolder {
+        TextView txtDSEName, txtDealerName, txtAMName, txtTitle, txtTrainerName, txtDate;
+        Button btnDecline, btnAcknowledge;
+        ImageView imgInfo;
+        View view;
+
+        private ViewHolder(View itemView) {
+            super(itemView);
+            view = itemView;
+            txtDSEName = itemView.findViewById(R.id.txtDSEName);
+            txtDealerName = itemView.findViewById(R.id.txtDealerName);
+            txtAMName = itemView.findViewById(R.id.txtAMName);
+            txtTitle = itemView.findViewById(R.id.txtTitle);
+            txtTrainerName = itemView.findViewById(R.id.txtTrainerName);
+            txtDate = itemView.findViewById(R.id.txtDate);
+
+            btnAcknowledge = itemView.findViewById(R.id.btnAcknowledge);
+            btnDecline = itemView.findViewById(R.id.btnDecline);
+
+            imgInfo = itemView.findViewById(R.id.imgInfo);
+
+            //   if (GlobalData.scheduledDataList.get(0).getAttendanceUpdateStatus().equalsIgnoreCase("1")) {
+//            btnAcknowledge.setEnabled(false);
+//            btnDecline.setEnabled(false);
+            //  }
+        }
+    }
+
+    private void sendAcknowledge(String status, String userID, String reasonID, String reasonDes, int position) {
+
+        HashMap<String, String> map = new HashMap<>();
+        map.put("schedule_id", GlobalData.scheduledDataList.get(0).getScheduleId());
+        map.put("userid", userID);
+        map.put("status", status);
+        map.put("acknowledge_by", "1");
+        map.put("decline_reason", reasonID);
+        map.put("decline_reason_desc", reasonDes);
+
+        restService.sendAcknowledge(map).enqueue(new Callback<CommonResponse>() {
+            @Override
+            public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                if (response.body() != null) {
+                    if (status.equalsIgnoreCase("2")) {
+                        GlobalData.scheduledDataList.get(0).getParticipant().get(position).setStatus("2");
+                        GlobalData.scheduledDataList.get(0).getParticipant().get(position).setDeclineReasonDesc(reasonDes);
+                    } else {
+                        GlobalData.scheduledDataList.get(0).getParticipant().get(position).setStatus("1");
+                    }
+                    if (dialog != null && dialog.isShowing())
+                        dialog.dismiss();
+                    notifyDataSetChanged();
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(context, message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                    }
+                }
+            }
+
+            @Override
+            public void onFailure(Call<CommonResponse> call, Throwable t) {
+
+            }
+        });
+    }
+
+    private void getReasons() {
+        if (new UtilService().isNetworkAvailable(Objects.requireNonNull(context))) {
+            try {
+                restService.getReasonList().enqueue(new Callback<ReasonListResponse>() {
+                    @Override
+                    public void onResponse(Call<ReasonListResponse> call, Response<ReasonListResponse> response) {
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            if (response.body().getData() != null && response.body().getData().size() > 0) {
+                                REASONS = response.body().getData();
+                                reasonName = new String[REASONS.size()];
+                                reasonId = new String[REASONS.size()];
+                                for (int i = 0; i < response.body().getData().size(); i++) {
+                                    reasonName[i] = REASONS.get(i).getName();
+                                    reasonId[i] = REASONS.get(i).getId();
+                                }
+                            }
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(context, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(context, message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<ReasonListResponse> call, Throwable t) {
+                    }
+                });
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private void settitleSelction(int position, EditText edtReason) {
+        int selection = 0;
+        if (!txtDecline.getText().toString().isEmpty()) {
+            selection = Arrays.asList(reasonName).indexOf(txtDecline.getText().toString().trim());
+        }
+        new AlertDialog.Builder(context).setTitle("Reason for Reschedule")
+                .setSingleChoiceItems(reasonName, selection, null)
+                .setNegativeButton("Cancel", null)
+                .setPositiveButton("Ok", (dialog, whichButton) -> {
+                    dialog.dismiss();
+                    int selectedPosition = ((AlertDialog) dialog).getListView().getCheckedItemPosition();
+                    txtDecline.setText(reasonName[selectedPosition]);
+                    if (reasonName[selectedPosition].equalsIgnoreCase("other"))
+                        edtReason.setVisibility(View.VISIBLE);
+                    reasonIdString = reasonId[selectedPosition];
+                    reasonNameString = reasonName[selectedPosition];
+                    //ParticipantList.get(0).getParticipant().get(position).setDeclineReasonDesc(reasonName[selectedPosition]);
+                })
+                .show();
+    }
+
+    public void openPopup(int position) {
+        AlertDialog.Builder builder = new AlertDialog.Builder(context);
+        View mView = LayoutInflater.from(context).inflate(R.layout.decline_popup, null);
+        txtDecline = mView.findViewById(R.id.txtDecline);
+        TextView txtHeader = mView.findViewById(R.id.txtHeader);
+        EditText edtReason = mView.findViewById(R.id.edtReason);
+        Button btnCancel = mView.findViewById(R.id.btnCancel);
+        Button btnSubmit = mView.findViewById(R.id.btnSubmit);
+
+        edtReason.setVisibility(View.GONE);
+
+        for (int i = 0; i < GlobalData.scheduledDataList.get(0).getParticipant().size(); i++) {
+            dseName = GlobalData.scheduledDataList.get(0).getParticipant().get(position).getName() + " - "
+                    + GlobalData.scheduledDataList.get(0).getParticipant().get(position).getSmpin();
+            dealerName = GlobalData.scheduledDataList.get(0).getParticipant().get(position).getDealerName();
+            amName = GlobalData.scheduledDataList.get(0).getParticipant().get(position).getAmName();
+            userID = GlobalData.scheduledDataList.get(0).getParticipant().get(position).getUserid();
+        }
+
+        String header = "Do you want to Decline the classroom request for " +
+                "DSE Name : " + dseName + "/Dealer Name : " + dealerName + "/Area Manager : " + amName + "";
+
+        txtHeader.setText(header);
+
+        ImageView imgDecline = mView.findViewById(R.id.imgDecline);
+
+        txtDecline.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                settitleSelction(position, edtReason);
+            }
+        });
+
+        imgDecline.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                settitleSelction(position, edtReason);
+            }
+        });
+
+        btnCancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dialog.dismiss();
+            }
+        });
+
+        btnSubmit.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (!txtDecline.getText().toString().isEmpty()) {
+                    setSelectedData(position, reasonNameString, edtReason.getText().toString());
+
+                    sendAcknowledge("2", userID, reasonIdString, reasonNameString, position);
+                    notifyDataSetChanged();
+                } else {
+                    GlobalData.toast(context, "Select the reason");
+                }
+            }
+        });
+
+        builder.setView(mView);
+        dialog = builder.create();
+        dialog.show();
+
+    }
+
+    private void setSelectedData(int position, String reasonNameString, String toString) {
+        ParticipantList.get(0).getParticipant().get(position).setDeclineReason(reasonNameString);
+    }
+}

+ 389 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/AssessmentListAdapter.java

@@ -0,0 +1,389 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.graphics.Color;
+import android.os.Handler;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.github.siyamed.shapeimageview.CircularImageView;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.AssessmentActivity;
+import com.cygnusa.hyperm.HomeActivity;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MyCallback;
+import com.cygnusa.hyperm.util.PositionUpdateListener;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.AnswerResponse;
+import com.cygnusa.hyperm.wrappers.AssessmentList;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+
+import retrofit2.Call;
+
+public class AssessmentListAdapter extends RecyclerView.Adapter<AssessmentListAdapter.ViewHolder> {
+
+    private ArrayList<AssessmentList> ONLINE_ASSESSMENT_LIST;
+    private Context context;
+    private String TRAINING_ID = "";
+    private String CATEGORY_ID = "";
+    private PositionUpdateListener listener;
+    private ApiService restService;
+    private TransparentProgressDialog progressDialog;
+    private ArrayList<AssessmentList> OFFLINE_ASSESSMENT_LIST = new ArrayList<>();
+    private boolean isOffline;
+
+
+    public AssessmentListAdapter(Context context, ArrayList<AssessmentList> items,
+                                 String id, PositionUpdateListener l, ApiService restService,
+                                 boolean isOffline, ArrayList<AssessmentList> assessmentLists) {
+        this.ONLINE_ASSESSMENT_LIST = items;
+        this.context = context;
+        this.TRAINING_ID = id;
+        this.listener = l;
+        this.restService = restService;
+
+        this.isOffline = isOffline;
+        this.OFFLINE_ASSESSMENT_LIST = assessmentLists;
+    }
+
+    @NonNull
+    @Override
+    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.assessment_item, parent, false);
+        return new ViewHolder(v);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+        AssessmentList item;
+        if (isOffline) {
+            item = OFFLINE_ASSESSMENT_LIST.get(position);
+        } else {
+            item = ONLINE_ASSESSMENT_LIST.get(position);
+        }
+
+        holder.view.setTag(item);
+        holder.assesmentTitle.setSelected(true);
+        holder.assesmentTitle.setText(item.getAssessmentname());
+        holder.publishedDate.setText("Published On: " + dateFormate(item.getPublisheddate()));
+
+        if (item.getStatus().equalsIgnoreCase("1")) {
+            holder.assesmentStatue.setText(item.getStatusname());
+        } else if (item.getStatus().equalsIgnoreCase("3")) {
+            holder.assesmentStatue.setText(item.getStatusname() + " On: " + dateFormate(item.getCompleted_time()));
+
+        } else if (item.getStatus().equalsIgnoreCase("7")) {
+            holder.assesmentStatue.setText(item.getStatusname());
+        } else {
+            holder.assesmentStatue.setText(item.getStatusname());
+        }
+
+
+        if (item.getAtype().equalsIgnoreCase("0")) {
+            holder.assessmentType.setText("Learning");
+            holder.image.setImageResource(R.mipmap.assessmenttype_2);
+        } else {
+            holder.assessmentType.setText("Certification");
+            holder.image.setImageResource(R.mipmap.assessmenttype_1);
+        }
+
+
+        int d = (int) Math.round(Double.parseDouble(item.getHighscore().trim()));
+        holder.score.setText(String.valueOf(d));
+
+        if (item.getStatus().trim().equalsIgnoreCase("7")) {
+            holder.scoreLayout.setBackgroundColor(Color.parseColor("#B5B5B5"));
+            holder.assesmentStatue.setTextColor(Color.parseColor("#B5B5B5"));
+        } else {
+            if (d >= 80) {
+                holder.scoreLayout.setBackgroundColor(Color.parseColor("#1D7210"));
+                // holder.assesmentStatue.setTextColor(Color.parseColor("#1D7210"));
+            } else {
+                holder.scoreLayout.setBackgroundColor(context.getResources().getColor(R.color.material_red900));
+                // holder.assesmentStatue.setTextColor(Color.parseColor("#F7412D"));
+            }
+        }
+
+        if (item.getStatus().trim().equalsIgnoreCase("3")) {
+            //holder.assesmentStatue.setTextColor(Color.parseColor("#1D7210"));
+        }
+
+
+        holder.view.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                AssessmentList assessmentList = (AssessmentList) v.getTag();
+                if (isOffline) {
+                    Cursor cursor = GlobalData.sdb.rawQuery("select * from assessment_answer where assessment_id='"
+                            + assessmentList.getAssessmentid()
+                            + "' and category_id='" + CATEGORY_ID + "' and training_id='" + TRAINING_ID + "'", null);
+                    if (cursor.getCount() == 0) {
+                        if (Integer.parseInt(assessmentList.getAttemptslimit().trim())
+                                > assessmentList.getAttempt_time()) {
+                            if (assessmentList.getIs_expired().trim().equalsIgnoreCase("0")) {
+                                AssessmentActivity.ASSESSMENT = assessmentList;
+                                AssessmentActivity.TRAINING_ID = TRAINING_ID;
+                                AssessmentActivity.CATEGORY_ID = CATEGORY_ID;
+                                AssessmentActivity.isOffline = isOffline;
+                                if (listener != null) {
+                                    listener.onPositionUpdate(OFFLINE_ASSESSMENT_LIST.indexOf(assessmentList));
+                                }
+                                context.startActivity(new Intent(context, AssessmentActivity.class));
+                            } else {
+                                GlobalData.showToast(context,
+                                        "Assessment expired", Toast.LENGTH_SHORT).show();
+                            }
+                        } else {
+                            GlobalData.showToast(context, "You have attempted this test "
+                                    + assessmentList.getAttempt_time() + " times. Please contact the admin for more details.", Toast.LENGTH_SHORT).show();
+                        }
+                    } else {
+                        GlobalData.showToast(context, "You are not allowed to made more than 1 attempt when offline", Toast.LENGTH_SHORT).show();
+                    }
+                } else {
+                    Cursor cursor = GlobalData.sdb.rawQuery("select * from assessment_answer where assessment_id='"
+                            + assessmentList.getAssessmentid()
+                            + "' and category_id='" + CATEGORY_ID + "' and training_id='" + TRAINING_ID + "'", null);
+                    if (cursor.getCount() == 0) {
+                        if (Integer.parseInt(assessmentList.getAttemptslimit().trim())
+                                > assessmentList.getAttempt_time()) {
+                            if (assessmentList.getIs_expired().trim().equalsIgnoreCase("0")) {
+                                Cursor cursor1 = GlobalData.sdb.rawQuery("select * from assessment_question where category_id='"
+                                        + CATEGORY_ID + "' and training_id='" + TRAINING_ID + "' and assessment_id='"
+                                        + assessmentList.getAssessmentid() + "'", null);
+
+                                if (cursor1.getCount() > 0 || new UtilService().isNetworkAvailable(context)) {
+                                    AssessmentActivity.ASSESSMENT = assessmentList;
+                                    AssessmentActivity.TRAINING_ID = TRAINING_ID;
+                                    AssessmentActivity.CATEGORY_ID = CATEGORY_ID;
+                                    AssessmentActivity.isOffline = isOffline;
+                                    if (listener != null) {
+                                        listener.onPositionUpdate(ONLINE_ASSESSMENT_LIST.indexOf(assessmentList));
+                                    }
+                                    context.startActivity(new Intent(context, AssessmentActivity.class));
+                                } else {
+                                    GlobalData.showToast(context,
+                                            "Please check your internet connection", Toast.LENGTH_SHORT).show();
+                                }
+                            } else {
+                                GlobalData.showToast(context,
+                                        "Assessment expired", Toast.LENGTH_SHORT).show();
+                            }
+                        } else {
+                            GlobalData.showToast(context, "You have attempted this test "
+                                    + assessmentList.getAttempt_time() + " times. Please contact the admin for more details.", Toast.LENGTH_SHORT).show();
+                        }
+                    } else {
+                        GlobalData.showToast(context, "You are not allowed to made more than 1 attempt when offline", Toast.LENGTH_SHORT).show();
+                    }
+                }
+            }
+        });
+
+//        holder.errorImage.setId(position);
+//        holder.errorImage.setOnClickListener(new View.OnClickListener() {
+//            @Override
+//            public void onClick(View v) {
+//                String str = (String) v.getTag();
+//                str = str == null ? "" : str;
+//                Tooltip.TooltipView tooltip = Tooltip.make(context,
+//                        new Tooltip.Builder(101)
+//                                .anchor(v, Tooltip.Gravity.LEFT)
+//                                .closePolicy(new Tooltip.ClosePolicy()
+//                                        .insidePolicy(true, false)
+//                                        .outsidePolicy(true, false), 5000)
+//                                .activateDelay(800)
+//                                .withStyleId(R.style.ToolTipLayoutCustomStyle)
+//                                .showDelay(300)
+//                                .text(str)
+//                                .maxWidth(500)
+//                                .withArrow(true)
+//                                .withOverlay(true)
+//                                .floatingAnimation(Tooltip.AnimationBuilder.DEFAULT)
+//                                .build()
+//                );
+//                tooltip.setTextColor(Color.WHITE);
+//                tooltip.show();
+//            }
+//        });
+
+    }
+
+
+    public String dateFormate(String dte) {
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date newDate = null;
+        try {
+            newDate = format.parse(dte);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        format = new SimpleDateFormat("dd-MMM-yyyy");
+        String date = format.format(newDate);
+
+
+        return date;
+    }
+
+    private void updateLocalAssessment(int id) {
+        if (new UtilService().isNetworkAvailable(context)) {
+            Cursor cursor1 = GlobalData.sdb.rawQuery("select * from assessment_answer where assessment_id='"
+                    + ONLINE_ASSESSMENT_LIST.get(id).getAssessmentid()
+                    + "' and category_id='" + CATEGORY_ID + "' and training_id='" + TRAINING_ID + "'", null);
+            if (cursor1.getCount() != 0) {
+                cursor1.moveToFirst();
+                Gson gson = new Gson();
+                HashMap<String, String> map = gson.fromJson(
+                        cursor1.getString(cursor1.getColumnIndex("assessment_answer")),
+                        new TypeToken<HashMap<String, String>>() {
+                        }.getType());
+                progressDialog = new TransparentProgressDialog(context);
+                progressDialog.show();
+
+                restService.postAssessment(cursor1.getString(cursor1.getColumnIndex("assessment_id")), map)
+                        .enqueue(new MyCallback<AnswerResponse>(cursor1.getInt(cursor1.getColumnIndex("id"))) {
+                            @Override
+                            public void onResponse(Call<AnswerResponse> call, retrofit2.Response<AnswerResponse> response) {
+                                if (progressDialog != null && progressDialog.isShowing()) {
+                                    progressDialog.dismiss();
+                                }
+                                if (response.body() != null && response.body().getStatus() == 200) {
+                                    Cursor cursor = GlobalData.sdb.rawQuery("select * from assessment_answer where id=" + id, null);
+                                    if (cursor.getCount() > 0) {
+                                        cursor.moveToFirst();
+                                        GlobalData.sdb.execSQL("delete from assessment_question where assessment_id='"
+                                                + cursor.getString(cursor.getColumnIndex("assessment_id"))
+                                                + "' and category_id='" + cursor.getString(cursor.getColumnIndex("category_id"))
+                                                + "' and training_id='" + cursor.getString(cursor.getColumnIndex("training_id")) + "'");
+
+                                        GlobalData.sdb.execSQL("delete from assessment where assessment_id='"
+                                                + cursor.getString(cursor.getColumnIndex("assessment_id"))
+                                                + "' and category_id='" + cursor.getString(cursor.getColumnIndex("category_id"))
+                                                + "' and training_id='" + cursor.getString(cursor.getColumnIndex("training_id")) + "'");
+
+                                        GlobalData.sdb.execSQL("delete from assessment_answer where id=" + id);
+                                    }
+                                    try {
+                                        ONLINE_ASSESSMENT_LIST.get(id).setHighscore(response.body()
+                                                .getData().getPercentage_score());
+                                    } catch (Exception e) {
+                                        e.printStackTrace();
+                                    }
+                                } else if (response.body() != null && response.body().getStatus() == 401) {
+                                    GlobalData.canLogout = true;
+                                    new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                                } else if (response.body() != null) {
+                                    GlobalData.sdb.execSQL("update assessment_answer set error='"
+                                            + response.body().getMessage() + "' where id=" + id);
+                                } else if (response.errorBody() != null) {
+                                    Gson gson = new Gson();
+                                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                                    GlobalData.sdb.execSQL("update assessment_answer set error='"
+                                            + message.getMessage() + "' where id=" + id);
+                                    if (message.getStatus() == 401) {
+                                        GlobalData.canLogout = true;
+                                        new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                                    }
+                                }
+                                notifyDataSetChanged();
+                            }
+
+                            @Override
+                            public void onFailure(Call<AnswerResponse> call, Throwable t) {
+                                if (progressDialog != null && progressDialog.isShowing()) {
+                                    progressDialog.dismiss();
+                                }
+                                GlobalData.showToast(context, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                            }
+                        });
+            } else {
+                GlobalData.showToast(context, "No local assessment found", Toast.LENGTH_SHORT).show();
+            }
+        } else {
+            GlobalData.showToast(context, "Please check your internet connection", Toast.LENGTH_SHORT).show();
+        }
+    }
+
+    @Override
+    public int getItemCount() {
+        if (isOffline) {
+            return OFFLINE_ASSESSMENT_LIST.size();
+        } else {
+            return ONLINE_ASSESSMENT_LIST.size();
+        }
+    }
+
+    public void add(AssessmentList item, int position) {
+        if (isOffline) {
+            OFFLINE_ASSESSMENT_LIST.add(position, item);
+        } else {
+            ONLINE_ASSESSMENT_LIST.add(position, item);
+        }
+        notifyItemInserted(position);
+    }
+
+    public void add(AssessmentList item) {
+        if (isOffline) {
+            OFFLINE_ASSESSMENT_LIST.add(item);
+            notifyItemInserted(OFFLINE_ASSESSMENT_LIST.size());
+        } else {
+            ONLINE_ASSESSMENT_LIST.add(item);
+            notifyItemInserted(ONLINE_ASSESSMENT_LIST.size());
+        }
+    }
+
+    public void remove(int position) {
+        if (isOffline) {
+            OFFLINE_ASSESSMENT_LIST.remove(position);
+        } else {
+            ONLINE_ASSESSMENT_LIST.remove(position);
+        }
+        notifyItemRemoved(position);
+    }
+
+    class ViewHolder extends RecyclerView.ViewHolder {
+        LinearLayout scoreLayout;
+        TextView assesmentTitle, assesmentStatue, score, assessmentType, publishedDate, completedDate;
+        View view;
+        ImageView errorImage;
+        CircularImageView image;
+
+        private ViewHolder(View itemView) {
+            super(itemView);
+            view = itemView;
+
+            scoreLayout = itemView.findViewById(R.id.scoreLayout);
+            assesmentTitle = itemView.findViewById(R.id.assessment_title);
+            image = itemView.findViewById(R.id.image);
+            assesmentStatue = itemView.findViewById(R.id.completedDate);
+            publishedDate = itemView.findViewById(R.id.publishedDate);
+            completedDate = itemView.findViewById(R.id.completedDate);
+            score = itemView.findViewById(R.id.score);
+            assessmentType = itemView.findViewById(R.id.assessment_type);
+            // errorImage = itemView.findViewById(R.id.errorImage);
+        }
+
+    }
+}

+ 92 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/AttendanceAdapter.java

@@ -0,0 +1,92 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.content.Context;
+import android.graphics.Color;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.github.siyamed.shapeimageview.CircularImageView;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.DSE;
+
+import java.util.ArrayList;
+
+
+public class AttendanceAdapter extends BaseAdapter {
+
+    private ArrayList<DSE> items;
+    private LayoutInflater inflater;
+    private String organisor;
+    private Context context;
+    private String profile;
+
+    public AttendanceAdapter(Context context, ArrayList<DSE> items, String organisor, String profile) {
+        this.items = items;
+        inflater = LayoutInflater.from(context);
+        this.organisor = organisor;
+        this.context = context;
+        this.profile = profile;
+    }
+
+    @Override
+    public int getCount() {
+        return items.size() + 1;
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return null;
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return 0;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        ViewHolder holder;
+        if (convertView == null) {
+            holder = new ViewHolder();
+            convertView = inflater.inflate(R.layout.attendance_item, null);
+            holder.name = convertView.findViewById(R.id.name);
+            holder.status = convertView.findViewById(R.id.status);
+            holder.userIcon = convertView.findViewById(R.id.userIcon);
+            convertView.setTag(holder);
+        } else {
+            holder = (ViewHolder) convertView.getTag();
+        }
+
+        if (position == 0) {
+            holder.name.setText(organisor);
+            holder.status.setVisibility(View.VISIBLE);
+            holder.name.setTextColor(Color.BLACK);
+            Glide.with(context).load(profile)
+                    .thumbnail(Glide.with(context).load(R.drawable.gif_loader))
+                    .into(holder.userIcon);
+        } else {
+            holder.name.setText(items.get(position - 1).getName());
+            Glide.with(context).load(items.get(position - 1).getProfile())
+                    .thumbnail(Glide.with(context).load(R.drawable.gif_loader))
+                    .into(holder.userIcon);
+
+            holder.status.setVisibility(View.GONE);
+            if (items.get(position - 1).isActive()) {
+                holder.name.setTextColor(Color.BLACK);
+            } else {
+                holder.name.setTextColor(Color.parseColor("#9e9e9e"));
+            }
+        }
+
+        return convertView;
+    }
+
+    static class ViewHolder {
+        TextView name, status;
+        CircularImageView userIcon;
+    }
+}

+ 138 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/BulletinAdapter.java

@@ -0,0 +1,138 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.github.siyamed.shapeimageview.CircularImageView;
+import com.cygnusa.hyperm.BulletinDetails;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.Bulletin;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+
+
+public class BulletinAdapter extends RecyclerView.Adapter<BulletinAdapter.ViewHolder> {
+
+    private ArrayList<Bulletin> items;
+    private Context context;
+    private Bulletin TOPIC;
+
+    public BulletinAdapter(Context context, ArrayList<Bulletin> item) {
+
+        this.items = item;
+        this.context = context;
+    }
+
+    @NonNull
+    @Override
+    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.bulletin_item, parent, false);
+
+        return new ViewHolder(v);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+        Bulletin item = items.get(position);
+
+        holder.view.setTag(item);
+        holder.title.setText(item.getBulletin_title());
+        holder.description.setText(item.getBulletin_desc());
+        holder.description.setSelected(true);
+        holder.title.setSelected(true);
+        try {
+            holder.publishedDate.setText("Published On: " + dateFormate(item.getPublished_date()));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        Glide.with(context).load(item.getImage_url())
+                .thumbnail(Glide.with(context).load(R.drawable.gif_loader))
+                .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                        .placeholder(R.drawable.placeholder)).into(holder.image);
+        holder.view.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                BulletinDetails.CONTENT = (Bulletin) v.getTag();
+                Intent bulletinIntent = new Intent(context, BulletinDetails.class);
+                bulletinIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                bulletinIntent.putExtra("bulletinId", item.getBulletin_id());
+                context.startActivity(bulletinIntent);
+
+            }
+        });
+
+    }
+
+
+    @Override
+    public int getItemCount() {
+        return items.size();
+    }
+
+    public void add(Bulletin item, int position) {
+        items.add(position, item);
+        notifyItemInserted(position);
+    }
+
+    public void add(Bulletin item) {
+        items.add(item);
+        notifyItemInserted(items.size());
+    }
+
+    public void remove(int position) {
+        items.remove(position);
+        notifyItemRemoved(position);
+    }
+
+    class ViewHolder extends RecyclerView.ViewHolder {
+        ImageView rightArrow, logo;
+        CircularImageView image;
+        TextView title, description, publishedDate;
+        View view;
+
+        private ViewHolder(View itemView) {
+            super(itemView);
+            view = itemView;
+            image = itemView.findViewById(R.id.image);
+            title = itemView.findViewById(R.id.text_title);
+            description = itemView.findViewById(R.id.text_desc);
+            publishedDate = itemView.findViewById(R.id.publishedDate);
+            logo = itemView.findViewById(R.id.logo);
+            rightArrow = itemView.findViewById(R.id.right_arrow);
+        }
+
+    }
+
+    public String dateFormate(String dte) {
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date newDate = null;
+        try {
+            newDate = format.parse(dte);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        format = new SimpleDateFormat("dd-MMM-yyyy");
+        String date = format.format(newDate);
+
+
+        return date;
+    }
+}

+ 109 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/CompareComparisionExpandableListAdapter.java

@@ -0,0 +1,109 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.content.Context;
+import android.graphics.Typeface;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseExpandableListAdapter;
+import android.widget.TextView;
+
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.RootGetAllComparisonModel;
+
+
+public class CompareComparisionExpandableListAdapter extends BaseExpandableListAdapter {
+
+
+    private Context _context;
+    private RootGetAllComparisonModel comparisonModel;
+
+    public CompareComparisionExpandableListAdapter(Context context, RootGetAllComparisonModel compareModel) {
+        this._context = context;
+        this.comparisonModel = compareModel;
+
+    }
+
+    @Override
+    public int getGroupCount() {
+        return this.comparisonModel.getDataModel().getComparisonCategoryList().size();
+    }
+
+    @Override
+    public int getChildrenCount(int groupPosition) {
+        return comparisonModel.getDataModel().getComparisonCategoryList().get(groupPosition).getFields().size();
+    }
+
+    @Override
+    public Object getGroup(int groupPosition) {
+        return this.comparisonModel.getDataModel().getComparisonCategoryList().get(0);
+    }
+
+    @Override
+    public Object getChild(int groupPosition, int childPosition) {
+        return this.comparisonModel.getDataModel().getComparisonCategoryList().get(groupPosition).getFields().get(childPosition);
+    }
+
+    @Override
+    public long getGroupId(int groupPosition) {
+        return groupPosition;
+    }
+
+    @Override
+    public long getChildId(int groupPosition, int childPosition) {
+        return childPosition;
+    }
+
+    @Override
+    public boolean hasStableIds() {
+        return false;
+    }
+
+    @Override
+    public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
+        //String headerTitle = comparisonModel.getDataModel().getCompareModel().get(0).getCategory().get(groupPosition).getTitle();
+
+        String headerTitle = comparisonModel.getDataModel().getComparisonCategoryList().get(groupPosition).getTitle();
+
+        if (convertView == null) {
+            LayoutInflater infalInflater = (LayoutInflater) this._context
+                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            convertView = infalInflater.inflate(R.layout.list_header, null);
+        }
+
+        TextView lblListHeader = (TextView) convertView
+                .findViewById(R.id.list_header);
+        lblListHeader.setTypeface(null, Typeface.BOLD);
+        lblListHeader.setText(headerTitle);
+        lblListHeader.setSingleLine(true);
+        lblListHeader.setVisibility(View.INVISIBLE);
+
+
+        return convertView;
+    }
+
+    @Override
+    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
+
+        final String childText = comparisonModel.getDataModel().getComparisonCategoryList().get(groupPosition).getFields().get(childPosition).getValue();
+
+        if (convertView == null) {
+            LayoutInflater infalInflater = (LayoutInflater) this._context
+                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            convertView = infalInflater.inflate(R.layout.list_item, null);
+        }
+
+        TextView txtListChild = (TextView) convertView
+                .findViewById(R.id.list_item);
+
+        txtListChild.setText(childText);
+        txtListChild.setSingleLine(true);
+
+        return convertView;
+    }
+
+    @Override
+    public boolean isChildSelectable(int groupPosition, int childPosition) {
+        return true;
+    }
+}

+ 152 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/ComparisionChildAdapter.java

@@ -0,0 +1,152 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.content.Context;
+import androidx.core.content.ContextCompat;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseExpandableListAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.ComparisonCategory;
+import com.cygnusa.hyperm.wrappers.ComparisonCompareDataCategory;
+import com.cygnusa.hyperm.wrappers.ComparisonCompareDataField;
+
+import java.util.List;
+
+public class ComparisionChildAdapter extends BaseExpandableListAdapter {
+
+
+    private Context _context;
+    private List<ComparisonCompareDataCategory> comparisonCategories;
+    List<ComparisonCategory> checkColorList;
+
+    public ComparisionChildAdapter(Context context, List<ComparisonCompareDataCategory> comparisonCategories, List<ComparisonCategory> comparisonCategoryList) {
+        this._context = context;
+        this.comparisonCategories = comparisonCategories;
+        this.checkColorList = comparisonCategoryList;
+
+    }
+
+    @Override
+    public int getGroupCount() {
+        return comparisonCategories.size();
+    }
+
+    @Override
+    public int getChildrenCount(int groupPosition) {
+        return comparisonCategories.get(groupPosition).getFields().size();
+    }
+
+    @Override
+    public ComparisonCompareDataCategory getGroup(int groupPosition) {
+        return comparisonCategories.get(groupPosition);
+    }
+
+    @Override
+    public ComparisonCompareDataField getChild(int groupPosition, int childPosition) {
+        return comparisonCategories.get(groupPosition).getFields().get(childPosition);
+    }
+
+    @Override
+    public long getGroupId(int groupPosition) {
+        return groupPosition;
+    }
+
+    @Override
+    public long getChildId(int groupPosition, int childPosition) {
+        return childPosition;
+    }
+
+    @Override
+    public boolean hasStableIds() {
+        return false;
+    }
+
+    @Override
+    public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
+        ComparisonCompareDataCategory category = getGroup(groupPosition);
+        ParentViewHolder holder;
+        if (convertView == null) {
+            LayoutInflater infalInflater = (LayoutInflater) this._context
+                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            convertView = infalInflater.inflate(R.layout.list_header, null);
+            holder = new ParentViewHolder(convertView);
+            convertView.setTag(holder);
+        } else {
+            holder = (ParentViewHolder) convertView.getTag();
+        }
+        holder.list_header.setText(category.getTitle());
+        holder.list_header.setTextColor(ContextCompat.getColor(_context, R.color.material_bluegrey800));
+
+        holder.list_header.setCompoundDrawablesWithIntrinsicBounds(0, 0, android.R.drawable.arrow_down_float, 0);
+        return convertView;
+    }
+
+    @Override
+    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
+
+        ComparisonCompareDataField field = getChild(groupPosition, childPosition);
+        ChildViewHolder holder;
+        if (convertView == null) {
+            LayoutInflater infalInflater = (LayoutInflater) this._context
+                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            assert infalInflater != null;
+            convertView = infalInflater.inflate(R.layout.child_list_item_new, null);
+            holder = new ChildViewHolder(convertView);
+            convertView.setTag(holder);
+        } else {
+            holder = (ChildViewHolder) convertView.getTag();
+        }
+        holder.list_item_value.setText(field.getValue());
+
+        String fieldValue = field.getValue().trim();
+        String childValue = checkColorList.get(groupPosition).getFields().get(childPosition).getValue().trim();
+
+
+        if(fieldValue.equalsIgnoreCase(childValue)){
+            holder.list_item_color.setVisibility(View.GONE);
+            holder.list_item_value.setVisibility(View.VISIBLE);
+            holder.list_item_value.setText(childValue+"");
+        }
+//        if (fieldValue.equalsIgnoreCase(childValue)) {
+//            holder.list_item_color.setVisibility(View.VISIBLE);
+//            holder.list_item_value.setVisibility(View.GONE);
+//            holder.list_item_color.setImageDrawable(ContextCompat.getDrawable(_context, R.mipmap.right));
+//        } else if (TextUtils.isEmpty(fieldValue) || fieldValue.equalsIgnoreCase("") || fieldValue.equalsIgnoreCase("NA")) {
+//            holder.list_item_color.setVisibility(View.VISIBLE);
+//            holder.list_item_value.setVisibility(View.GONE);
+//            holder.list_item_color.setImageDrawable(ContextCompat.getDrawable(_context, R.mipmap.cancel));
+//        } else {
+//            holder.list_item_color.setVisibility(View.GONE);
+//            holder.list_item_value.setVisibility(View.VISIBLE);
+//        }
+
+        return convertView;
+    }
+
+    @Override
+    public boolean isChildSelectable(int groupPosition, int childPosition) {
+        return true;
+    }
+
+    static class ParentViewHolder {
+        TextView list_header;
+
+        ParentViewHolder(View view) {
+            list_header = view.findViewById(R.id.list_header);
+        }
+    }
+
+    static class ChildViewHolder {
+        TextView list_item_value;
+        ImageView list_item_color;
+
+        ChildViewHolder(View view) {
+            list_item_value = view.findViewById(R.id.list_item_value);
+            list_item_color = view.findViewById(R.id.list_item_color);
+        }
+    }
+}

+ 122 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/ComparisionExpandableListAdapter.java

@@ -0,0 +1,122 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseExpandableListAdapter;
+import android.widget.TextView;
+
+
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.ComparisonCategory;
+import com.cygnusa.hyperm.wrappers.ComparisonField;
+
+import java.util.List;
+
+public class ComparisionExpandableListAdapter extends BaseExpandableListAdapter {
+
+
+  private Context _context;
+  private List<ComparisonCategory> comparisonCategories;
+
+  public ComparisionExpandableListAdapter(Context context, List<ComparisonCategory> comparisonCategories) {
+    this._context = context;
+    this.comparisonCategories = comparisonCategories;
+
+  }
+
+  @Override
+  public int getGroupCount() {
+    return comparisonCategories.size();
+  }
+
+  @Override
+  public int getChildrenCount(int groupPosition) {
+    return comparisonCategories.get(groupPosition).getFields().size();
+  }
+
+  @Override
+  public ComparisonCategory getGroup(int groupPosition) {
+    return comparisonCategories.get(groupPosition);
+  }
+
+  @Override
+  public ComparisonField getChild(int groupPosition, int childPosition) {
+    return comparisonCategories.get(groupPosition).getFields().get(childPosition);
+  }
+
+  @Override
+  public long getGroupId(int groupPosition) {
+    return groupPosition;
+  }
+
+  @Override
+  public long getChildId(int groupPosition, int childPosition) {
+    return childPosition;
+  }
+
+  @Override
+  public boolean hasStableIds() {
+    return false;
+  }
+
+  @Override
+  public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
+    ComparisonCategory category = getGroup(groupPosition);
+    ParentViewHolder holder;
+    if (convertView == null) {
+      LayoutInflater infalInflater = (LayoutInflater) this._context
+              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+      convertView = infalInflater.inflate(R.layout.list_header, null);
+      holder = new ParentViewHolder(convertView);
+      convertView.setTag(holder);
+    } else {
+      holder = (ParentViewHolder) convertView.getTag();
+    }
+    holder.list_header.setText(category.getTitle());
+    return convertView;
+  }
+
+  @Override
+  public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
+
+    ComparisonField field = getChild(groupPosition, childPosition);
+    ChildViewHolder holder;
+    if (convertView == null) {
+      LayoutInflater infalInflater = (LayoutInflater) this._context
+              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+      convertView = infalInflater.inflate(R.layout.child_list_item, null);
+      holder = new ChildViewHolder(convertView);
+      convertView.setTag(holder);
+    } else {
+      holder = (ChildViewHolder) convertView.getTag();
+    }
+    holder.list_item_type.setText(field.getTitle());
+    holder.list_item_value.setText(field.getValue());
+
+    return convertView;
+  }
+
+  @Override
+  public boolean isChildSelectable(int groupPosition, int childPosition) {
+    return true;
+  }
+
+  static class ParentViewHolder {
+    TextView list_header;
+
+    ParentViewHolder(View view) {
+      list_header = view.findViewById(R.id.list_header);
+    }
+  }
+
+  static class ChildViewHolder {
+    TextView list_item_type, list_item_value;
+
+    ChildViewHolder(View view) {
+      list_item_type = view.findViewById(R.id.list_item_type);
+      list_item_value = view.findViewById(R.id.list_item_value);
+    }
+  }
+}

+ 176 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/ComparisionExpandableListAdapterNew.java

@@ -0,0 +1,176 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseExpandableListAdapter;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.ComparisonCategory;
+import com.cygnusa.hyperm.wrappers.ComparisonCompareDataCategory;
+import com.cygnusa.hyperm.wrappers.ComparisonField;
+
+import java.util.List;
+
+public class ComparisionExpandableListAdapterNew extends BaseExpandableListAdapter {
+
+
+    private Context _context;
+    private List<ComparisonCategory> comparisonCategories;
+    private List<ComparisonCompareDataCategory> comparisonOne;
+    private List<ComparisonCompareDataCategory> comparisonTwo;
+
+    public ComparisionExpandableListAdapterNew(Context context, List<ComparisonCategory> comparisonCategories,
+                                               List<ComparisonCompareDataCategory> comparisonOne,
+                                               List<ComparisonCompareDataCategory> comparisonTwo) {
+        this._context = context;
+        this.comparisonCategories = comparisonCategories;
+        this.comparisonOne = comparisonOne;
+        this.comparisonTwo = comparisonTwo;
+
+    }
+
+    @Override
+    public int getGroupCount() {
+        return comparisonCategories.size();
+    }
+
+    @Override
+    public int getChildrenCount(int groupPosition) {
+        return comparisonCategories.get(groupPosition).getFields().size();
+    }
+
+    @Override
+    public ComparisonCategory getGroup(int groupPosition) {
+        return comparisonCategories.get(groupPosition);
+    }
+
+    @Override
+    public ComparisonField getChild(int groupPosition, int childPosition) {
+        return comparisonCategories.get(groupPosition).getFields().get(childPosition);
+    }
+
+    @Override
+    public long getGroupId(int groupPosition) {
+        return groupPosition;
+    }
+
+    @Override
+    public long getChildId(int groupPosition, int childPosition) {
+        return childPosition;
+    }
+
+    @Override
+    public boolean hasStableIds() {
+        return false;
+    }
+
+    @Override
+    public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
+        ComparisonCategory category = getGroup(groupPosition);
+        ParentViewHolder holder;
+        if (convertView == null) {
+            LayoutInflater infalInflater = (LayoutInflater) this._context
+                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            convertView = infalInflater.inflate(R.layout.list_header_new, null);
+            holder = new ParentViewHolder(convertView);
+            convertView.setTag(holder);
+        } else {
+            holder = (ParentViewHolder) convertView.getTag();
+        }
+        holder.list_header.setText(category.getTitle());
+
+        if (comparisonOne == null) {
+            holder.headerOne.setVisibility(View.INVISIBLE);
+        } else {
+            holder.headerOne.setVisibility(View.VISIBLE);
+            holder.list_header_one.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.mipmap.dropdown_new, 0);
+        }
+
+        if (comparisonTwo == null) {
+            holder.headerTwo.setVisibility(View.INVISIBLE);
+        } else {
+            holder.list_header_one.setCompoundDrawables(null, null, null, null);
+            holder.headerTwo.setVisibility(View.VISIBLE);
+        }
+
+        return convertView;
+    }
+
+    @Override
+    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
+
+        ComparisonField field = getChild(groupPosition, childPosition);
+        ChildViewHolder holder;
+        if (convertView == null) {
+            LayoutInflater infalInflater = (LayoutInflater) this._context
+                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            convertView = infalInflater.inflate(R.layout.list_item_new, null);
+            holder = new ChildViewHolder(convertView);
+            convertView.setTag(holder);
+        } else {
+            holder = (ChildViewHolder) convertView.getTag();
+        }
+        holder.list_item_type.setText(field.getTitle());
+        holder.list_item_value.setText(field.getValue());
+
+        if (comparisonOne == null) {
+            holder.itemOne.setVisibility(View.INVISIBLE);
+        } else {
+            holder.itemOne.setVisibility(View.VISIBLE);
+            holder.list_item_value_one.setText(comparisonOne.get(groupPosition).getFields().get(childPosition).getValue());
+        }
+
+        if (comparisonTwo == null) {
+            holder.itemTwo.setVisibility(View.INVISIBLE);
+        } else {
+            holder.itemTwo.setVisibility(View.VISIBLE);
+            holder.list_item_value_two.setText(comparisonTwo.get(groupPosition).getFields().get(childPosition).getValue());
+        }
+
+        return convertView;
+    }
+
+    @Override
+    public boolean isChildSelectable(int groupPosition, int childPosition) {
+        return true;
+    }
+
+    public void update(List<ComparisonCompareDataCategory> comparisonOne,
+                       List<ComparisonCompareDataCategory> comparisonTwo) {
+        this.comparisonOne = comparisonOne;
+        this.comparisonTwo = comparisonTwo;
+        notifyDataSetChanged();
+    }
+
+    static class ParentViewHolder {
+        TextView list_header, list_header_one, list_header_two;
+        LinearLayout headerOne, headerTwo;
+
+        ParentViewHolder(View view) {
+            list_header = view.findViewById(R.id.list_header);
+            list_header_one = view.findViewById(R.id.list_header_one);
+            list_header_two = view.findViewById(R.id.list_header_two);
+            headerTwo = view.findViewById(R.id.headerTwo);
+            headerOne = view.findViewById(R.id.headerOne);
+        }
+    }
+
+    static class ChildViewHolder {
+        TextView list_item_type, list_item_value, list_item_value_one, list_item_value_two;
+        LinearLayout itemOne, itemTwo;
+
+        ChildViewHolder(View view) {
+            list_item_type = view.findViewById(R.id.list_item_type);
+            list_item_value = view.findViewById(R.id.list_item_value);
+            list_item_value_one = view.findViewById(R.id.list_item_value_one);
+            list_item_value_two = view.findViewById(R.id.list_item_value_two);
+
+            itemOne = view.findViewById(R.id.itemOne);
+            itemTwo = view.findViewById(R.id.itemTwo);
+        }
+    }
+}

+ 132 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/ComparisonCompareModelLayoutAdapter.java

@@ -0,0 +1,132 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.content.Context;
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.ComparisonCompareModel;
+
+import java.util.List;
+
+public class ComparisonCompareModelLayoutAdapter extends RecyclerView.Adapter<ComparisonCompareModelLayoutAdapter.ViewHolder> {
+    List<ComparisonCompareModel> body;
+    Context activity;
+    int totalSize = 0, comparePositionModel;
+
+    public ComparisonCompareModelLayoutAdapter(Context activity, List<ComparisonCompareModel> body, int comparePositionModel) {
+        this.activity = activity;
+        this.body = body;
+        this.comparePositionModel = comparePositionModel;
+    }
+
+    @NonNull
+    @Override
+    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int i) {
+        View itemView = LayoutInflater.from(parent.getContext())
+                .inflate(R.layout.adapter_drag_comparison_list, parent, false);
+
+        return new ViewHolder(itemView);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) {
+//        viewHolder.textView_parentName.setText(body.get(comparePositionModel).getCategory().get(i).getTitle());
+//        viewHolder.textView_parentName.setTextColor(ContextCompat.getColor(activity,R.color.whitecolor));
+//        Log.e("noOfChildTextViews", body.get(comparePositionModel).getCategory().get(i).getTitle() + String.valueOf(i));
+
+        int noOfChildTextViews = viewHolder.linearLayout_childItems.getChildCount();
+        int noOfChild = body.get(comparePositionModel).getCategory().get(i).getFields().size();
+
+        if (noOfChild < noOfChildTextViews) {
+            for (int index = noOfChild; index < noOfChildTextViews; index++) {
+                TextView currentTextView = (TextView) viewHolder.linearLayout_childItems.getChildAt(index);
+                TextView valueTextView = (TextView) viewHolder.linearLayout_child_values.getChildAt(index);
+                valueTextView.setVisibility(View.GONE);
+                currentTextView.setVisibility(View.GONE);
+            }
+        }
+        for (int textViewIndex = 0; textViewIndex < noOfChild; textViewIndex++) {
+            TextView currentTextView = (TextView) viewHolder.linearLayout_childItems.getChildAt(textViewIndex);
+            TextView valueTextView = (TextView) viewHolder.linearLayout_child_values.getChildAt(textViewIndex);
+
+            //currentTextView.setText(body.get(comparePositionModel).getCategory().get(i).getFields().get(textViewIndex).getTitle());
+            valueTextView.setText(body.get(comparePositionModel).getCategory().get(i).getFields().get(textViewIndex).getValue());
+        }
+    }
+
+
+    @Override
+    public int getItemCount() {
+        Log.e("return size", String.valueOf(body.get(comparePositionModel).getCategory().size()));
+        return body.get(comparePositionModel).getCategory().size();
+    }
+
+    public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+        TextView textView_parentName;
+        LinearLayout linearLayout_childItems, linearLayout_child_values/*, linearLayout_colan*/;
+
+        public ViewHolder(@NonNull View itemView) {
+            super(itemView);
+            textView_parentName = itemView.findViewById(R.id.tv_parentName);
+            linearLayout_childItems = itemView.findViewById(R.id.ll_child_items);
+            linearLayout_child_values = itemView.findViewById(R.id.ll_child_values);
+
+            linearLayout_childItems.setVisibility(View.GONE);
+            linearLayout_child_values.setVisibility(View.VISIBLE);
+            int intMaxNoOfChild = 0;
+            for (int index = 0; index < body.get(comparePositionModel).getCategory().size(); index++) {
+                int intMaxSizeTemp = body.get(comparePositionModel).getCategory().get(index).getFields().size();
+                if (intMaxSizeTemp > intMaxNoOfChild) intMaxNoOfChild = intMaxSizeTemp;
+            }
+            for (int indexView = 0; indexView < intMaxNoOfChild; indexView++) {
+                TextView textView = new TextView(activity);
+                textView.setId(indexView);
+                textView.setPadding(20, 20, 20, 20);
+                textView.setGravity(Gravity.START | Gravity.START);
+                //textView.setBackground(ContextCompat.getDrawable(activity, R.drawable.background_sub_module_text));
+                LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
+                textView.setOnClickListener(this);
+                textView.setSingleLine(true);
+                linearLayout_childItems.addView(textView, layoutParams);
+
+                TextView textViewValues = new TextView(activity);
+                textViewValues.setId(indexView);
+                textViewValues.setPadding(20, 20, 20, 20);
+                textViewValues.setGravity(Gravity.START | Gravity.START);
+                //textViewValues.setBackground(ContextCompat.getDrawable(activity, R.drawable.background_sub_module_text));
+                LinearLayout.LayoutParams layoutParamsValues = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
+                textView.setOnClickListener(this);
+                textViewValues.setSingleLine(true);
+                linearLayout_child_values.addView(textViewValues, layoutParamsValues);
+
+            }
+            textView_parentName.setOnClickListener(this);
+        }
+
+        @Override
+        public void onClick(View v) {
+            if (v.getId() == R.id.tv_parentName) {
+                if (linearLayout_child_values.getVisibility() == View.VISIBLE) {
+                    linearLayout_childItems.setVisibility(View.GONE);
+                    linearLayout_child_values.setVisibility(View.VISIBLE);
+                } else {
+                    linearLayout_childItems.setVisibility(View.GONE);
+                    linearLayout_child_values.setVisibility(View.VISIBLE);
+                }
+            } else {
+                TextView textViewClicked = (TextView) v;
+                Toast.makeText(activity, "" + textViewClicked.getText().toString(), Toast.LENGTH_SHORT).show();
+            }
+        }
+    }
+}

+ 193 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/ContentAdapter.java

@@ -0,0 +1,193 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Color;
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.github.siyamed.shapeimageview.CircularImageView;
+import com.cygnusa.hyperm.AudioViewActivity;
+import com.cygnusa.hyperm.PdfViewActivity;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.VideoViewActivity;
+import com.cygnusa.hyperm.wrappers.ContentFile;
+import com.cygnusa.hyperm.wrappers.MyContent;
+import com.cygnusa.hyperm.wrappers.MyTopic;
+import com.cygnusa.hyperm.wrappers.TrainingCategory;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+
+public class ContentAdapter extends RecyclerView.Adapter<ContentAdapter.ViewHolder> {
+
+    private ArrayList<MyContent> items;
+    private Context context;
+    private MyTopic TOPIC;
+    private TrainingCategory myTraining;
+
+    public ContentAdapter(Context context, ArrayList<MyContent> items, MyTopic myTopic,TrainingCategory myTraining) {
+        this.items = items;
+        this.TOPIC = myTopic;
+        this.myTraining=myTraining;
+        this.context = context;
+    }
+
+    @NonNull
+    @Override
+    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.content_item, parent, false);
+        v.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                MyContent item = (MyContent) v.getTag();
+                ContentFile file = getContentFile(item);
+                assert file != null;
+                if (file.getFiletypeid().trim().equalsIgnoreCase("1")) {
+                    PdfViewActivity.CONTENT = item;
+                    PdfViewActivity.TOPIC = TOPIC;
+                    PdfViewActivity.TRAINING_ID=myTraining;
+                    Intent i=new Intent(context,PdfViewActivity.class);
+                    i.putExtra("type","content");
+                    context.startActivity(i);
+                } else if (file.getFiletypeid().trim().equalsIgnoreCase("2")) {
+                    VideoViewActivity.CONTENT = item;
+                    VideoViewActivity.TOPIC = TOPIC;
+                    VideoViewActivity.TRAINING_ID= myTraining;
+                    Intent i=new Intent(context,VideoViewActivity.class);
+                    i.putExtra("type","content");
+                    context.startActivity(i);
+
+                } else if (file.getFiletypeid().trim().equalsIgnoreCase("3")) {
+                    AudioViewActivity.CONTENT = item;
+                    AudioViewActivity.TOPIC = TOPIC;
+                    context.startActivity(new Intent(context, AudioViewActivity.class));
+                }
+            }
+        });
+        return new ViewHolder(v);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+        MyContent item = items.get(position);
+        ContentFile contentFile = getContentFile(item);
+
+        holder.view.setTag(item);
+        holder.title.setText(item.getTitle());
+        holder.description.setText(item.getDescription());
+        holder.title.setSelected(true);
+        try {
+            holder.publishedDate.setText("Published On: " + dateFormate(item.getUploaddate()));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        assert contentFile != null;
+        if (contentFile.getFiletypeid().trim().equalsIgnoreCase("1")) {
+            holder.logo.setImageResource(R.mipmap.pdf);
+        } else if (contentFile.getFiletypeid().trim().equalsIgnoreCase("2")) {
+            holder.logo.setImageResource(R.mipmap.video_icon);
+        } else if (contentFile.getFiletypeid().trim().equalsIgnoreCase("3")) {
+            holder.logo.setImageResource(R.mipmap.audio_icon);
+        }
+
+        holder.title.setText(item.getTitle());
+        if (item.getStatus().trim().equalsIgnoreCase("0")) {
+            holder.image.setBorderColor(Color.parseColor("#B5B5B5"));
+        } else if (item.getStatus().trim().equalsIgnoreCase("1")) {
+            holder.image.setBorderColor(Color.parseColor("#F98315"));
+        } else if (item.getStatus().trim().equalsIgnoreCase("2")) {
+            holder.image.setBorderColor(Color.parseColor("#1D7210"));
+        }
+
+        if (contentFile != null) {
+            Glide.with(context).load(contentFile.getThumb_fileurl())
+                    .thumbnail(Glide.with(context).load(R.drawable.gif_loader))
+                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                            .placeholder(R.drawable.placeholder)).into(holder.image);
+        }
+    }
+
+    public String dateFormate(String dte) {
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date newDate = null;
+        try {
+            newDate = format.parse(dte);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        format = new SimpleDateFormat("dd-MMM-yyyy");
+        String date = format.format(newDate);
+
+
+        return date;
+    }
+
+    private ContentFile getContentFile(MyContent item) {
+        if (item.getContent_files() == null) {
+            return null;
+        }
+
+        String language = context.getSharedPreferences("LANGUAGE", Context.MODE_PRIVATE).getString("DEFAULT", "en_us");
+        for (ContentFile file : item.getContent_files()) {
+            if (file.getLanguage_code().trim().equalsIgnoreCase(language.trim())) {
+                return file;
+            }
+        }
+        return item.getContent_files().get(0);
+    }
+
+    @Override
+    public int getItemCount() {
+        return items.size();
+    }
+
+    public void add(MyContent item, int position) {
+        items.add(position, item);
+        notifyItemInserted(position);
+    }
+
+    public void add(MyContent item) {
+        items.add(item);
+        notifyItemInserted(items.size());
+    }
+
+    public void remove(int position) {
+        items.remove(position);
+        notifyItemRemoved(position);
+    }
+
+    class ViewHolder extends RecyclerView.ViewHolder {
+        ImageView statusBar, logo;
+        CircularImageView image;
+        TextView title, description, publishedDate;
+        View view;
+
+        private ViewHolder(View itemView) {
+            super(itemView);
+            view = itemView;
+            image = itemView.findViewById(R.id.image);
+            title = itemView.findViewById(R.id.title);
+            description = itemView.findViewById(R.id.description);
+            publishedDate = itemView.findViewById(R.id.publishedDate);
+            //   statusBar = itemView.findViewById(R.id.statusBar);
+            logo = itemView.findViewById(R.id.logo);
+        }
+
+    }
+}

+ 4 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/EarningPagerAdapter.java

@@ -0,0 +1,4 @@
+package com.cygnusa.hyperm.adapter;
+
+public class EarningPagerAdapter {
+}

+ 249 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/HistoryAdapter.java

@@ -0,0 +1,249 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.graphics.Color;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseExpandableListAdapter;
+import android.widget.ImageButton;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AlertDialog;
+
+import com.bumptech.glide.Glide;
+import com.github.siyamed.shapeimageview.CircularImageView;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.training.activities.Schedules;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.MyCallback;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.CommonResponse;
+import com.cygnusa.hyperm.wrappers.DSE;
+import com.cygnusa.hyperm.wrappers.TimeTaken;
+
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Response;
+
+
+public class HistoryAdapter extends BaseExpandableListAdapter {
+
+    private Schedules schedules;
+    private LayoutInflater inflater;
+    private Context context;
+    private ApiService restClient;
+    private TransparentProgressDialog progressDialog;
+
+    public HistoryAdapter(Context context, Schedules schedules, ApiService restClient) {
+        this.schedules = schedules;
+        inflater = LayoutInflater.from(context);
+        this.context = context;
+        this.restClient = restClient;
+    }
+
+    @Override
+    public int getGroupCount() {
+        return schedules.getUserlist().size();
+    }
+
+    @Override
+    public int getChildrenCount(int i) {
+        return schedules.getUserlist().get(i).getTimerlist().size();
+    }
+
+    @Override
+    public DSE getGroup(int i) {
+        return schedules.getUserlist().get(i);
+    }
+
+    @Override
+    public TimeTaken getChild(int i, int i1) {
+        return schedules.getUserlist().get(i).getTimerlist().get(i1);
+    }
+
+    @Override
+    public long getGroupId(int i) {
+        return 0;
+    }
+
+    @Override
+    public long getChildId(int i, int i1) {
+        return 0;
+    }
+
+    @Override
+    public boolean hasStableIds() {
+        return false;
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public View getGroupView(int position, boolean isExpanded, View convertView, ViewGroup parent) {
+        ViewHolder holder;
+        if (convertView == null) {
+            holder = new ViewHolder();
+            convertView = inflater.inflate(R.layout.history_item, null);
+            holder.name = convertView.findViewById(R.id.name);
+            holder.status = convertView.findViewById(R.id.status);
+            holder.duration = convertView.findViewById(R.id.duration);
+            holder.userIcon = convertView.findViewById(R.id.userIcon);
+            holder.removeParticipant = convertView.findViewById(R.id.removeParticipant);
+            convertView.setTag(holder);
+
+        } else {
+            holder = (ViewHolder) convertView.getTag();
+        }
+
+        holder.removeParticipant.setVisibility(View.GONE);
+        if (!schedules.isValidTime()) {
+            if (!schedules.isEnded()) {
+                holder.removeParticipant.setVisibility(View.VISIBLE);
+            }
+        }
+        holder.removeParticipant.setTag(schedules.getUserlist().get(position));
+        holder.removeParticipant.setOnClickListener(view -> {
+            final DSE dse = (DSE) view.getTag();
+            new AlertDialog.Builder(context)
+                    .setMessage("Are you sure to remove?")
+                    .setTitle(dse.getName())
+                    .setPositiveButton("Yes",
+                            (dialog, which) -> removeDSEFromTraining(dse)).setNegativeButton("No", null).show();
+        });
+
+        holder.name.setText(schedules.getUserlist().get(position).getName());
+        holder.duration.setText("");
+        Glide.with(context).load(schedules.getUserlist().get(position).getProfile())
+                .thumbnail(Glide.with(context).load(R.drawable.gif_loader))
+                .into(holder.userIcon);
+
+
+
+        if (schedules.isValidTime() && schedules.getStatus().equalsIgnoreCase("1")) {
+            holder.status.setText("Ongoing");
+            holder.status.setTextColor(Color.parseColor("#2e7d32"));
+            holder.duration.setVisibility(View.INVISIBLE);
+        } else {
+            if (schedules.isEnded() || schedules.getStatus().equalsIgnoreCase("2")) {
+                if (schedules.getUserlist().get(position).getTimerlist().size() > 0) {
+                    String participate = schedules.getUserlist().get(position).getTimerlist().get(0).getFromTimeString();
+                    participate = participate + " to " + schedules.getUserlist()
+                            .get(position).getTimerlist().get(schedules.getUserlist()
+                                    .get(position).getTimerlist().size() - 1).getToTimeString();
+                    holder.status.setText(participate);
+                    holder.status.setTextColor(Color.parseColor("#000000"));
+                    holder.duration.setVisibility(View.VISIBLE);
+
+                    int sec = 0;
+                    for (TimeTaken taken : schedules.getUserlist().get(position).getTimerlist()) {
+                        sec = sec + taken.getTimeTakenSeconds();
+                    }
+                    holder.duration.setText(getDurationBreakdown(sec));
+                } else {
+                    holder.status.setText("Not Attended");
+                    holder.status.setTextColor(Color.parseColor("#F44336"));
+                    holder.duration.setVisibility(View.INVISIBLE);
+                }
+            } else {
+                holder.status.setText("Not Started");
+                holder.status.setTextColor(Color.parseColor("#2869db"));
+                holder.duration.setVisibility(View.INVISIBLE);
+            }
+        }
+        return convertView;
+    }
+
+    @Override
+    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
+        TimeTaken taken = getChild(groupPosition, childPosition);
+        TimeViewHolder holder;
+        if (convertView == null) {
+            LayoutInflater infalInflater = (LayoutInflater) this.context
+                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            convertView = Objects.requireNonNull(infalInflater).inflate(R.layout.history_child_item, null);
+            holder = new TimeViewHolder(convertView);
+            convertView.setTag(holder);
+        } else {
+            holder = (TimeViewHolder) convertView.getTag();
+        }
+
+        String participate = taken.getTimeString(true) + " - " + taken.getTimeString(false);
+        holder.status.setText(participate);
+        holder.duration.setText(getDurationBreakdown(taken.getTimeTakenSeconds()));
+        return convertView;
+    }
+
+    @Override
+    public boolean isChildSelectable(int i, int i1) {
+        return false;
+    }
+
+    static class ViewHolder {
+        TextView name, status, duration;
+        ImageButton removeParticipant;
+        CircularImageView userIcon;
+    }
+
+    private String getDurationBreakdown(int SECONDS) {
+        int secondsLeft = SECONDS % 3600 % 60;
+        int minutes = (int) Math.floor(SECONDS % 3600 / 60);
+        int hours = (int) Math.floor(SECONDS / 3600);
+        String HH = ((hours < 10) ? "0" : "") + hours;
+        String MM = ((minutes < 10) ? "0" : "") + minutes;
+        String SS = ((secondsLeft < 10) ? "0" : "") + secondsLeft;
+        return HH + ":" + MM + ":" + SS;
+    }
+
+    static class TimeViewHolder {
+        TextView status, duration;
+
+        TimeViewHolder(View view) {
+            status = view.findViewById(R.id.status);
+            duration = view.findViewById(R.id.duration);
+        }
+    }
+
+    private void removeDSEFromTraining(DSE dse) {
+        if (new UtilService().isNetworkAvailable(Objects.requireNonNull(context))) {
+            try {
+                progressDialog = new TransparentProgressDialog(context);
+                progressDialog.setCancelable(true);
+                progressDialog.show();
+
+                restClient.removeDSEFromTraining(schedules.getId(), dse.getUserid()).enqueue(new MyCallback<CommonResponse>(dse) {
+                    @Override
+                    public void onResponse(Call<CommonResponse> call, Response<CommonResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        if (response.isSuccessful()) {
+                            Toast.makeText(context, "Participant removed", Toast.LENGTH_SHORT).show();
+                            schedules.getUserlist().remove(dse);
+                            notifyDataSetChanged();
+                        } else {
+                            Toast.makeText(context, "Unable to remove, try again!", Toast.LENGTH_SHORT).show();
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<CommonResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        Toast.makeText(context, "Unable to remove, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                e.printStackTrace();
+                Toast.makeText(context, "Unable to remove, try again!", Toast.LENGTH_SHORT).show();
+            }
+        }
+    }
+}

+ 164 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/LeaderBoardListAdapter.java

@@ -0,0 +1,164 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.bumptech.glide.Glide;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.util.PositionUpdateListener;
+import com.cygnusa.hyperm.wrappers.LeaderBoard;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.concurrent.TimeUnit;
+
+public class LeaderBoardListAdapter extends RecyclerView.Adapter<LeaderBoardListAdapter.ViewHolder> {
+
+    private ArrayList<LeaderBoard> LEADER_BOARD_LIST;
+    private PositionUpdateListener listener;
+    private Context context;
+    private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    private SimpleDateFormat format1 = new SimpleDateFormat("dd-MMM-yyyy hh:mm a");
+
+    public LeaderBoardListAdapter(Context context, ArrayList<LeaderBoard> items, PositionUpdateListener l) {
+        this.LEADER_BOARD_LIST = items;
+        this.listener = l;
+        this.context = context;
+    }
+
+    @NonNull
+    @Override
+    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.leader_board_item, parent, false);
+        return new ViewHolder(v);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+        LeaderBoard LEADER_BOARD = LEADER_BOARD_LIST.get(position);
+        holder.view.setTag(LEADER_BOARD);
+
+        holder.name.setText(String.format("%s %s", LEADER_BOARD.getUser().getFname(), LEADER_BOARD.getUser().getLname()));
+        if (LEADER_BOARD.getUser().getCity() == null || LEADER_BOARD.getUser().getCity().equalsIgnoreCase(""))
+            holder.location.setVisibility(View.GONE);
+        else {
+            holder.location.setVisibility(View.VISIBLE);
+            holder.location.setText(LEADER_BOARD.getUser().getCity());
+        }
+
+        if (LEADER_BOARD.getUser().getDealer().getDealer_name() == null || LEADER_BOARD.getUser().getDealer().getDealer_name().equalsIgnoreCase(""))
+            holder.dealerName.setVisibility(View.GONE);
+        else {
+            holder.dealerName.setVisibility(View.VISIBLE);
+            holder.dealerName.setText(LEADER_BOARD.getUser().getDealer().getDealer_name());
+        }
+
+
+        if (LEADER_BOARD.getRank() == null || LEADER_BOARD.getRank().equalsIgnoreCase(""))
+            holder.position.setVisibility(View.GONE);
+        else {
+            holder.position.setVisibility(View.VISIBLE);
+            holder.position.setText(LEADER_BOARD.getRank());
+        }
+
+
+        if (LEADER_BOARD.getRank().equalsIgnoreCase("0")) {
+            holder.cup.setVisibility(View.GONE);
+            holder.duration.setText("Assessment not done");
+            holder.dateTime.setText("");
+            holder.score.setText("");
+        } else {
+            holder.cup.setVisibility(View.VISIBLE);
+            try {
+                holder.dateTime.setText(String.format("Completed on: %s", format1.format(format.parse(LEADER_BOARD.getLast_time()))));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+            try {
+                int d = (int) Math.round(Double.parseDouble(LEADER_BOARD.getPercentage().trim()));
+                holder.score.setText(String.valueOf(d).length() > 1 ? d + "%" : d + "%");
+            } catch (Exception e) {
+                holder.score.setText("-");
+            }
+
+            try {
+                long millis = Long.parseLong(LEADER_BOARD.getTotal_time()) * 1000;
+                String formattedTime = String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(millis),
+                        TimeUnit.MILLISECONDS.toMinutes(millis) % TimeUnit.HOURS.toMinutes(1),
+                        TimeUnit.MILLISECONDS.toSeconds(millis) % TimeUnit.MINUTES.toSeconds(1));
+                holder.duration.setText("Total Duration: " + formattedTime);
+                holder.duration.setVisibility(View.VISIBLE);
+            } catch (Exception e) {
+                e.printStackTrace();
+                holder.duration.setVisibility(View.GONE);
+            }
+        }
+
+        Glide.with(context).load(LEADER_BOARD.getUser().getProfile_photo())
+                .thumbnail(Glide.with(context).load(R.drawable.gif_loader))
+                .into(holder.userImage);
+
+        holder.view.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                LeaderBoard assessmentList = (LeaderBoard) v.getTag();
+                if (listener != null) {
+                    listener.onPositionUpdate(LEADER_BOARD_LIST.indexOf(assessmentList));
+                }
+            }
+        });
+
+
+    }
+
+    @Override
+    public int getItemCount() {
+        return LEADER_BOARD_LIST.size();
+    }
+
+    public void add(LeaderBoard item, int position) {
+        LEADER_BOARD_LIST.add(position, item);
+        notifyItemInserted(position);
+    }
+
+    public void add(LeaderBoard item) {
+        LEADER_BOARD_LIST.add(item);
+        notifyItemInserted(LEADER_BOARD_LIST.size());
+    }
+
+    public void remove(int position) {
+        LEADER_BOARD_LIST.remove(position);
+        notifyItemRemoved(position);
+    }
+
+    class ViewHolder extends RecyclerView.ViewHolder {
+        TextView name, location, duration, dateTime, position, score, dealerName;
+        ImageView userImage, cup;
+        View view;
+
+        private ViewHolder(View itemView) {
+            super(itemView);
+            view = itemView;
+            name = itemView.findViewById(R.id.name);
+            location = itemView.findViewById(R.id.location);
+            duration = itemView.findViewById(R.id.duration);
+            dealerName = itemView.findViewById(R.id.dealer_name);
+            dateTime = itemView.findViewById(R.id.dateTime);
+            score = itemView.findViewById(R.id.score);
+            position = itemView.findViewById(R.id.position);
+            userImage = itemView.findViewById(R.id.userImage);
+            cup = itemView.findViewById(R.id.cup);
+        }
+
+    }
+}

+ 163 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/LearningPathAdapter.java

@@ -0,0 +1,163 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.Bulletin;
+import com.cygnusa.hyperm.wrappers.LearningPath;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+
+
+public class LearningPathAdapter extends RecyclerView.Adapter<LearningPathAdapter.ViewHolder> {
+
+    private ArrayList<LearningPath> items;
+    private Context context;
+    private Bulletin TOPIC;
+
+    public LearningPathAdapter(Context context, ArrayList<LearningPath> item) {
+
+        this.items = item;
+        this.context = context;
+    }
+
+    @NonNull
+    @Override
+    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.learning_path_item, parent, false);
+
+        return new ViewHolder(v);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+        LearningPath item = items.get(position);
+        holder.view.setTag(item);
+        holder.title.setText(item.assessmentname);
+        holder.title.setSelected(true);
+        holder.score.setText(item.highscore + "%");
+        holder.title.setSelected(true);
+
+        try {
+            //   char levelChar=item.lvl_name.toString().charAt(0);
+            holder.Date.setText("Date:  " + dateFormate(item.examtime));
+            holder.learningLevelName.setText(item.lvl_name.toString().substring(0, 1));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        int score = Integer.parseInt(item.highscore);
+        if (score > 80) {
+            holder.image.setImageResource(R.drawable.asset13);
+        } else {
+            holder.image.setImageResource(R.drawable.asset12);
+        }
+//        if (item.getLvl_id().equalsIgnoreCase("3")) {
+//            holder.image.setImageResource(R.drawable.asset13);
+//        }else if (item.getLvl_id().equalsIgnoreCase("2")) {
+//            holder.image.setImageResource(R.drawable.asset12);
+//        } else if (item.getLvl_id().equalsIgnoreCase("1")) {
+//            holder.image.setImageResource(R.drawable.asset11);
+//        } else {
+//            holder.image.setImageResource(R.drawable.asset14);
+//        }
+
+        if (item.getLvl_id().equalsIgnoreCase("1") || item.getLvl_id().equalsIgnoreCase("2")) {
+
+            if (item.getLevel_status().equalsIgnoreCase("0")) {
+                holder.image.setImageResource(R.drawable.l_full_grey);
+            } else if (item.getLevel_status().equalsIgnoreCase("2")) {
+                holder.image.setImageResource(R.drawable.asset12);
+            } else if (item.getLevel_status().equalsIgnoreCase("3")) {
+                holder.image.setImageResource(R.drawable.l_full_green);
+            } else {
+                holder.image.setImageResource(R.drawable.l_full_grey);
+            }
+        } else if (item.getLvl_id().equalsIgnoreCase("3") || item.getLvl_id().equalsIgnoreCase("4")) {
+            if (item.getLevel_status().equalsIgnoreCase("0")) {
+                holder.image.setImageResource(R.drawable.l_full_grey);
+            } else if (item.getLevel_status().equalsIgnoreCase("2")) {
+                holder.image.setImageResource(R.drawable.l_green_red);
+            } else if (item.getLevel_status().equalsIgnoreCase("3")) {
+                holder.image.setImageResource(R.drawable.l_full_green);
+            } else if (item.getLevel_status().equalsIgnoreCase("6")) {
+                holder.image.setImageResource(R.drawable.l_red_grey);
+            } else if (item.getLevel_status().equalsIgnoreCase("7")) {
+                holder.image.setImageResource(R.drawable.l_green_grey);
+            } else if (item.getLevel_status().equalsIgnoreCase("4")) {
+                holder.image.setImageResource(R.drawable.l_green_grey);
+            } else {
+                holder.image.setImageResource(R.drawable.l_full_grey);
+            }
+        }
+    }
+
+
+    @Override
+    public int getItemCount() {
+        return items.size();
+    }
+
+    public void add(LearningPath item, int position) {
+        items.add(position, item);
+        notifyItemInserted(position);
+    }
+
+    public void add(LearningPath item) {
+        items.add(item);
+        notifyItemInserted(items.size());
+    }
+
+    public void remove(int position) {
+        items.remove(position);
+        notifyItemRemoved(position);
+    }
+
+    static class ViewHolder extends RecyclerView.ViewHolder {
+
+        ImageView image;
+        TextView title, score, Date, learningLevelName;
+        View view;
+
+        private ViewHolder(View itemView) {
+            super(itemView);
+            view = itemView;
+            image = itemView.findViewById(R.id.image);
+            title = itemView.findViewById(R.id.title);
+            learningLevelName = itemView.findViewById(R.id.learning_path_name);
+            Date = itemView.findViewById(R.id.date);
+            score = itemView.findViewById(R.id.score);
+
+        }
+
+    }
+
+    public String dateFormate(String dte) {
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date newDate = null;
+        try {
+            newDate = format.parse(dte);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        format = new SimpleDateFormat("dd-MMM-yyyy");
+
+
+        return format.format(newDate);
+    }
+}
+

+ 666 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/NotificationAdapter.java

@@ -0,0 +1,666 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.os.Handler;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
+import com.cygnusa.hyperm.AMHomeActivity;
+import com.cygnusa.hyperm.ASMScheduleViewActivity;
+import com.cygnusa.hyperm.AcceptTrainingActivity;
+import com.cygnusa.hyperm.AssessmentActivity;
+import com.cygnusa.hyperm.AudioViewActivity;
+import com.cygnusa.hyperm.BulletinDetails;
+import com.cygnusa.hyperm.ClassRoomDSETainingActivity;
+import com.cygnusa.hyperm.ClassRoomTrainerTainingActivity;
+import com.cygnusa.hyperm.HomeActivity;
+import com.cygnusa.hyperm.MyEarnedPoints;
+import com.cygnusa.hyperm.NotificationViewActivity;
+import com.cygnusa.hyperm.PdfViewActivity;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.SurveyActivity;
+import com.cygnusa.hyperm.VideoViewActivity;
+import com.cygnusa.hyperm.screenpinview.AppLockActivity;
+import com.cygnusa.hyperm.training.activities.ScheduleListActivity;
+import com.cygnusa.hyperm.util.ApiService;
+import com.cygnusa.hyperm.util.GlobalData;
+import com.cygnusa.hyperm.util.MyCallback;
+import com.cygnusa.hyperm.util.PositionUpdateListener;
+import com.cygnusa.hyperm.util.TransparentProgressDialog;
+import com.cygnusa.hyperm.util.UtilService;
+import com.cygnusa.hyperm.wrappers.AssessmentList;
+import com.cygnusa.hyperm.wrappers.AssessmentStatusResponse;
+import com.cygnusa.hyperm.wrappers.Bulletin;
+import com.cygnusa.hyperm.wrappers.BulletinStatusResponse;
+import com.cygnusa.hyperm.wrappers.ContentDetailResponse;
+import com.cygnusa.hyperm.wrappers.ContentFile;
+import com.cygnusa.hyperm.wrappers.ErrorResponse;
+import com.cygnusa.hyperm.wrappers.MyContent;
+import com.cygnusa.hyperm.wrappers.Notification;
+import com.cygnusa.hyperm.wrappers.Survey;
+import com.cygnusa.hyperm.wrappers.SurveyStatusResponse;
+import com.cygnusa.hyperm.wrappers.ViewScheduleListResponse;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Objects;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapter.ViewHolder> {
+
+    private ArrayList<Notification> NOTIFICATION_LIST;
+    private Context context;
+    private PositionUpdateListener listener;
+    private ApiService restService;
+    private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    private SimpleDateFormat format1 = new SimpleDateFormat("dd-MMM-yyyy");
+    private AssessmentList ASSESSMENT_LIST = new AssessmentList();
+    private Survey SURVEY_LIST = new Survey();
+    private MyContent myCon = new MyContent();
+    private Bulletin myBulletin = new Bulletin();
+    private TransparentProgressDialog progressDialog;
+
+    public NotificationAdapter(Context context, ArrayList<Notification> items,
+                               PositionUpdateListener l, ApiService restService) {
+        this.NOTIFICATION_LIST = items;
+        this.context = context;
+        this.listener = l;
+        this.restService = restService;
+    }
+
+    @NonNull
+    @Override
+    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.notification_item, parent, false);
+        return new ViewHolder(v);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+        Notification item = NOTIFICATION_LIST.get(position);
+
+        holder.view.setTag(position);
+
+//        int color1 = ColorGenerator.MATERIAL.getColor(item);
+//        String cha = String.valueOf(item.getNotificationtitle().trim().toUpperCase().charAt(0));
+//        TextDrawable drawable = TextDrawable.builder()
+//                .beginConfig()
+//                .withBorder(4)
+//                .endConfig()
+//                .buildRound(cha, color1);
+//        holder.imageView.setImageDrawable(drawable);
+
+        holder.description.setText(item.getNotificationtext());
+        holder.title.setText(item.getNotificationtitle());
+        holder.title.setSelected(true);
+        if (item.getStatus().trim().equalsIgnoreCase("0")) {
+            holder.unreadStatus.setVisibility(View.VISIBLE);
+            holder.notificationLayout.setAlpha(1f);
+        } else {
+            holder.unreadStatus.setVisibility(View.GONE);
+            holder.notificationLayout.setAlpha(0.6f);
+
+        }
+
+        try {
+            holder.publishedDate.setText(String.format("Published On: %s", format1.format(Objects.requireNonNull(format.parse(item.getCreated_on())))));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        holder.view.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                int position = (int) v.getTag();
+                if (NOTIFICATION_LIST.get(position).getNotificationtype().equalsIgnoreCase("2")) {
+                    //getBulletinList(NOTIFICATION_LIST.get(position).getNotificationdata().getAssessmentid());
+                    getAssessmentListByCategory(NOTIFICATION_LIST.get(position).getNotificationdata().getId());
+                } else if (NOTIFICATION_LIST.get(position).getNotificationtype().equalsIgnoreCase("1")) {
+                    getContentCategory(NOTIFICATION_LIST.get(position).getNotificationdata().getId());
+                } else if (NOTIFICATION_LIST.get(position).getNotificationtype().equalsIgnoreCase("4")) {
+                    getBulletinList(NOTIFICATION_LIST.get(position).getNotificationdata().getId());
+                } else if (NOTIFICATION_LIST.get(position).getNotificationtype().equalsIgnoreCase("3")) {
+                    getSurveyListByCategory(NOTIFICATION_LIST.get(position).getNotificationdata().getId());
+                } else if (NOTIFICATION_LIST.get(position).getNotificationtype().equalsIgnoreCase("6")) {
+                    context.startActivity(new Intent(context, MyEarnedPoints.class));
+                } else if (NOTIFICATION_LIST.get(position).getNotificationtype().equalsIgnoreCase("7")) {
+                    context.startActivity(new Intent(context, AppLockActivity.class));
+                } else if (NOTIFICATION_LIST.get(position).getNotificationtype().equalsIgnoreCase("9")) {
+                    context.startActivity(new Intent(context, ScheduleListActivity.class));
+                } else if (NOTIFICATION_LIST.get(position).getNotificationtype().equalsIgnoreCase("10")) {
+                    getScheduledList(NOTIFICATION_LIST.get(position).getNotificationdata().getSchedule_id());
+                } else if (NOTIFICATION_LIST.get(position).getNotificationtype().equalsIgnoreCase("11")) {
+                    getFeedbackList(NOTIFICATION_LIST.get(position).getNotificationtype(), NOTIFICATION_LIST.get(position).getNotificationdata().getSchedule_id());
+                } else if (NOTIFICATION_LIST.get(position).getNotificationtype().equalsIgnoreCase("12")) {
+                    getFeedbackList(NOTIFICATION_LIST.get(position).getNotificationtype(), NOTIFICATION_LIST.get(position).getNotificationdata().getSchedule_id());
+                } else {
+                    NotificationViewActivity.NOTIFICATION = NOTIFICATION_LIST.get(position);
+                    context.startActivity(new Intent(context, NotificationViewActivity.class));
+                }
+                if (NOTIFICATION_LIST.get(position).getStatus().trim().equalsIgnoreCase("0")) {
+                    updateNotification(position);
+                }
+                if (listener != null) {
+                    listener.onPositionUpdate(position);
+                }
+
+            }
+        });
+    }
+
+    private void getFeedbackList(String type, String scheduleId) {
+
+        restService.getScheduledList(scheduleId).enqueue(new Callback<ViewScheduleListResponse>() {
+            @Override
+            public void onResponse(Call<ViewScheduleListResponse> call, Response<ViewScheduleListResponse> response) {
+                if (response.body() != null) {
+                    if (response.body().getData() != null) {
+                        GlobalData.scheduledDataList = new ArrayList<>();
+                        GlobalData.scheduledDataList = response.body().getData();
+
+                        if (GlobalData.scheduledDataList != null && GlobalData.scheduledDataList.size() > 0) {
+                            if (GlobalData.user.getData().getRole().equalsIgnoreCase("5")) {
+                                Intent intent = new Intent(context, ClassRoomTrainerTainingActivity.class);
+                                intent.putExtra("type", type);
+                                context.startActivity(intent);
+                            } else if (GlobalData.user.getData().getRole().equalsIgnoreCase("10")) {
+                                Intent i = new Intent(context, ClassRoomDSETainingActivity.class);
+                                i.putExtra("type", type);
+                                context.startActivity(i);
+//                            context.startActivity(new Intent(context, ASMScheduleViewActivity.class));
+                            }
+                        } else {
+                            GlobalData.showToast(context, "No Data Found.", Toast.LENGTH_SHORT).show();
+                        }
+
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(context, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(context, message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                    }
+                }
+
+            }
+
+            @Override
+            public void onFailure(Call<ViewScheduleListResponse> call, Throwable t) {
+
+                Log.e("rr", t.getMessage());
+
+
+            }
+        });
+    }
+
+    private void getScheduledList(String scheduleId) {
+
+        restService.getScheduledList(scheduleId).enqueue(new Callback<ViewScheduleListResponse>() {
+            @Override
+            public void onResponse(Call<ViewScheduleListResponse> call, Response<ViewScheduleListResponse> response) {
+                if (response.body() != null) {
+                    if (response.body().getData() != null) {
+                        GlobalData.scheduledDataList = new ArrayList<>();
+                        GlobalData.scheduledDataList = response.body().getData();
+
+                        if (GlobalData.scheduledDataList != null && GlobalData.scheduledDataList.size() > 0) {
+                            if (GlobalData.scheduledDataList.get(0).getParticipant() != null && GlobalData.scheduledDataList.get(0).getParticipant().size() > 0) {
+                                if (GlobalData.user.getData().getRole().equalsIgnoreCase("10")) {
+                                    context.startActivity(new Intent(context, AcceptTrainingActivity.class));
+                                } else if (GlobalData.user.getData().getRole().equalsIgnoreCase("7")) {
+                                    Intent i = new Intent(context, ASMScheduleViewActivity.class);
+                                    i.putExtra("SCHEDULE_ID", scheduleId);
+                                    context.startActivity(i);
+//                            context.startActivity(new Intent(context, ASMScheduleViewActivity.class));
+                                }
+                            } else {
+                                GlobalData.showToast(context, "No Data Found.", Toast.LENGTH_SHORT).show();
+                            }
+                        } else {
+                            GlobalData.showToast(context, "No Data Found.", Toast.LENGTH_SHORT).show();
+                        }
+
+                    } else if (response.body() != null) {
+                        GlobalData.showToast(context, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                    }
+                } else if (response.body() != null && response.body().getStatus() == 401) {
+                    GlobalData.canLogout = true;
+                } else if (response.errorBody() != null) {
+                    Gson gson = new Gson();
+                    ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                    GlobalData.showToast(context, message.getMessage(), Toast.LENGTH_SHORT).show();
+                    if (message.getStatus() == 401) {
+                        GlobalData.canLogout = true;
+                    }
+                }
+
+            }
+
+            @Override
+            public void onFailure(Call<ViewScheduleListResponse> call, Throwable t) {
+
+                Log.e("rr", t.getMessage());
+
+
+            }
+        });
+    }
+
+    private void getBulletinList(String id) {
+        progressDialog = new TransparentProgressDialog(context);
+        progressDialog.show();
+        if (new UtilService().isNetworkAvailable(context)) {
+            try {
+                restService.getBulletinByPosition(id).enqueue(new Callback<BulletinStatusResponse>() {
+                    @Override
+                    public void onResponse(Call<BulletinStatusResponse> call, Response<BulletinStatusResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            myBulletin = response.body().getData();
+                            goToBulletinActivity();
+                            if (myCon == null) {
+                                myCon = new MyContent();
+                            }
+
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(context, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(context, message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<BulletinStatusResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(context, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                GlobalData.showToast(context, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+        } else {
+
+        }
+    }
+
+    private void getContentCategory(String id) {
+        progressDialog = new TransparentProgressDialog(context);
+        progressDialog.show();
+        if (new UtilService().isNetworkAvailable(context)) {
+            try {
+                restService.getTopicContentsDetails(id).enqueue(new Callback<ContentDetailResponse>() {
+                    @Override
+                    public void onResponse(Call<ContentDetailResponse> call, Response<ContentDetailResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            myCon = response.body().getData();
+                            goToTopicActivity();
+                            if (myCon == null) {
+                                myCon = new MyContent();
+                            }
+
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(context, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(context, message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<ContentDetailResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(context, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                GlobalData.showToast(context, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+        } else {
+
+        }
+    }
+
+    private void getAssessmentListByCategory(String id) {
+        progressDialog = new TransparentProgressDialog(context);
+        progressDialog.show();
+        if (new UtilService().isNetworkAvailable(context)) {
+            try {
+                restService.getAssessmentByPosition(id).enqueue(new Callback<AssessmentStatusResponse>() {
+                    @Override
+                    public void onResponse(Call<AssessmentStatusResponse> call, Response<AssessmentStatusResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            ASSESSMENT_LIST = response.body().getData();
+                            goToAssessmentActivity();
+                            if (ASSESSMENT_LIST == null) {
+                                ASSESSMENT_LIST = new AssessmentList();
+                            }
+
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(context, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(context, message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<AssessmentStatusResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(context, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                GlobalData.showToast(context, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+        } else {
+
+        }
+    }
+
+    private void getSurveyListByCategory(String id) {
+        progressDialog = new TransparentProgressDialog(context);
+        progressDialog.show();
+        if (new UtilService().isNetworkAvailable(context)) {
+            try {
+                restService.getSurveyByPosition(id).enqueue(new Callback<SurveyStatusResponse>() {
+                    @Override
+                    public void onResponse(Call<SurveyStatusResponse> call, Response<SurveyStatusResponse> response) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        if (response.body() != null && response.body().getStatus() == 200) {
+                            SURVEY_LIST = response.body().getData();
+                            goToSurveyActivity();
+                            if (SURVEY_LIST == null) {
+                                SURVEY_LIST = new Survey();
+                            }
+                        } else if (response.body() != null && response.body().getStatus() == 401) {
+                            GlobalData.canLogout = true;
+                            new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                        } else if (response.body() != null) {
+                            GlobalData.showToast(context, response.body().getMessage(), Toast.LENGTH_SHORT).show();
+                        } else if (response.errorBody() != null) {
+                            Gson gson = new Gson();
+                            ErrorResponse message = gson.fromJson(response.errorBody().charStream(), ErrorResponse.class);
+                            GlobalData.showToast(context, message.getMessage(), Toast.LENGTH_SHORT).show();
+                            if (message.getStatus() == 401) {
+                                GlobalData.canLogout = true;
+                                new Handler(HomeActivity.callback).sendEmptyMessage(0);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Call<SurveyStatusResponse> call, Throwable t) {
+                        if (progressDialog != null && progressDialog.isShowing()) {
+                            progressDialog.dismiss();
+                        }
+                        GlobalData.showToast(context, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                    }
+                });
+
+            } catch (Exception e) {
+                if (progressDialog != null && progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                GlobalData.showToast(context, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+            }
+        } else {
+
+        }
+    }
+
+    private void goToSurveyActivity() {
+
+        SurveyActivity.ASSESSMENT = SURVEY_LIST;
+
+        if (listener != null) {
+            //  listener.onPositionUpdate(SURVEY_LIST.indexOf(SURVEY_LIST));
+        }
+        context.startActivity(new Intent(context, SurveyActivity.class));
+    }
+
+    private void goToBulletinActivity() {
+
+        BulletinDetails.CONTENT = myBulletin;
+
+        if (listener != null) {
+            //  listener.onPositionUpdate(SURVEY_LIST.indexOf(SURVEY_LIST));
+        }
+        context.startActivity(new Intent(context, BulletinDetails.class));
+    }
+
+    private void goToTopicActivity() {
+
+        ContentFile file = getContentFile(myCon);
+        assert file != null;
+        if (file.getFiletypeid().trim().equalsIgnoreCase("1")) {
+            PdfViewActivity.CONTENT = myCon;
+            //PdfViewActivity.TOPIC = myCon.getTitle();
+            Intent i = new Intent(context, PdfViewActivity.class);
+            i.putExtra("type", "notification");
+            context.startActivity(i);
+        } else if (file.getFiletypeid().trim().equalsIgnoreCase("2")) {
+            VideoViewActivity.CONTENT = myCon;
+            Intent i = new Intent(context, VideoViewActivity.class);
+            i.putExtra("type", "notification");
+            context.startActivity(i);
+        } else if (file.getFiletypeid().trim().equalsIgnoreCase("3")) {
+            AudioViewActivity.CONTENT = myCon;
+            // AudioViewActivity.TOPIC = TOPIC;
+            context.startActivity(new Intent(context, AudioViewActivity.class));
+        }
+
+    }
+
+    private ContentFile getContentFile(MyContent item) {
+        if (item.getContent_files() == null) {
+            return null;
+        }
+
+        String language = context.getSharedPreferences("LANGUAGE", Context.MODE_PRIVATE).getString("DEFAULT", "en_us");
+        for (ContentFile file : item.getContent_files()) {
+            if (file.getLanguage_code().trim().equalsIgnoreCase(language.trim())) {
+                return file;
+            }
+        }
+        return item.getContent_files().get(0);
+    }
+
+
+    private void goToAssessmentActivity() {
+        if (Integer.parseInt(ASSESSMENT_LIST.getAttemptslimit().trim())
+                > ASSESSMENT_LIST.getAttempt_time()) {
+            if (ASSESSMENT_LIST.getIs_expired().trim().equalsIgnoreCase("0")) {
+                AssessmentActivity.ASSESSMENT = ASSESSMENT_LIST;
+                context.startActivity(new Intent(context, AssessmentActivity.class));
+
+            } else {
+                GlobalData.showToast(context,
+                        "Assessment expired", Toast.LENGTH_SHORT).show();
+            }
+        } else {
+            GlobalData.showToast(context, "You have attempted this test "
+                    + ASSESSMENT_LIST.getAttempt_time() + " times. Please contact the admin for more details.", Toast.LENGTH_SHORT).show();
+        }
+
+    }
+
+    private void updateNotification(int id) {
+        Cursor cursor = GlobalData.sdb.rawQuery("select * from notification_readed", null);
+        String ids;
+        if (cursor.getCount() > 0) {
+            cursor.moveToFirst();
+            ids = cursor.getString(cursor.getColumnIndex("notification_readed"));
+            ids = ids + "," + NOTIFICATION_LIST.get(id).getId().trim();
+        } else {
+            ids = NOTIFICATION_LIST.get(id).getId().trim();
+        }
+        NOTIFICATION_LIST.get(id).setStatus("1");
+        notifyDataSetChanged();
+
+        GlobalData.sdb.delete("notification_readed", null, null);
+        ContentValues values1 = new ContentValues();
+        values1.put("notification_readed", ids);
+        GlobalData.sdb.insert("notification_readed", null, values1);
+        GlobalData.sdb.delete("notifications", null, null);
+        Gson gson = new Gson();
+        JsonElement jsonElement = gson.toJsonTree(
+                NOTIFICATION_LIST, new TypeToken<ArrayList<Notification>>() {
+                }.getType());
+        ContentValues values = new ContentValues();
+        values.put("notifications", jsonElement.toString());
+        GlobalData.sdb.insert("notifications", null, values);
+
+        if (new UtilService().isNetworkAvailable(context)) {
+            HashMap<String, String> map = new HashMap<>();
+            map.put("notificationid", ids);
+
+            restService.updateReadNotifications(map)
+                    .enqueue(new MyCallback<ErrorResponse>(ids) {
+                        @Override
+                        public void onResponse(Call<ErrorResponse> call, Response<ErrorResponse> response) {
+                            if (response.body() != null && response.body().getStatus() == 200) {
+                                GlobalData.sdb.delete("notification_readed", null, null);
+                            }
+                            try {
+                                new Handler(HomeActivity.badgeUpdateCallback).sendEmptyMessage(0);
+                                new Handler(AMHomeActivity.badgeUpdateCallback).sendEmptyMessage(0);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }
+
+                        @Override
+                        public void onFailure(Call<ErrorResponse> call, Throwable t) {
+                            GlobalData.showToast(context, "Connection Failure, try again!", Toast.LENGTH_SHORT).show();
+                        }
+                    });
+        } else {
+            try {
+                new Handler(HomeActivity.badgeUpdateCallback).sendEmptyMessage(0);
+                new Handler(AMHomeActivity.badgeUpdateCallback).sendEmptyMessage(0);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    @Override
+    public int getItemCount() {
+        return NOTIFICATION_LIST.size();
+    }
+
+    public void add(Notification item, int position) {
+        NOTIFICATION_LIST.add(position, item);
+        notifyItemInserted(position);
+    }
+
+    public void add(Notification item) {
+        NOTIFICATION_LIST.add(item);
+        notifyItemInserted(NOTIFICATION_LIST.size());
+    }
+
+    public void remove(int position) {
+        NOTIFICATION_LIST.remove(position);
+        notifyItemRemoved(position);
+    }
+
+    class ViewHolder extends RecyclerView.ViewHolder {
+        TextView unreadStatus, publishedDate, title, description;
+        View view;
+        ImageView imageView;
+        LinearLayout notificationLayout;
+
+        private ViewHolder(View itemView) {
+            super(itemView);
+            view = itemView;
+            unreadStatus = itemView.findViewById(R.id.unreadStatus);
+            publishedDate = itemView.findViewById(R.id.publishedDate);
+            title = itemView.findViewById(R.id.title);
+            description = itemView.findViewById(R.id.description);
+            imageView = itemView.findViewById(R.id.imageView);
+            notificationLayout = itemView.findViewById(R.id.mainView);
+        }
+
+    }
+}

+ 177 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/OrderHistoryAdapter.java

@@ -0,0 +1,177 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.OrderHistory;
+import com.cygnusa.hyperm.wrappers.RedeemCategory;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+
+
+public class OrderHistoryAdapter extends RecyclerView.Adapter<OrderHistoryAdapter.ViewHolder> {
+
+    private ArrayList<OrderHistory> items;
+    private Context context;
+
+    public OrderHistoryAdapter(Context context, ArrayList<OrderHistory> item) {
+
+        this.items = item;
+        this.context = context;
+    }
+
+    @NonNull
+    @Override
+    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.redeem_product_list, parent, false);
+        v.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                //  context.startActivity(new Intent(context, RedeemProductListActivity.class));
+
+            }
+        });
+
+
+        return new ViewHolder(v);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+        // Bulletin item = items.get(position);
+
+
+        holder.title.setText(items.get(position).getProduct_name());
+        if (items.get(position).getCard_data().cardnumber == null || items.get(position).getCard_data().cardnumber.equalsIgnoreCase("")) {
+            holder.desc.setVisibility(View.GONE);
+
+        }
+        if (items.get(position).getCard_data().pin_or_url == null || items.get(position).getCard_data().pin_or_url.equalsIgnoreCase("")) {
+            holder.pin.setVisibility(View.GONE);
+        }
+        if (items.get(position).getCard_data().expiry_date == null || items.get(position).getCard_data().expiry_date.equalsIgnoreCase("")) {
+            holder.text_expiry_date.setVisibility(View.GONE);
+        }
+
+        if (items.get(position).getCard_data().cardnumber != null && items.get(position).getCard_data().pin_or_url != null) {
+
+            holder.desc.setText("Card No : " + items.get(position).getCard_data().cardnumber);
+            holder.pin.setText("Card PIN : " + items.get(position).getCard_data().pin_or_url);
+            holder.text_expiry_date.setText("Card Expiry Date : " + finalFormate(items.get(position).getCard_data().expiry_date));
+        }
+
+        if(items.get(position).getStatus().trim().equalsIgnoreCase("0")){
+            holder.status.setText("Status : Failed");
+            holder.status.setTextColor(context.getResources().getColor(R.color.red));
+        }else if(items.get(position).getStatus().trim().equalsIgnoreCase("1")){
+            holder.status.setText("Status : Success");
+            holder.status.setTextColor(context.getResources().getColor(R.color.green));
+        }else if(items.get(position).getStatus().trim().equalsIgnoreCase("2")){
+            holder.status.setText("Status : Progress");
+            holder.status.setTextColor(context.getResources().getColor(R.color.orange));
+        }
+
+
+        holder.Amount.setText("Rs " + items.get(position).getProduct_amount());
+        holder.Amount.setSelected(true);
+        Glide.with(context).load(items.get(position).getImages())
+                .thumbnail(Glide.with(context).load(R.drawable.gif_loader))
+                .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                        .placeholder(R.drawable.placeholder)).into(holder.redeemImage);
+
+
+    }
+    public String finalFormate(String dte) {
+        String date = "";
+        if (dte.equalsIgnoreCase("0000-00-00")) {
+            date = "00/00/0000";
+            return date;
+        } else {
+
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            Date newDate = null;
+            try {
+                newDate = format.parse(dte);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            format = new SimpleDateFormat("dd-MMM-yyyy");
+            date = format.format(newDate);
+
+        }
+        return date;
+    }
+
+    @Override
+    public int getItemCount() {
+
+        return items.size();
+    }
+
+    public void add(RedeemCategory item, int position) {
+
+    }
+
+    public void add(RedeemCategory item) {
+
+
+    }
+
+    public void remove(int position) {
+
+    }
+
+    class ViewHolder extends RecyclerView.ViewHolder {
+        ImageView redeemImage;
+        TextView title, points, Amount, desc, pin, status,text_expiry_date;
+        View view;
+
+        private ViewHolder(View itemView) {
+            super(itemView);
+            view = itemView;
+            redeemImage = itemView.findViewById(R.id.product_image);
+            title = itemView.findViewById(R.id.text_title);
+            desc = itemView.findViewById(R.id.text_desc);
+            pin = itemView.findViewById(R.id.text_pin);
+            status = itemView.findViewById(R.id.text_status);
+            text_expiry_date = itemView.findViewById(R.id.text_expiry_date);
+
+            Amount = itemView.findViewById(R.id.redeem_price);
+
+        }
+
+    }
+
+    public String dateFormate(String dte) {
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date newDate = null;
+        try {
+            newDate = format.parse(dte);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        format = new SimpleDateFormat("dd-MMM-yyyy");
+        String date = format.format(newDate);
+
+
+        return date;
+    }
+}

+ 84 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/ProductFeedbackListAdapter.java

@@ -0,0 +1,84 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.content.Context;
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.smilerating.SmileyRating;
+import com.cygnusa.hyperm.wrappers.FeedbackAnswerArrayModel;
+import com.cygnusa.hyperm.wrappers.ProductFeedback;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ProductFeedbackListAdapter extends RecyclerView.Adapter<ProductFeedbackListAdapter.ViewHolder> implements SmileyRating.OnSmileySelectionListener {
+    private ArrayList<ProductFeedback> Questions;
+    private Context context;
+    String TAG = "Smiley";
+    //public static ArrayList<SmileyRatingAnswer> ratingAnswerArrayList;
+    private FeedbackAnswerArrayModel answerArrayModels;
+    public static List<FeedbackAnswerArrayModel> feedbackAnsArr;
+
+
+    public ProductFeedbackListAdapter(Context context, ArrayList<ProductFeedback> items) {
+        this.context = context;
+        this.Questions = items;
+        answerArrayModels = new FeedbackAnswerArrayModel();
+        feedbackAnsArr = new ArrayList<>();
+    }
+
+    @NonNull
+    @Override
+    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_smiley_feedback, parent, false);
+        return new ViewHolder(v);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
+        ProductFeedback item = Questions.get(position);
+        holder.view.setTag(item);
+        holder.feedBackQuestionsId.setText(String.format("%s. ", item.getQid()));
+        holder.feedBackQuestions.setText(item.getQuestiontext());
+
+        holder.smileRating.setOnSmileySelectionListener(new SmileyRating.OnSmileySelectionListener() {
+            @Override
+            public void onSmileySelected(int smiley, boolean reselected) {
+                answerArrayModels = new FeedbackAnswerArrayModel();
+                answerArrayModels.setQid(Questions.get(position).getQid());
+                answerArrayModels.setSurveyRating(Integer.valueOf(Questions.get(position).getRating_options().get(smiley).getRating_text()));
+                feedbackAnsArr.add(answerArrayModels);
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return Questions.size();
+    }
+
+    @Override
+    public void onSmileySelected(int smiley, boolean reselected) {
+
+    }
+
+
+    public class ViewHolder extends RecyclerView.ViewHolder {
+        TextView feedBackQuestionsId, feedBackQuestions;
+        View view;
+        SmileyRating smileRating;
+        private ViewHolder(View itemView) {
+            super(itemView);
+            view = itemView;
+            smileRating = view.findViewById(R.id.smiley_rating);
+            feedBackQuestions = view.findViewById(R.id.feedbackQuestion);
+            feedBackQuestionsId = view.findViewById(R.id.feedbackQuestionId);
+        }
+
+    }
+}

+ 80 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/ProductListAdapter.java

@@ -0,0 +1,80 @@
+package com.cygnusa.hyperm.adapter;
+
+
+import android.app.Activity;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.GetAllExploreImageList;
+
+import java.util.List;
+
+public class ProductListAdapter extends BaseAdapter {
+    private Context context;
+    private List<GetAllExploreImageList> data;
+
+    public ProductListAdapter(Context context, List<GetAllExploreImageList> data) {
+        this.context = context;
+        this.data = data;
+    }
+
+    @Override
+    public int getCount() {
+
+        return data.size()+1;
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return null;
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return 0;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+
+        ViewHolder holder;
+        if (convertView == null) {
+            holder = new ViewHolder();
+            LayoutInflater inflater = ((Activity) context).getLayoutInflater();
+            convertView = inflater.inflate(
+                    R.layout.grid_item_layout, null);
+            holder.image = convertView.findViewById(R.id.image);
+            convertView.setTag(holder);
+        } else {
+            holder = (ViewHolder) convertView.getTag();
+        }
+
+        if (position == data.size()) {
+            Glide.with(context).load(R.drawable.coming_soon_1)
+                    .thumbnail(Glide.with(context).load(R.drawable.coming_soon_1))
+                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                            .placeholder(R.drawable.placeholder)).into(holder.image);
+        } else {
+            Glide.with(context).load(data.get(position).getModelEnquiryUrl())
+                    .thumbnail(Glide.with(context).load(R.drawable.gif_loader))
+                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                            .placeholder(R.drawable.placeholder)).into(holder.image);
+        }
+
+        return convertView;
+    }
+
+    static class ViewHolder {
+        ImageView image;
+    }
+}
+
+

+ 76 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/ProductVideoAdapter.java

@@ -0,0 +1,76 @@
+package com.cygnusa.hyperm.adapter;
+
+
+import android.app.Activity;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.ProductVideos;
+
+import java.util.ArrayList;
+
+public class ProductVideoAdapter extends BaseAdapter {
+    private Context context;
+    private ArrayList<ProductVideos> data;
+
+    public ProductVideoAdapter(Context context, ArrayList<ProductVideos> data) {
+        this.context = context;
+        this.data = data;
+    }
+
+    @Override
+    public int getCount() {
+
+        return data.size();
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return null;
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return 0;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        ViewHolder holder;
+        if (convertView == null) {
+            holder = new ViewHolder();
+            LayoutInflater inflater = ((Activity) context).getLayoutInflater();
+            convertView = inflater.inflate(
+                    R.layout.grid_video_layout, null);
+            holder.image = convertView.findViewById(R.id.image);
+            holder.title = convertView.findViewById(R.id.title);
+            holder.videoIcon = convertView.findViewById(R.id.videoicon);
+            convertView.setTag(holder);
+        } else {
+            holder = (ViewHolder) convertView.getTag();
+        }
+        holder.title.setText(data.get(position).getTitle());
+            Glide.with(context).load(data.get(position).getThumb_url())
+                    .thumbnail(Glide.with(context).load(R.drawable.gif_loader))
+                    .apply(new RequestOptions().fitCenter().diskCacheStrategy(DiskCacheStrategy.ALL)
+                            .placeholder(R.drawable.placeholder)).into(holder.image);
+
+        return convertView;
+    }
+    static class ViewHolder {
+        ImageView image;
+        ImageView videoIcon;
+        TextView title;
+    }
+}
+
+

+ 103 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/QuestionAdapter.java

@@ -0,0 +1,103 @@
+package com.cygnusa.hyperm.adapter;
+
+import android.content.Context;
+import androidx.appcompat.widget.AppCompatCheckBox;
+import androidx.appcompat.widget.AppCompatRadioButton;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ListView;
+
+import com.cygnusa.hyperm.R;
+import com.cygnusa.hyperm.wrappers.QuestionOption;
+
+import java.util.ArrayList;
+
+
+public class QuestionAdapter extends BaseAdapter {
+
+    private ArrayList<QuestionOption> options;
+    private LayoutInflater inflater;
+    private String qType;
+
+    public QuestionAdapter(Context context, ArrayList<QuestionOption> options,
+                           ListView listView, String qType) {
+        this.options = options;
+        inflater = LayoutInflater.from(listView.getContext());
+        this.qType = qType;
+    }
+
+    @Override
+    public int getCount() {
+        return options.size();
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return null;
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return 0;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        ViewHolder holder;
+        if (convertView == null) {
+            holder = new ViewHolder();
+            if (qType.trim().equalsIgnoreCase("1")) {
+                convertView = inflater.inflate(
+                        R.layout.answer_single_choice, null);
+                holder.radioButton = convertView.findViewById(R.id.radioButton);
+            } else if (qType.trim().equalsIgnoreCase("2")) {
+                convertView = inflater.inflate(
+                        R.layout.answer_multi_choice, null);
+                holder.checkBox = convertView.findViewById(R.id.checkBox);
+            }
+            convertView.setTag(holder);
+        } else {
+            holder = (ViewHolder) convertView.getTag();
+        }
+
+        if (qType.trim().equalsIgnoreCase("1")) {
+            holder.radioButton.setChecked(options.get(position).isChecked());
+            holder.radioButton.setText(options.get(position).getOpttext());
+        } else if (qType.trim().equalsIgnoreCase("2")) {
+            holder.checkBox.setChecked(options.get(position).isChecked());
+            holder.checkBox.setText(options.get(position).getOpttext());
+        }
+
+        if (qType.trim().equalsIgnoreCase("1")) {
+            holder.radioButton.setId(position);
+            holder.radioButton.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    for (QuestionOption option : options) {
+                        option.setChecked(false);
+                    }
+                    options.get(v.getId()).setChecked(true);
+                    notifyDataSetChanged();
+                }
+            });
+        } else if (qType.trim().equalsIgnoreCase("2")) {
+            holder.checkBox.setId(position);
+            holder.checkBox.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    options.get(v.getId()).setChecked(!options.get(v.getId()).isChecked());
+                    notifyDataSetChanged();
+                }
+            });
+        }
+
+        return convertView;
+    }
+
+    static class ViewHolder {
+        AppCompatRadioButton radioButton;
+        AppCompatCheckBox checkBox;
+    }
+}

+ 0 - 0
Android/app/src/main/java/com/cygnusa/hyperm/adapter/RedeemPointListAdapter.java


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません